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.
/*
* Zuora API Reference
* REST API reference for the Zuora Billing, Payments, and Central Platform! Check out the [REST API Overview](https://www.zuora.com/developer/api-references/api/overview/).
*
* The version of the OpenAPI document: 2024-05-20
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.zuora.api;
import com.zuora.ApiCallback;
import com.zuora.ApiClient;
import com.zuora.ApiException;
import com.zuora.ApiResponse;
import com.zuora.Configuration;
import com.zuora.Pair;
import com.zuora.ProgressRequestBody;
import com.zuora.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.zuora.model.BadRequestResponse;
import java.math.BigDecimal;
import com.zuora.model.CommonErrorResponse;
import com.zuora.model.DeleteWorkflowError;
import com.zuora.model.DeleteWorkflowSuccess;
import com.zuora.model.ExportWorkflowVersionResponse;
import com.zuora.model.GetVersionsResponse;
import com.zuora.model.GetWorkflowResponse;
import com.zuora.model.GetWorkflowsResponse;
import java.time.LocalDate;
import com.zuora.model.PATCHUpdateWorkflowRequest;
import com.zuora.model.PostRunWorkflow400Response;
import com.zuora.model.PostRunWorkflow406Response;
import com.zuora.model.PostWorkflowDefinitionImportRequest;
import com.zuora.model.PostWorkflowVersionsImportRequest;
import com.zuora.model.ProxyUnauthorizedResponse;
import com.zuora.model.PutTasksRequest;
import com.zuora.model.Task;
import com.zuora.model.TasksResponse;
import com.zuora.model.UsagesResponse;
import com.zuora.model.ValidationErrors;
import com.zuora.model.Workflow;
import com.zuora.model.WorkflowDefinition;
import com.zuora.model.WorkflowInstance;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class WorkflowsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public WorkflowsApi() {
this(Configuration.getDefaultApiClient());
}
public WorkflowsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
private okhttp3.Call deleteWorkflowCall(String workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/workflows/{workflow_id}"
.replace("{" + "workflow_id" + "}", localVarApiClient.escapeString(workflowId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteWorkflowValidateBeforeCall(String workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'workflowId' is set
if (workflowId == null) {
throw new ApiException("Missing the required parameter 'workflowId' when calling deleteWorkflow(Async)");
}
return deleteWorkflowCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Delete a workflow
* Deletes a specific workflow by its ID. ### User Access Permission You must be assigned the **Workflow Manage Access** permission to run this operation.
* @param workflowId The unique ID of a workflow definition. For example, 19080. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return DeleteWorkflowSuccess
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected DeleteWorkflowSuccess deleteWorkflow(String workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = deleteWorkflowWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse deleteWorkflowWithHttpInfo(String workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = deleteWorkflowValidateBeforeCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call deleteWorkflowAsync(String workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteWorkflowValidateBeforeCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class DeleteWorkflowApi {
private final String workflowId;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraEntityIds;
private String zuoraTrackId;
private String zuoraVersion;
private String zuoraOrgIds;
private DeleteWorkflowApi(String workflowId) {
this.workflowId = workflowId;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return DeleteWorkflowApi
*/
public DeleteWorkflowApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return DeleteWorkflowApi
*/
public DeleteWorkflowApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return DeleteWorkflowApi
*/
public DeleteWorkflowApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return DeleteWorkflowApi
*/
public DeleteWorkflowApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return DeleteWorkflowApi
*/
public DeleteWorkflowApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return DeleteWorkflowApi
*/
public DeleteWorkflowApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return DeleteWorkflowApi
*/
public DeleteWorkflowApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for deleteWorkflow
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public DeleteWorkflowSuccess execute() throws ApiException {
ApiResponse localVarResp = deleteWorkflowWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute deleteWorkflow request with HTTP info returned
* @return ApiResponse<DeleteWorkflowSuccess>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return deleteWorkflowWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
}
/**
* Execute deleteWorkflow request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return deleteWorkflowAsync(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Delete a workflow
* Deletes a specific workflow by its ID. ### User Access Permission You must be assigned the **Workflow Manage Access** permission to run this operation.
* @param workflowId The unique ID of a workflow definition. For example, 19080. (required)
* @return DeleteWorkflowApi
*/
public DeleteWorkflowApi deleteWorkflowApi(String workflowId) {
return new DeleteWorkflowApi(workflowId);
}
private okhttp3.Call deleteWorkflowVersionCall(Integer versionId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/versions/{version_id}"
.replace("{" + "version_id" + "}", localVarApiClient.escapeString(versionId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteWorkflowVersionValidateBeforeCall(Integer versionId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'versionId' is set
if (versionId == null) {
throw new ApiException("Missing the required parameter 'versionId' when calling deleteWorkflowVersion(Async)");
}
return deleteWorkflowVersionCall(versionId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Delete a workflow version
* Delete a workflow version based on the version id. ### User Access Permission You must be assigned the **Workflow Manage Access** permission to run this operation.
* @param versionId The unique id of the workflow version. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return DeleteWorkflowSuccess
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected DeleteWorkflowSuccess deleteWorkflowVersion(Integer versionId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = deleteWorkflowVersionWithHttpInfo(versionId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse deleteWorkflowVersionWithHttpInfo(Integer versionId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = deleteWorkflowVersionValidateBeforeCall(versionId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call deleteWorkflowVersionAsync(Integer versionId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteWorkflowVersionValidateBeforeCall(versionId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class DeleteWorkflowVersionApi {
private final Integer versionId;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraTrackId;
private String zuoraVersion;
private String zuoraOrgIds;
private DeleteWorkflowVersionApi(Integer versionId) {
this.versionId = versionId;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return DeleteWorkflowVersionApi
*/
public DeleteWorkflowVersionApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return DeleteWorkflowVersionApi
*/
public DeleteWorkflowVersionApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return DeleteWorkflowVersionApi
*/
public DeleteWorkflowVersionApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return DeleteWorkflowVersionApi
*/
public DeleteWorkflowVersionApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return DeleteWorkflowVersionApi
*/
public DeleteWorkflowVersionApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return DeleteWorkflowVersionApi
*/
public DeleteWorkflowVersionApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for deleteWorkflowVersion
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public DeleteWorkflowSuccess execute() throws ApiException {
ApiResponse localVarResp = deleteWorkflowVersionWithHttpInfo(versionId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute deleteWorkflowVersion request with HTTP info returned
* @return ApiResponse<DeleteWorkflowSuccess>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return deleteWorkflowVersionWithHttpInfo(versionId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds);
}
/**
* Execute deleteWorkflowVersion request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return deleteWorkflowVersionAsync(versionId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Delete a workflow version
* Delete a workflow version based on the version id. ### User Access Permission You must be assigned the **Workflow Manage Access** permission to run this operation.
* @param versionId The unique id of the workflow version. (required)
* @return DeleteWorkflowVersionApi
*/
public DeleteWorkflowVersionApi deleteWorkflowVersionApi(Integer versionId) {
return new DeleteWorkflowVersionApi(versionId);
}
private okhttp3.Call getWorkflowCall(String workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/workflows/{workflow_id}"
.replace("{" + "workflow_id" + "}", localVarApiClient.escapeString(workflowId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWorkflowValidateBeforeCall(String workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'workflowId' is set
if (workflowId == null) {
throw new ApiException("Missing the required parameter 'workflowId' when calling getWorkflow(Async)");
}
return getWorkflowCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Retrieve a workflow
* Retrieves information about a specific workflow by its ID. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param workflowId The unique ID of a workflow definition. For example, 19080. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return WorkflowDefinition
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected WorkflowDefinition getWorkflow(String workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getWorkflowWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getWorkflowWithHttpInfo(String workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getWorkflowValidateBeforeCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getWorkflowAsync(String workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getWorkflowValidateBeforeCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetWorkflowApi {
private final String workflowId;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraEntityIds;
private String zuoraTrackId;
private String zuoraVersion;
private String zuoraOrgIds;
private GetWorkflowApi(String workflowId) {
this.workflowId = workflowId;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return GetWorkflowApi
*/
public GetWorkflowApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return GetWorkflowApi
*/
public GetWorkflowApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return GetWorkflowApi
*/
public GetWorkflowApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return GetWorkflowApi
*/
public GetWorkflowApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return GetWorkflowApi
*/
public GetWorkflowApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetWorkflowApi
*/
public GetWorkflowApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetWorkflowApi
*/
public GetWorkflowApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getWorkflow
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public WorkflowDefinition execute() throws ApiException {
ApiResponse localVarResp = getWorkflowWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getWorkflow request with HTTP info returned
* @return ApiResponse<WorkflowDefinition>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return getWorkflowWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getWorkflow request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getWorkflowAsync(workflowId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Retrieve a workflow
* Retrieves information about a specific workflow by its ID. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param workflowId The unique ID of a workflow definition. For example, 19080. (required)
* @return GetWorkflowApi
*/
public GetWorkflowApi getWorkflowApi(String workflowId) {
return new GetWorkflowApi(workflowId);
}
private okhttp3.Call getWorkflowExportCall(Integer workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String version, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/workflows/{workflow_id}/export"
.replace("{" + "workflow_id" + "}", localVarApiClient.escapeString(workflowId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (version != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("version", version));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWorkflowExportValidateBeforeCall(Integer workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String version, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'workflowId' is set
if (workflowId == null) {
throw new ApiException("Missing the required parameter 'workflowId' when calling getWorkflowExport(Async)");
}
return getWorkflowExportCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, version, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Export a workflow version
* Exports a workflow version into a JSON file. This file can be used to create a copy of this workflow version. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param workflowId The ID of the workflow definition to export. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param version Default result is the active version of the workflow definition. Version number and 'latest' can be used to export a specific version of the workflow definition. (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return ExportWorkflowVersionResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected ExportWorkflowVersionResponse getWorkflowExport(Integer workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String version, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getWorkflowExportWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, version, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getWorkflowExportWithHttpInfo(Integer workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String version, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getWorkflowExportValidateBeforeCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, version, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getWorkflowExportAsync(Integer workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String version, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getWorkflowExportValidateBeforeCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, version, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetWorkflowExportApi {
private final Integer workflowId;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraTrackId;
private String version;
private String zuoraVersion;
private String zuoraOrgIds;
private GetWorkflowExportApi(Integer workflowId) {
this.workflowId = workflowId;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return GetWorkflowExportApi
*/
public GetWorkflowExportApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return GetWorkflowExportApi
*/
public GetWorkflowExportApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return GetWorkflowExportApi
*/
public GetWorkflowExportApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return GetWorkflowExportApi
*/
public GetWorkflowExportApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set version
* @param version Default result is the active version of the workflow definition. Version number and 'latest' can be used to export a specific version of the workflow definition. (optional)
* @return GetWorkflowExportApi
*/
public GetWorkflowExportApi version(String version) {
this.version = version;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetWorkflowExportApi
*/
public GetWorkflowExportApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetWorkflowExportApi
*/
public GetWorkflowExportApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getWorkflowExport
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public ExportWorkflowVersionResponse execute() throws ApiException {
ApiResponse localVarResp = getWorkflowExportWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, version, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getWorkflowExport request with HTTP info returned
* @return ApiResponse<ExportWorkflowVersionResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return getWorkflowExportWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, version, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getWorkflowExport request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getWorkflowExportAsync(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, version, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Export a workflow version
* Exports a workflow version into a JSON file. This file can be used to create a copy of this workflow version. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param workflowId The ID of the workflow definition to export. (required)
* @return GetWorkflowExportApi
*/
public GetWorkflowExportApi getWorkflowExportApi(Integer workflowId) {
return new GetWorkflowExportApi(workflowId);
}
private okhttp3.Call getWorkflowRunCall(String workflowRunId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/workflows/workflow_runs/{workflow_run_id}"
.replace("{" + "workflow_run_id" + "}", localVarApiClient.escapeString(workflowRunId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWorkflowRunValidateBeforeCall(String workflowRunId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'workflowRunId' is set
if (workflowRunId == null) {
throw new ApiException("Missing the required parameter 'workflowRunId' when calling getWorkflowRun(Async)");
}
return getWorkflowRunCall(workflowRunId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Retrieve a workflow run
* Retrieves information about a specific workflow run by its ID. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param workflowRunId The unique ID of a workflow run. For example, 19080. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetWorkflowResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected GetWorkflowResponse getWorkflowRun(String workflowRunId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getWorkflowRunWithHttpInfo(workflowRunId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getWorkflowRunWithHttpInfo(String workflowRunId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getWorkflowRunValidateBeforeCall(workflowRunId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getWorkflowRunAsync(String workflowRunId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getWorkflowRunValidateBeforeCall(workflowRunId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetWorkflowRunApi {
private final String workflowRunId;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraEntityIds;
private String zuoraTrackId;
private String zuoraVersion;
private String zuoraOrgIds;
private GetWorkflowRunApi(String workflowRunId) {
this.workflowRunId = workflowRunId;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return GetWorkflowRunApi
*/
public GetWorkflowRunApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return GetWorkflowRunApi
*/
public GetWorkflowRunApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return GetWorkflowRunApi
*/
public GetWorkflowRunApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return GetWorkflowRunApi
*/
public GetWorkflowRunApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return GetWorkflowRunApi
*/
public GetWorkflowRunApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetWorkflowRunApi
*/
public GetWorkflowRunApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetWorkflowRunApi
*/
public GetWorkflowRunApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getWorkflowRun
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public GetWorkflowResponse execute() throws ApiException {
ApiResponse localVarResp = getWorkflowRunWithHttpInfo(workflowRunId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getWorkflowRun request with HTTP info returned
* @return ApiResponse<GetWorkflowResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return getWorkflowRunWithHttpInfo(workflowRunId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getWorkflowRun request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getWorkflowRunAsync(workflowRunId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Retrieve a workflow run
* Retrieves information about a specific workflow run by its ID. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param workflowRunId The unique ID of a workflow run. For example, 19080. (required)
* @return GetWorkflowRunApi
*/
public GetWorkflowRunApi getWorkflowRunApi(String workflowRunId) {
return new GetWorkflowRunApi(workflowRunId);
}
private okhttp3.Call getWorkflowVersionsCall(Integer workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/workflows/{workflow_id}/versions"
.replace("{" + "workflow_id" + "}", localVarApiClient.escapeString(workflowId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWorkflowVersionsValidateBeforeCall(Integer workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'workflowId' is set
if (workflowId == null) {
throw new ApiException("Missing the required parameter 'workflowId' when calling getWorkflowVersions(Async)");
}
return getWorkflowVersionsCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* List all versions of a workflow definition
* Return a list of all workflow versions under a workflow definition ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param workflowId The unique id of the workflow definition to import a workflow version under. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetVersionsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected GetVersionsResponse getWorkflowVersions(Integer workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getWorkflowVersionsWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getWorkflowVersionsWithHttpInfo(Integer workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getWorkflowVersionsValidateBeforeCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getWorkflowVersionsAsync(Integer workflowId, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getWorkflowVersionsValidateBeforeCall(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetWorkflowVersionsApi {
private final Integer workflowId;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraTrackId;
private String zuoraVersion;
private String zuoraOrgIds;
private GetWorkflowVersionsApi(Integer workflowId) {
this.workflowId = workflowId;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return GetWorkflowVersionsApi
*/
public GetWorkflowVersionsApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return GetWorkflowVersionsApi
*/
public GetWorkflowVersionsApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return GetWorkflowVersionsApi
*/
public GetWorkflowVersionsApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return GetWorkflowVersionsApi
*/
public GetWorkflowVersionsApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetWorkflowVersionsApi
*/
public GetWorkflowVersionsApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetWorkflowVersionsApi
*/
public GetWorkflowVersionsApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getWorkflowVersions
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public GetVersionsResponse execute() throws ApiException {
ApiResponse localVarResp = getWorkflowVersionsWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getWorkflowVersions request with HTTP info returned
* @return ApiResponse<GetVersionsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return getWorkflowVersionsWithHttpInfo(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getWorkflowVersions request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getWorkflowVersionsAsync(workflowId, acceptEncoding, contentEncoding, authorization, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* List all versions of a workflow definition
* Return a list of all workflow versions under a workflow definition ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param workflowId The unique id of the workflow definition to import a workflow version under. (required)
* @return GetWorkflowVersionsApi
*/
public GetWorkflowVersionsApi getWorkflowVersionsApi(Integer workflowId) {
return new GetWorkflowVersionsApi(workflowId);
}
private okhttp3.Call getWorkflowsCall(String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, Boolean calloutTrigger, String interval, String name, Boolean ondemandTrigger, Boolean scheduledTrigger, Integer page, Integer pageLength, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/workflows";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (calloutTrigger != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("callout_trigger", calloutTrigger));
}
if (interval != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("interval", interval));
}
if (name != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name));
}
if (ondemandTrigger != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("ondemand_trigger", ondemandTrigger));
}
if (scheduledTrigger != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("scheduled_trigger", scheduledTrigger));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (pageLength != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_length", pageLength));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWorkflowsValidateBeforeCall(String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, Boolean calloutTrigger, String interval, String name, Boolean ondemandTrigger, Boolean scheduledTrigger, Integer page, Integer pageLength, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
return getWorkflowsCall(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, calloutTrigger, interval, name, ondemandTrigger, scheduledTrigger, page, pageLength, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* List workflows
* Retrieves a list of workflow definitions available in your Zuora tenant. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param calloutTrigger If set to true, the operation retrieves workflows that have the callout trigger enabled. If set to false, the operation retrieves workflows that have the callout trigger disabled. If not specified, the operation will not use this filter. (optional)
* @param interval A CRON expession that specifies a schedule (for example, `0 0 * * *`). If specified, the operation retrieves the workflow that is run based on the specified schedule. (optional)
* @param name If specified, the operation retrieves the workflow that is in the specified name. (optional)
* @param ondemandTrigger If set to true, the operation retrieves workflows that have the ondemand trigger enabled. If set to false, the operation retrieves workflows that have the ondemand trigger disabled. If not specified, the operation will not use this filter. (optional)
* @param scheduledTrigger If set to true, the operation retrieves workflows that have the scheduled trigger enabled. If set to false, the operation retrieves workflows that have the scheduled trigger disabled. If not specfied, the operation will not use this filter. (optional)
* @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1)
* @param pageLength The number of workflows shown in a single call. If the `page` parameter is not specified, the operation will return only the first page of results. If there are multiple pages of results, use it with the `page` parameter to get the results on subsequent pages. The maximum value is 50. (optional, default to 20)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetWorkflowsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected GetWorkflowsResponse getWorkflows(String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, Boolean calloutTrigger, String interval, String name, Boolean ondemandTrigger, Boolean scheduledTrigger, Integer page, Integer pageLength, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getWorkflowsWithHttpInfo(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, calloutTrigger, interval, name, ondemandTrigger, scheduledTrigger, page, pageLength, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getWorkflowsWithHttpInfo(String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, Boolean calloutTrigger, String interval, String name, Boolean ondemandTrigger, Boolean scheduledTrigger, Integer page, Integer pageLength, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getWorkflowsValidateBeforeCall(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, calloutTrigger, interval, name, ondemandTrigger, scheduledTrigger, page, pageLength, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getWorkflowsAsync(String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, Boolean calloutTrigger, String interval, String name, Boolean ondemandTrigger, Boolean scheduledTrigger, Integer page, Integer pageLength, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getWorkflowsValidateBeforeCall(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, calloutTrigger, interval, name, ondemandTrigger, scheduledTrigger, page, pageLength, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetWorkflowsApi {
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraEntityIds;
private String zuoraTrackId;
private Boolean calloutTrigger;
private String interval;
private String name;
private Boolean ondemandTrigger;
private Boolean scheduledTrigger;
private Integer page;
private Integer pageLength;
private String zuoraVersion;
private String zuoraOrgIds;
private GetWorkflowsApi() {
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set calloutTrigger
* @param calloutTrigger If set to true, the operation retrieves workflows that have the callout trigger enabled. If set to false, the operation retrieves workflows that have the callout trigger disabled. If not specified, the operation will not use this filter. (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi calloutTrigger(Boolean calloutTrigger) {
this.calloutTrigger = calloutTrigger;
return this;
}
/**
* Set interval
* @param interval A CRON expession that specifies a schedule (for example, `0 0 * * *`). If specified, the operation retrieves the workflow that is run based on the specified schedule. (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi interval(String interval) {
this.interval = interval;
return this;
}
/**
* Set name
* @param name If specified, the operation retrieves the workflow that is in the specified name. (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi name(String name) {
this.name = name;
return this;
}
/**
* Set ondemandTrigger
* @param ondemandTrigger If set to true, the operation retrieves workflows that have the ondemand trigger enabled. If set to false, the operation retrieves workflows that have the ondemand trigger disabled. If not specified, the operation will not use this filter. (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi ondemandTrigger(Boolean ondemandTrigger) {
this.ondemandTrigger = ondemandTrigger;
return this;
}
/**
* Set scheduledTrigger
* @param scheduledTrigger If set to true, the operation retrieves workflows that have the scheduled trigger enabled. If set to false, the operation retrieves workflows that have the scheduled trigger disabled. If not specfied, the operation will not use this filter. (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi scheduledTrigger(Boolean scheduledTrigger) {
this.scheduledTrigger = scheduledTrigger;
return this;
}
/**
* Set page
* @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi page(Integer page) {
this.page = page;
return this;
}
/**
* Set pageLength
* @param pageLength The number of workflows shown in a single call. If the `page` parameter is not specified, the operation will return only the first page of results. If there are multiple pages of results, use it with the `page` parameter to get the results on subsequent pages. The maximum value is 50. (optional, default to 20)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi pageLength(Integer pageLength) {
this.pageLength = pageLength;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetWorkflowsApi
*/
public GetWorkflowsApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getWorkflows
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public GetWorkflowsResponse execute() throws ApiException {
ApiResponse localVarResp = getWorkflowsWithHttpInfo(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, calloutTrigger, interval, name, ondemandTrigger, scheduledTrigger, page, pageLength, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getWorkflows request with HTTP info returned
* @return ApiResponse<GetWorkflowsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return getWorkflowsWithHttpInfo(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, calloutTrigger, interval, name, ondemandTrigger, scheduledTrigger, page, pageLength, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getWorkflows request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getWorkflowsAsync(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, calloutTrigger, interval, name, ondemandTrigger, scheduledTrigger, page, pageLength, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* List workflows
* Retrieves a list of workflow definitions available in your Zuora tenant. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @return GetWorkflowsApi
*/
public GetWorkflowsApi getWorkflowsApi() {
return new GetWorkflowsApi();
}
private okhttp3.Call getWorkflowsTaskCall(String taskId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/workflows/tasks/{task_id}"
.replace("{" + "task_id" + "}", localVarApiClient.escapeString(taskId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWorkflowsTaskValidateBeforeCall(String taskId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'taskId' is set
if (taskId == null) {
throw new ApiException("Missing the required parameter 'taskId' when calling getWorkflowsTask(Async)");
}
return getWorkflowsTaskCall(taskId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Retrieve a workflow task
* Retrieves a specific workflow task by its ID. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param taskId The unique ID of the task. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return Task
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected Task getWorkflowsTask(String taskId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getWorkflowsTaskWithHttpInfo(taskId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getWorkflowsTaskWithHttpInfo(String taskId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getWorkflowsTaskValidateBeforeCall(taskId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getWorkflowsTaskAsync(String taskId, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getWorkflowsTaskValidateBeforeCall(taskId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetWorkflowsTaskApi {
private final String taskId;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraEntityIds;
private String zuoraTrackId;
private String zuoraVersion;
private String zuoraOrgIds;
private GetWorkflowsTaskApi(String taskId) {
this.taskId = taskId;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return GetWorkflowsTaskApi
*/
public GetWorkflowsTaskApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return GetWorkflowsTaskApi
*/
public GetWorkflowsTaskApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return GetWorkflowsTaskApi
*/
public GetWorkflowsTaskApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return GetWorkflowsTaskApi
*/
public GetWorkflowsTaskApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return GetWorkflowsTaskApi
*/
public GetWorkflowsTaskApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetWorkflowsTaskApi
*/
public GetWorkflowsTaskApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetWorkflowsTaskApi
*/
public GetWorkflowsTaskApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getWorkflowsTask
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public Task execute() throws ApiException {
ApiResponse localVarResp = getWorkflowsTaskWithHttpInfo(taskId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getWorkflowsTask request with HTTP info returned
* @return ApiResponse<Task>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return getWorkflowsTaskWithHttpInfo(taskId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getWorkflowsTask request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getWorkflowsTaskAsync(taskId, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Retrieve a workflow task
* Retrieves a specific workflow task by its ID. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param taskId The unique ID of the task. (required)
* @return GetWorkflowsTaskApi
*/
public GetWorkflowsTaskApi getWorkflowsTaskApi(String taskId) {
return new GetWorkflowsTaskApi(taskId);
}
private okhttp3.Call getWorkflowsTasksCall(String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String id, String name, Boolean instance, String actionType, String _object, String objectId, String callType, String workflowId, List tags, Integer page, Integer pageLength, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/workflows/tasks";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (id != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("id", id));
}
if (name != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", name));
}
if (instance != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("instance", instance));
}
if (actionType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("action_type", actionType));
}
if (_object != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("object", _object));
}
if (objectId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("object_id", objectId));
}
if (callType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("call_type", callType));
}
if (workflowId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("workflow_id", workflowId));
}
if (tags != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "tags", tags));
}
if (page != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page));
}
if (pageLength != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_length", pageLength));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWorkflowsTasksValidateBeforeCall(String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String id, String name, Boolean instance, String actionType, String _object, String objectId, String callType, String workflowId, List tags, Integer page, Integer pageLength, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
return getWorkflowsTasksCall(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, id, name, instance, actionType, _object, objectId, callType, workflowId, tags, page, pageLength, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* List workflow tasks
* Retrieves a list of workflow tasks available in your Zuora tenant. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param id If specified, the operation retrieves the task that is with specified id. (optional)
* @param name If specified, the operation retrieves tasks that is in the specified name. (optional)
* @param instance If set to true, the operation retrieves workflows that have the scheduled trigger enabled. If set to false, the operation retrieves workflows that have the scheduled trigger disabled. If not specfied, the operation will not use this filter. (optional)
* @param actionType If specified, the operation retrieves tasks that is the specified type. (optional)
* @param _object If specified, the operation retrieves tasks with the specified object. (optional)
* @param objectId If specified, the operation retrieves tasks with the specified object id. (optional)
* @param callType If specified, the operation retrieves tasks with the specified api call type used. (optional)
* @param workflowId If specified, the operation retrieves tasks that for the specified workflow id. (optional)
* @param tags If specified, the operation retrieves tasks that with the specified filter tags. Use the following syntax to specify multiple tags: `tags[]=tag_value_1&tags[]=tag_value_2`. **Note:** All the workflow tasks that have any of the specified tags will be listed in the response body. (optional)
* @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1)
* @param pageLength The number of workflow tasks shown in a single call. If the `page` parameter is not specified, the operation will return only the first page of results. If there are multiple pages of results, use it with the `page` parameter to get the results on subsequent pages. The maximum value is 100. (optional, default to 20)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return TasksResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected TasksResponse getWorkflowsTasks(String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String id, String name, Boolean instance, String actionType, String _object, String objectId, String callType, String workflowId, List tags, Integer page, Integer pageLength, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getWorkflowsTasksWithHttpInfo(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, id, name, instance, actionType, _object, objectId, callType, workflowId, tags, page, pageLength, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getWorkflowsTasksWithHttpInfo(String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String id, String name, Boolean instance, String actionType, String _object, String objectId, String callType, String workflowId, List tags, Integer page, Integer pageLength, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getWorkflowsTasksValidateBeforeCall(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, id, name, instance, actionType, _object, objectId, callType, workflowId, tags, page, pageLength, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getWorkflowsTasksAsync(String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String id, String name, Boolean instance, String actionType, String _object, String objectId, String callType, String workflowId, List tags, Integer page, Integer pageLength, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getWorkflowsTasksValidateBeforeCall(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, id, name, instance, actionType, _object, objectId, callType, workflowId, tags, page, pageLength, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetWorkflowsTasksApi {
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraEntityIds;
private String zuoraTrackId;
private String id;
private String name;
private Boolean instance;
private String actionType;
private String _object;
private String objectId;
private String callType;
private String workflowId;
private List tags;
private Integer page;
private Integer pageLength;
private String zuoraVersion;
private String zuoraOrgIds;
private GetWorkflowsTasksApi() {
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set id
* @param id If specified, the operation retrieves the task that is with specified id. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi id(String id) {
this.id = id;
return this;
}
/**
* Set name
* @param name If specified, the operation retrieves tasks that is in the specified name. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi name(String name) {
this.name = name;
return this;
}
/**
* Set instance
* @param instance If set to true, the operation retrieves workflows that have the scheduled trigger enabled. If set to false, the operation retrieves workflows that have the scheduled trigger disabled. If not specfied, the operation will not use this filter. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi instance(Boolean instance) {
this.instance = instance;
return this;
}
/**
* Set actionType
* @param actionType If specified, the operation retrieves tasks that is the specified type. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi actionType(String actionType) {
this.actionType = actionType;
return this;
}
/**
* Set _object
* @param _object If specified, the operation retrieves tasks with the specified object. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi _object(String _object) {
this._object = _object;
return this;
}
/**
* Set objectId
* @param objectId If specified, the operation retrieves tasks with the specified object id. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi objectId(String objectId) {
this.objectId = objectId;
return this;
}
/**
* Set callType
* @param callType If specified, the operation retrieves tasks with the specified api call type used. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi callType(String callType) {
this.callType = callType;
return this;
}
/**
* Set workflowId
* @param workflowId If specified, the operation retrieves tasks that for the specified workflow id. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi workflowId(String workflowId) {
this.workflowId = workflowId;
return this;
}
/**
* Set tags
* @param tags If specified, the operation retrieves tasks that with the specified filter tags. Use the following syntax to specify multiple tags: `tags[]=tag_value_1&tags[]=tag_value_2`. **Note:** All the workflow tasks that have any of the specified tags will be listed in the response body. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi tags(List tags) {
this.tags = tags;
return this;
}
/**
* Set page
* @param page The index number of the page that you want to retrieve. This parameter is dependent on `pageSize`. You must set `pageSize` before specifying `page`. For example, if you set `pageSize` to `20` and `page` to `2`, the 21st to 40th records are returned in the response. (optional, default to 1)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi page(Integer page) {
this.page = page;
return this;
}
/**
* Set pageLength
* @param pageLength The number of workflow tasks shown in a single call. If the `page` parameter is not specified, the operation will return only the first page of results. If there are multiple pages of results, use it with the `page` parameter to get the results on subsequent pages. The maximum value is 100. (optional, default to 20)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi pageLength(Integer pageLength) {
this.pageLength = pageLength;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getWorkflowsTasks
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return getWorkflowsTasksWithHttpInfo(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, id, name, instance, actionType, _object, objectId, callType, workflowId, tags, page, pageLength, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getWorkflowsTasks request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getWorkflowsTasksAsync(acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, id, name, instance, actionType, _object, objectId, callType, workflowId, tags, page, pageLength, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* List workflow tasks
* Retrieves a list of workflow tasks available in your Zuora tenant. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @return GetWorkflowsTasksApi
*/
public GetWorkflowsTasksApi getWorkflowsTasksApi() {
return new GetWorkflowsTasksApi();
}
private okhttp3.Call getWorkflowsUsagesCall(LocalDate startDate, LocalDate endDate, String metrics, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/workflows/metrics.json";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (startDate != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("startDate", startDate));
}
if (endDate != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("endDate", endDate));
}
if (metrics != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("metrics", metrics));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getWorkflowsUsagesValidateBeforeCall(LocalDate startDate, LocalDate endDate, String metrics, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'startDate' is set
if (startDate == null) {
throw new ApiException("Missing the required parameter 'startDate' when calling getWorkflowsUsages(Async)");
}
// verify the required parameter 'endDate' is set
if (endDate == null) {
throw new ApiException("Missing the required parameter 'endDate' when calling getWorkflowsUsages(Async)");
}
// verify the required parameter 'metrics' is set
if (metrics == null) {
throw new ApiException("Missing the required parameter 'metrics' when calling getWorkflowsUsages(Async)");
}
return getWorkflowsUsagesCall(startDate, endDate, metrics, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
/**
* Retrieve workflow task usage
* Gets workflow task usage sorted by day within a specified time frame. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param startDate The start date of the usage data that you want to get. For example, 2019-01-01. (required)
* @param endDate The end date of the usage data that you want to get. For example, 2019-12-31. (required)
* @param metrics The type of metric that you want to get. Currently, only `taskCount` is supported. `taskCount` is the amount of task runs. (required)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return UsagesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected UsagesResponse getWorkflowsUsages(LocalDate startDate, LocalDate endDate, String metrics, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
ApiResponse localVarResp = getWorkflowsUsagesWithHttpInfo(startDate, endDate, metrics, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
private ApiResponse getWorkflowsUsagesWithHttpInfo(LocalDate startDate, LocalDate endDate, String metrics, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds) throws ApiException {
okhttp3.Call localVarCall = getWorkflowsUsagesValidateBeforeCall(startDate, endDate, metrics, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getWorkflowsUsagesAsync(LocalDate startDate, LocalDate endDate, String metrics, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getWorkflowsUsagesValidateBeforeCall(startDate, endDate, metrics, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class GetWorkflowsUsagesApi {
private final LocalDate startDate;
private final LocalDate endDate;
private final String metrics;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraEntityIds;
private String zuoraTrackId;
private String zuoraVersion;
private String zuoraOrgIds;
private GetWorkflowsUsagesApi(LocalDate startDate, LocalDate endDate, String metrics) {
this.startDate = startDate;
this.endDate = endDate;
this.metrics = metrics;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return GetWorkflowsUsagesApi
*/
public GetWorkflowsUsagesApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return GetWorkflowsUsagesApi
*/
public GetWorkflowsUsagesApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return GetWorkflowsUsagesApi
*/
public GetWorkflowsUsagesApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return GetWorkflowsUsagesApi
*/
public GetWorkflowsUsagesApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return GetWorkflowsUsagesApi
*/
public GetWorkflowsUsagesApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return GetWorkflowsUsagesApi
*/
public GetWorkflowsUsagesApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return GetWorkflowsUsagesApi
*/
public GetWorkflowsUsagesApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Build call for getWorkflowsUsages
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public UsagesResponse execute() throws ApiException {
ApiResponse localVarResp = getWorkflowsUsagesWithHttpInfo(startDate, endDate, metrics, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
return localVarResp.getData();
}
/**
* Execute getWorkflowsUsages request with HTTP info returned
* @return ApiResponse<UsagesResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return getWorkflowsUsagesWithHttpInfo(startDate, endDate, metrics, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds);
}
/**
* Execute getWorkflowsUsages request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getWorkflowsUsagesAsync(startDate, endDate, metrics, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, _callback);
}
}
/**
* Retrieve workflow task usage
* Gets workflow task usage sorted by day within a specified time frame. ### User Access Permission You must be assigned the **Workflow View Access** permission to run this operation.
* @param startDate The start date of the usage data that you want to get. For example, 2019-01-01. (required)
* @param endDate The end date of the usage data that you want to get. For example, 2019-12-31. (required)
* @param metrics The type of metric that you want to get. Currently, only `taskCount` is supported. `taskCount` is the amount of task runs. (required)
* @return GetWorkflowsUsagesApi
*/
public GetWorkflowsUsagesApi getWorkflowsUsagesApi(LocalDate startDate, LocalDate endDate, String metrics) {
return new GetWorkflowsUsagesApi(startDate, endDate, metrics);
}
private okhttp3.Call pATCHUpdateWorkflowCall(String workflowId, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, PATCHUpdateWorkflowRequest request, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = request;
// create path and map variables
String localVarPath = "/workflows/{workflow_id}"
.replace("{" + "workflow_id" + "}", localVarApiClient.escapeString(workflowId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (idempotencyKey != null) {
localVarHeaderParams.put("Idempotency-Key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call pATCHUpdateWorkflowValidateBeforeCall(String workflowId, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, PATCHUpdateWorkflowRequest request, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'workflowId' is set
if (workflowId == null) {
throw new ApiException("Missing the required parameter 'workflowId' when calling pATCHUpdateWorkflow(Async)");
}
return pATCHUpdateWorkflowCall(workflowId, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, request, _callback);
}
/**
* Update a workflow
* Updates a specific workflow by its ID, which allows you to [configure the settings of a workflow](https://knowledgecenter.zuora.com/CE_Workflow/Using_Workflow/B_Configure_a_Workflow) via API. ### User Access Permission You must be assigned the **Workflow Manage Access** permission to run this operation.
* @param workflowId The unique ID of a workflow definition. For example, 19080. (required)
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @param request (optional)
* @return WorkflowDefinition
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Bad Request for one of the following reasons: * The name or description fields are not strings. * The ondemand_trigger, callout_trigger, or scheduled_trigger fields are not booleans. * The timezone does not match one of the valid values in [this spread sheet](https://docs.google.com/spreadsheets/d/1skhepi-q5l9LyaMUPZjU_V9gzTphNMqNyV6ST5mygEo/edit?usp=sharing). * The priority is not one of High, Medium, or Low. * The status is not one of Active or Inactive. * The scheduled_trigger is set to true but a valid timezone and interval were not passed.
*/
protected WorkflowDefinition pATCHUpdateWorkflow(String workflowId, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, PATCHUpdateWorkflowRequest request) throws ApiException {
ApiResponse localVarResp = pATCHUpdateWorkflowWithHttpInfo(workflowId, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, request);
return localVarResp.getData();
}
private ApiResponse pATCHUpdateWorkflowWithHttpInfo(String workflowId, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, PATCHUpdateWorkflowRequest request) throws ApiException {
okhttp3.Call localVarCall = pATCHUpdateWorkflowValidateBeforeCall(workflowId, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, request, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call pATCHUpdateWorkflowAsync(String workflowId, String idempotencyKey, String acceptEncoding, String contentEncoding, String zuoraTrackId, String zuoraEntityIds, String authorization, String zuoraVersion, String zuoraOrgIds, PATCHUpdateWorkflowRequest request, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = pATCHUpdateWorkflowValidateBeforeCall(workflowId, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, request, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class PATCHUpdateWorkflowApi {
private final String workflowId;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String zuoraTrackId;
private String zuoraEntityIds;
private String authorization;
private String zuoraVersion;
private String zuoraOrgIds;
private PATCHUpdateWorkflowRequest request;
private PATCHUpdateWorkflowApi(String workflowId) {
this.workflowId = workflowId;
}
/**
* Set idempotencyKey
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @return PATCHUpdateWorkflowApi
*/
public PATCHUpdateWorkflowApi idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return PATCHUpdateWorkflowApi
*/
public PATCHUpdateWorkflowApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return PATCHUpdateWorkflowApi
*/
public PATCHUpdateWorkflowApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return PATCHUpdateWorkflowApi
*/
public PATCHUpdateWorkflowApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return PATCHUpdateWorkflowApi
*/
public PATCHUpdateWorkflowApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return PATCHUpdateWorkflowApi
*/
public PATCHUpdateWorkflowApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return PATCHUpdateWorkflowApi
*/
public PATCHUpdateWorkflowApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return PATCHUpdateWorkflowApi
*/
public PATCHUpdateWorkflowApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Set request
* @param request (optional)
* @return PATCHUpdateWorkflowApi
*/
public PATCHUpdateWorkflowApi request(PATCHUpdateWorkflowRequest request) {
this.request = request;
return this;
}
/**
* Build call for pATCHUpdateWorkflow
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Bad Request for one of the following reasons: * The name or description fields are not strings. * The ondemand_trigger, callout_trigger, or scheduled_trigger fields are not booleans. * The timezone does not match one of the valid values in [this spread sheet](https://docs.google.com/spreadsheets/d/1skhepi-q5l9LyaMUPZjU_V9gzTphNMqNyV6ST5mygEo/edit?usp=sharing). * The priority is not one of High, Medium, or Low. * The status is not one of Active or Inactive. * The scheduled_trigger is set to true but a valid timezone and interval were not passed.
Bad Request for one of the following reasons: * The name or description fields are not strings. * The ondemand_trigger, callout_trigger, or scheduled_trigger fields are not booleans. * The timezone does not match one of the valid values in [this spread sheet](https://docs.google.com/spreadsheets/d/1skhepi-q5l9LyaMUPZjU_V9gzTphNMqNyV6ST5mygEo/edit?usp=sharing). * The priority is not one of High, Medium, or Low. * The status is not one of Active or Inactive. * The scheduled_trigger is set to true but a valid timezone and interval were not passed.
*/
public WorkflowDefinition execute() throws ApiException {
ApiResponse localVarResp = pATCHUpdateWorkflowWithHttpInfo(workflowId, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, request);
return localVarResp.getData();
}
/**
* Execute pATCHUpdateWorkflow request with HTTP info returned
* @return ApiResponse<WorkflowDefinition>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Bad Request for one of the following reasons: * The name or description fields are not strings. * The ondemand_trigger, callout_trigger, or scheduled_trigger fields are not booleans. * The timezone does not match one of the valid values in [this spread sheet](https://docs.google.com/spreadsheets/d/1skhepi-q5l9LyaMUPZjU_V9gzTphNMqNyV6ST5mygEo/edit?usp=sharing). * The priority is not one of High, Medium, or Low. * The status is not one of Active or Inactive. * The scheduled_trigger is set to true but a valid timezone and interval were not passed.
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return pATCHUpdateWorkflowWithHttpInfo(workflowId, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, request);
}
/**
* Execute pATCHUpdateWorkflow request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Bad Request for one of the following reasons: * The name or description fields are not strings. * The ondemand_trigger, callout_trigger, or scheduled_trigger fields are not booleans. * The timezone does not match one of the valid values in [this spread sheet](https://docs.google.com/spreadsheets/d/1skhepi-q5l9LyaMUPZjU_V9gzTphNMqNyV6ST5mygEo/edit?usp=sharing). * The priority is not one of High, Medium, or Low. * The status is not one of Active or Inactive. * The scheduled_trigger is set to true but a valid timezone and interval were not passed.
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return pATCHUpdateWorkflowAsync(workflowId, idempotencyKey, acceptEncoding, contentEncoding, zuoraTrackId, zuoraEntityIds, authorization, zuoraVersion, zuoraOrgIds, request, _callback);
}
}
/**
* Update a workflow
* Updates a specific workflow by its ID, which allows you to [configure the settings of a workflow](https://knowledgecenter.zuora.com/CE_Workflow/Using_Workflow/B_Configure_a_Workflow) via API. ### User Access Permission You must be assigned the **Workflow Manage Access** permission to run this operation.
* @param workflowId The unique ID of a workflow definition. For example, 19080. (required)
* @return PATCHUpdateWorkflowApi
*/
public PATCHUpdateWorkflowApi pATCHUpdateWorkflowApi(String workflowId) {
return new PATCHUpdateWorkflowApi(workflowId);
}
private okhttp3.Call postRunWorkflowCall(Integer workflowId, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, Object inputparameters, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = inputparameters;
// create path and map variables
String localVarPath = "/workflows/{workflow_id}/run"
.replace("{" + "workflow_id" + "}", localVarApiClient.escapeString(workflowId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (idempotencyKey != null) {
localVarHeaderParams.put("Idempotency-Key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraEntityIds != null) {
localVarHeaderParams.put("Zuora-Entity-Ids", localVarApiClient.parameterToString(zuoraEntityIds));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call postRunWorkflowValidateBeforeCall(Integer workflowId, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, Object inputparameters, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'workflowId' is set
if (workflowId == null) {
throw new ApiException("Missing the required parameter 'workflowId' when calling postRunWorkflow(Async)");
}
return postRunWorkflowCall(workflowId, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, inputparameters, _callback);
}
/**
* Run a workflow
* Run a specified workflow. In the request body, you can include parameters that you want to pass to the workflow. For the parameters to be recognized and picked up by tasks in the workflow, you need to define the parameters first. **Note**: To run a workflow, do not use the following reserved words in the request body of the parameters. - `controller` - `action` - `id` - `user_email` - `user_token` - `format` ### User Access Permission You must be assigned the **Workflow Run Access** permission to run this operation. To learn about how to define parameters, see [Configure the settings of a workflow](https://knowledgecenter.zuora.com/CE_Workflow/Using_Workflow/B_Configure_a_Workflow).
* @param workflowId The ID of the workflow definition you want to run. (required)
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @param inputparameters Include parameters you want to pass to the workflow. (optional)
* @return WorkflowInstance
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected WorkflowInstance postRunWorkflow(Integer workflowId, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, Object inputparameters) throws ApiException {
ApiResponse localVarResp = postRunWorkflowWithHttpInfo(workflowId, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, inputparameters);
return localVarResp.getData();
}
private ApiResponse postRunWorkflowWithHttpInfo(Integer workflowId, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, Object inputparameters) throws ApiException {
okhttp3.Call localVarCall = postRunWorkflowValidateBeforeCall(workflowId, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, inputparameters, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call postRunWorkflowAsync(Integer workflowId, String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraEntityIds, String zuoraTrackId, String zuoraVersion, String zuoraOrgIds, Object inputparameters, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = postRunWorkflowValidateBeforeCall(workflowId, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, inputparameters, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class PostRunWorkflowApi {
private final Integer workflowId;
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraEntityIds;
private String zuoraTrackId;
private String zuoraVersion;
private String zuoraOrgIds;
private Object inputparameters;
private PostRunWorkflowApi(Integer workflowId) {
this.workflowId = workflowId;
}
/**
* Set idempotencyKey
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @return PostRunWorkflowApi
*/
public PostRunWorkflowApi idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return PostRunWorkflowApi
*/
public PostRunWorkflowApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return PostRunWorkflowApi
*/
public PostRunWorkflowApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return PostRunWorkflowApi
*/
public PostRunWorkflowApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraEntityIds
* @param zuoraEntityIds An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. (optional)
* @return PostRunWorkflowApi
*/
public PostRunWorkflowApi zuoraEntityIds(String zuoraEntityIds) {
this.zuoraEntityIds = zuoraEntityIds;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return PostRunWorkflowApi
*/
public PostRunWorkflowApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return PostRunWorkflowApi
*/
public PostRunWorkflowApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return PostRunWorkflowApi
*/
public PostRunWorkflowApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Set inputparameters
* @param inputparameters Include parameters you want to pass to the workflow. (optional)
* @return PostRunWorkflowApi
*/
public PostRunWorkflowApi inputparameters(Object inputparameters) {
this.inputparameters = inputparameters;
return this;
}
/**
* Build call for postRunWorkflow
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public WorkflowInstance execute() throws ApiException {
ApiResponse localVarResp = postRunWorkflowWithHttpInfo(workflowId, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, inputparameters);
return localVarResp.getData();
}
/**
* Execute postRunWorkflow request with HTTP info returned
* @return ApiResponse<WorkflowInstance>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return postRunWorkflowWithHttpInfo(workflowId, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, inputparameters);
}
/**
* Execute postRunWorkflow request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return postRunWorkflowAsync(workflowId, idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraEntityIds, zuoraTrackId, zuoraVersion, zuoraOrgIds, inputparameters, _callback);
}
}
/**
* Run a workflow
* Run a specified workflow. In the request body, you can include parameters that you want to pass to the workflow. For the parameters to be recognized and picked up by tasks in the workflow, you need to define the parameters first. **Note**: To run a workflow, do not use the following reserved words in the request body of the parameters. - `controller` - `action` - `id` - `user_email` - `user_token` - `format` ### User Access Permission You must be assigned the **Workflow Run Access** permission to run this operation. To learn about how to define parameters, see [Configure the settings of a workflow](https://knowledgecenter.zuora.com/CE_Workflow/Using_Workflow/B_Configure_a_Workflow).
* @param workflowId The ID of the workflow definition you want to run. (required)
* @return PostRunWorkflowApi
*/
public PostRunWorkflowApi postRunWorkflowApi(Integer workflowId) {
return new PostRunWorkflowApi(workflowId);
}
private okhttp3.Call postWorkflowImportCall(String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, Integer workflowDefinitionId, String version, Boolean activate, String zuoraVersion, String zuoraOrgIds, PostWorkflowDefinitionImportRequest request, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = request;
// create path and map variables
String localVarPath = "/workflows/import";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (workflowDefinitionId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("workflow_definition_id", workflowDefinitionId));
}
if (version != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("version", version));
}
if (activate != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("activate", activate));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("Idempotency-Key", localVarApiClient.parameterToString(idempotencyKey));
}
if (acceptEncoding != null) {
localVarHeaderParams.put("Accept-Encoding", localVarApiClient.parameterToString(acceptEncoding));
}
if (contentEncoding != null) {
localVarHeaderParams.put("Content-Encoding", localVarApiClient.parameterToString(contentEncoding));
}
if (authorization != null) {
localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization));
}
if (zuoraTrackId != null) {
localVarHeaderParams.put("Zuora-Track-Id", localVarApiClient.parameterToString(zuoraTrackId));
}
if (zuoraVersion != null) {
localVarHeaderParams.put("Zuora-Version", localVarApiClient.parameterToString(zuoraVersion));
}
if (zuoraOrgIds != null) {
localVarHeaderParams.put("Zuora-Org-Ids", localVarApiClient.parameterToString(zuoraOrgIds));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call postWorkflowImportValidateBeforeCall(String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, Integer workflowDefinitionId, String version, Boolean activate, String zuoraVersion, String zuoraOrgIds, PostWorkflowDefinitionImportRequest request, final ApiCallback _callback) throws ApiException {
return postWorkflowImportCall(idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, workflowDefinitionId, version, activate, zuoraVersion, zuoraOrgIds, request, _callback);
}
/**
* Import a workflow
* Create a new workflow definition and its first version using the exported JSON document of an existing workflow version. ### User Access Permission You must be assigned the **Workflow Manage Access** permission to run this operation.
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @param workflowDefinitionId The unique id of the workflow definition to import a workflow version under. (optional)
* @param version The version number of the new workflow version to import. Must be greater than any existing version numbers. (optional)
* @param activate Indicates whether the imported version is an active version. Default to be false. (optional)
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @param request (optional)
* @return Workflow
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
protected Workflow postWorkflowImport(String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, Integer workflowDefinitionId, String version, Boolean activate, String zuoraVersion, String zuoraOrgIds, PostWorkflowDefinitionImportRequest request) throws ApiException {
ApiResponse localVarResp = postWorkflowImportWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, workflowDefinitionId, version, activate, zuoraVersion, zuoraOrgIds, request);
return localVarResp.getData();
}
private ApiResponse postWorkflowImportWithHttpInfo(String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, Integer workflowDefinitionId, String version, Boolean activate, String zuoraVersion, String zuoraOrgIds, PostWorkflowDefinitionImportRequest request) throws ApiException {
okhttp3.Call localVarCall = postWorkflowImportValidateBeforeCall(idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, workflowDefinitionId, version, activate, zuoraVersion, zuoraOrgIds, request, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call postWorkflowImportAsync(String idempotencyKey, String acceptEncoding, String contentEncoding, String authorization, String zuoraTrackId, Integer workflowDefinitionId, String version, Boolean activate, String zuoraVersion, String zuoraOrgIds, PostWorkflowDefinitionImportRequest request, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = postWorkflowImportValidateBeforeCall(idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, workflowDefinitionId, version, activate, zuoraVersion, zuoraOrgIds, request, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class PostWorkflowImportApi {
private String idempotencyKey;
private String acceptEncoding;
private String contentEncoding;
private String authorization;
private String zuoraTrackId;
private Integer workflowDefinitionId;
private String version;
private Boolean activate;
private String zuoraVersion;
private String zuoraOrgIds;
private PostWorkflowDefinitionImportRequest request;
private PostWorkflowImportApi() {
}
/**
* Set idempotencyKey
* @param idempotencyKey Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident. (optional)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
}
/**
* Set acceptEncoding
* @param acceptEncoding Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. (optional)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi acceptEncoding(String acceptEncoding) {
this.acceptEncoding = acceptEncoding;
return this;
}
/**
* Set contentEncoding
* @param contentEncoding Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. (optional)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi contentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
return this;
}
/**
* Set authorization
* @param authorization The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). (optional)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi authorization(String authorization) {
this.authorization = authorization;
return this;
}
/**
* Set zuoraTrackId
* @param zuoraTrackId A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). (optional)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi zuoraTrackId(String zuoraTrackId) {
this.zuoraTrackId = zuoraTrackId;
return this;
}
/**
* Set workflowDefinitionId
* @param workflowDefinitionId The unique id of the workflow definition to import a workflow version under. (optional)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi workflowDefinitionId(Integer workflowDefinitionId) {
this.workflowDefinitionId = workflowDefinitionId;
return this;
}
/**
* Set version
* @param version The version number of the new workflow version to import. Must be greater than any existing version numbers. (optional)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi version(String version) {
this.version = version;
return this;
}
/**
* Set activate
* @param activate Indicates whether the imported version is an active version. Default to be false. (optional)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi activate(Boolean activate) {
this.activate = activate;
return this;
}
/**
* Set zuoraVersion
* @param zuoraVersion The minor version of the Zuora REST API. (optional, default to 2024-05-20)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi zuoraVersion(String zuoraVersion) {
this.zuoraVersion = zuoraVersion;
return this;
}
/**
* Set zuoraOrgIds
* @param zuoraOrgIds Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. (optional)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi zuoraOrgIds(String zuoraOrgIds) {
this.zuoraOrgIds = zuoraOrgIds;
return this;
}
/**
* Set request
* @param request (optional)
* @return PostWorkflowImportApi
*/
public PostWorkflowImportApi request(PostWorkflowDefinitionImportRequest request) {
this.request = request;
return this;
}
/**
* Build call for postWorkflowImport
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
*/
public Workflow execute() throws ApiException {
ApiResponse localVarResp = postWorkflowImportWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, workflowDefinitionId, version, activate, zuoraVersion, zuoraOrgIds, request);
return localVarResp.getData();
}
/**
* Execute postWorkflowImport request with HTTP info returned
* @return ApiResponse<Workflow>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
*/
private ApiResponse executeWithHttpInfo() throws ApiException {
return postWorkflowImportWithHttpInfo(idempotencyKey, acceptEncoding, contentEncoding, authorization, zuoraTrackId, workflowDefinitionId, version, activate, zuoraVersion, zuoraOrgIds, request);
}
/**
* Execute postWorkflowImport request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details