/*
 * Swagger of Opencellsoft Api
 * @#Introduction
 *
 * The version of the OpenAPI document: 7.3.1-SNAPSHOT
 * Contact: contact@opencellsoft.fr
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.api;

import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import org.openapitools.client.model.ActionStatus;
import org.openapitools.client.model.GenericWorkflowDto;
import org.openapitools.client.model.GenericWorkflowResponseDto;
import org.openapitools.client.model.GenericWorkflowsResponseDto;
import org.openapitools.client.model.WorkflowInsHistoryResponseDto;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class GenericWorkflowApi {
    private ApiClient localVarApiClient;

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

    public GenericWorkflowApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

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

    /**
     * Build call for dELETEGenericWorkflowCode1
     * @param code  code The workflow&#39;s code  (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call dELETEGenericWorkflowCode1Call(String code, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow/{code}"
            .replaceAll("\\{" + "code" + "\\}", localVarApiClient.escapeString(code.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call dELETEGenericWorkflowCode1ValidateBeforeCall(String code, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'code' is set
        if (code == null) {
            throw new ApiException("Missing the required parameter 'code' when calling dELETEGenericWorkflowCode1(Async)");
        }
        

        okhttp3.Call localVarCall = dELETEGenericWorkflowCode1Call(code, _callback);
        return localVarCall;

    }

    /**
     *  Remove an existing workflow with a given code  
     *  Remove an existing workflow with a given code  
     * @param code  code The workflow&#39;s code  (required)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus dELETEGenericWorkflowCode1(String code) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = dELETEGenericWorkflowCode1WithHttpInfo(code);
        return localVarResp.getData();
    }

    /**
     *  Remove an existing workflow with a given code  
     *  Remove an existing workflow with a given code  
     * @param code  code The workflow&#39;s code  (required)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> dELETEGenericWorkflowCode1WithHttpInfo(String code) throws ApiException {
        okhttp3.Call localVarCall = dELETEGenericWorkflowCode1ValidateBeforeCall(code, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Remove an existing workflow with a given code   (asynchronously)
     *  Remove an existing workflow with a given code  
     * @param code  code The workflow&#39;s code  (required)
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call dELETEGenericWorkflowCode1Async(String code, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = dELETEGenericWorkflowCode1ValidateBeforeCall(code, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETGenericWorkflowFindByEntity1
     * @param baseEntityName  baseEntityName  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETGenericWorkflowFindByEntity1Call(String baseEntityName, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow/findByEntity";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (baseEntityName != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("baseEntityName", baseEntityName));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call gETGenericWorkflowFindByEntity1ValidateBeforeCall(String baseEntityName, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETGenericWorkflowFindByEntity1Call(baseEntityName, _callback);
        return localVarCall;

    }

    /**
     *  Find a workflow by entity  
     *  Find a workflow by entity  
     * @param baseEntityName  baseEntityName  (optional)
     * @return GenericWorkflowsResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public GenericWorkflowsResponseDto gETGenericWorkflowFindByEntity1(String baseEntityName) throws ApiException {
        ApiResponse<GenericWorkflowsResponseDto> localVarResp = gETGenericWorkflowFindByEntity1WithHttpInfo(baseEntityName);
        return localVarResp.getData();
    }

    /**
     *  Find a workflow by entity  
     *  Find a workflow by entity  
     * @param baseEntityName  baseEntityName  (optional)
     * @return ApiResponse&lt;GenericWorkflowsResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GenericWorkflowsResponseDto> gETGenericWorkflowFindByEntity1WithHttpInfo(String baseEntityName) throws ApiException {
        okhttp3.Call localVarCall = gETGenericWorkflowFindByEntity1ValidateBeforeCall(baseEntityName, null);
        Type localVarReturnType = new TypeToken<GenericWorkflowsResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Find a workflow by entity   (asynchronously)
     *  Find a workflow by entity  
     * @param baseEntityName  baseEntityName  (optional)
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETGenericWorkflowFindByEntity1Async(String baseEntityName, final ApiCallback<GenericWorkflowsResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETGenericWorkflowFindByEntity1ValidateBeforeCall(baseEntityName, _callback);
        Type localVarReturnType = new TypeToken<GenericWorkflowsResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETGenericWorkflowHistory1
     * @param entityInstanceCode  entityInstanceCode  (optional)
     * @param workflowCode  workflowCode  (optional)
     * @param fromStatus  fromStatus  (optional)
     * @param toStatus  toStatus  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETGenericWorkflowHistory1Call(String entityInstanceCode, String workflowCode, String fromStatus, String toStatus, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow/history";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (entityInstanceCode != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("entityInstanceCode", entityInstanceCode));
        }

        if (workflowCode != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("workflowCode", workflowCode));
        }

        if (fromStatus != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromStatus", fromStatus));
        }

        if (toStatus != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("toStatus", toStatus));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call gETGenericWorkflowHistory1ValidateBeforeCall(String entityInstanceCode, String workflowCode, String fromStatus, String toStatus, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETGenericWorkflowHistory1Call(entityInstanceCode, workflowCode, fromStatus, toStatus, _callback);
        return localVarCall;

    }

    /**
     *  Find workflow history  
     *  Find workflow history  
     * @param entityInstanceCode  entityInstanceCode  (optional)
     * @param workflowCode  workflowCode  (optional)
     * @param fromStatus  fromStatus  (optional)
     * @param toStatus  toStatus  (optional)
     * @return WorkflowInsHistoryResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public WorkflowInsHistoryResponseDto gETGenericWorkflowHistory1(String entityInstanceCode, String workflowCode, String fromStatus, String toStatus) throws ApiException {
        ApiResponse<WorkflowInsHistoryResponseDto> localVarResp = gETGenericWorkflowHistory1WithHttpInfo(entityInstanceCode, workflowCode, fromStatus, toStatus);
        return localVarResp.getData();
    }

    /**
     *  Find workflow history  
     *  Find workflow history  
     * @param entityInstanceCode  entityInstanceCode  (optional)
     * @param workflowCode  workflowCode  (optional)
     * @param fromStatus  fromStatus  (optional)
     * @param toStatus  toStatus  (optional)
     * @return ApiResponse&lt;WorkflowInsHistoryResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<WorkflowInsHistoryResponseDto> gETGenericWorkflowHistory1WithHttpInfo(String entityInstanceCode, String workflowCode, String fromStatus, String toStatus) throws ApiException {
        okhttp3.Call localVarCall = gETGenericWorkflowHistory1ValidateBeforeCall(entityInstanceCode, workflowCode, fromStatus, toStatus, null);
        Type localVarReturnType = new TypeToken<WorkflowInsHistoryResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Find workflow history   (asynchronously)
     *  Find workflow history  
     * @param entityInstanceCode  entityInstanceCode  (optional)
     * @param workflowCode  workflowCode  (optional)
     * @param fromStatus  fromStatus  (optional)
     * @param toStatus  toStatus  (optional)
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETGenericWorkflowHistory1Async(String entityInstanceCode, String workflowCode, String fromStatus, String toStatus, final ApiCallback<WorkflowInsHistoryResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETGenericWorkflowHistory1ValidateBeforeCall(entityInstanceCode, workflowCode, fromStatus, toStatus, _callback);
        Type localVarReturnType = new TypeToken<WorkflowInsHistoryResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETGenericWorkflowList1
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  A list of workflow  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETGenericWorkflowList1Call(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow/list";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call gETGenericWorkflowList1ValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETGenericWorkflowList1Call(_callback);
        return localVarCall;

    }

    /**
     *  List of workflows.  
     *  List of workflows.  
     * @return GenericWorkflowsResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  A list of workflow  </td><td>  -  </td></tr>
     </table>
     */
    public GenericWorkflowsResponseDto gETGenericWorkflowList1() throws ApiException {
        ApiResponse<GenericWorkflowsResponseDto> localVarResp = gETGenericWorkflowList1WithHttpInfo();
        return localVarResp.getData();
    }

    /**
     *  List of workflows.  
     *  List of workflows.  
     * @return ApiResponse&lt;GenericWorkflowsResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  A list of workflow  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GenericWorkflowsResponseDto> gETGenericWorkflowList1WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = gETGenericWorkflowList1ValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<GenericWorkflowsResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  List of workflows.   (asynchronously)
     *  List of workflows.  
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  A list of workflow  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETGenericWorkflowList1Async(final ApiCallback<GenericWorkflowsResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETGenericWorkflowList1ValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<GenericWorkflowsResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETGenericWorkflowSearch1
     * @param code  code The workflow&#39;s code  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Generic Work flow Response data  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETGenericWorkflowSearch1Call(String code, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (code != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("code", code));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call gETGenericWorkflowSearch1ValidateBeforeCall(String code, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETGenericWorkflowSearch1Call(code, _callback);
        return localVarCall;

    }

    /**
     *  Find a workflow with a given code  
     *  Find a workflow with a given code  
     * @param code  code The workflow&#39;s code  (optional)
     * @return GenericWorkflowResponseDto
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Generic Work flow Response data  </td><td>  -  </td></tr>
     </table>
     */
    public GenericWorkflowResponseDto gETGenericWorkflowSearch1(String code) throws ApiException {
        ApiResponse<GenericWorkflowResponseDto> localVarResp = gETGenericWorkflowSearch1WithHttpInfo(code);
        return localVarResp.getData();
    }

    /**
     *  Find a workflow with a given code  
     *  Find a workflow with a given code  
     * @param code  code The workflow&#39;s code  (optional)
     * @return ApiResponse&lt;GenericWorkflowResponseDto&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Generic Work flow Response data  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<GenericWorkflowResponseDto> gETGenericWorkflowSearch1WithHttpInfo(String code) throws ApiException {
        okhttp3.Call localVarCall = gETGenericWorkflowSearch1ValidateBeforeCall(code, null);
        Type localVarReturnType = new TypeToken<GenericWorkflowResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Find a workflow with a given code   (asynchronously)
     *  Find a workflow with a given code  
     * @param code  code The workflow&#39;s code  (optional)
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Generic Work flow Response data  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETGenericWorkflowSearch1Async(String code, final ApiCallback<GenericWorkflowResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETGenericWorkflowSearch1ValidateBeforeCall(code, _callback);
        Type localVarReturnType = new TypeToken<GenericWorkflowResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETIBaseVersion77
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Action status with version number as a message  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETIBaseVersion77Call(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow/version";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call gETIBaseVersion77ValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETIBaseVersion77Call(_callback);
        return localVarCall;

    }

    /**
     *  Get version of application  
     *  Get version of application  
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Action status with version number as a message  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus gETIBaseVersion77() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = gETIBaseVersion77WithHttpInfo();
        return localVarResp.getData();
    }

    /**
     *  Get version of application  
     *  Get version of application  
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Action status with version number as a message  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> gETIBaseVersion77WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = gETIBaseVersion77ValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Get version of application   (asynchronously)
     *  Get version of application  
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Action status with version number as a message  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETIBaseVersion77Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETIBaseVersion77ValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTGenericWorkflowCodeDisable1
     * @param code  code Workflow code  (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTGenericWorkflowCodeDisable1Call(String code, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow/{code}/disable"
            .replaceAll("\\{" + "code" + "\\}", localVarApiClient.escapeString(code.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTGenericWorkflowCodeDisable1ValidateBeforeCall(String code, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'code' is set
        if (code == null) {
            throw new ApiException("Missing the required parameter 'code' when calling pOSTGenericWorkflowCodeDisable1(Async)");
        }
        

        okhttp3.Call localVarCall = pOSTGenericWorkflowCodeDisable1Call(code, _callback);
        return localVarCall;

    }

    /**
     *  Disable a Workflow with a given code  
     *  Disable a Workflow with a given code  
     * @param code  code Workflow code  (required)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTGenericWorkflowCodeDisable1(String code) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTGenericWorkflowCodeDisable1WithHttpInfo(code);
        return localVarResp.getData();
    }

    /**
     *  Disable a Workflow with a given code  
     *  Disable a Workflow with a given code  
     * @param code  code Workflow code  (required)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTGenericWorkflowCodeDisable1WithHttpInfo(String code) throws ApiException {
        okhttp3.Call localVarCall = pOSTGenericWorkflowCodeDisable1ValidateBeforeCall(code, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Disable a Workflow with a given code   (asynchronously)
     *  Disable a Workflow with a given code  
     * @param code  code Workflow code  (required)
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTGenericWorkflowCodeDisable1Async(String code, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTGenericWorkflowCodeDisable1ValidateBeforeCall(code, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTGenericWorkflowCodeEnable1
     * @param code  code Workflow code  (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTGenericWorkflowCodeEnable1Call(String code, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow/{code}/enable"
            .replaceAll("\\{" + "code" + "\\}", localVarApiClient.escapeString(code.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTGenericWorkflowCodeEnable1ValidateBeforeCall(String code, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'code' is set
        if (code == null) {
            throw new ApiException("Missing the required parameter 'code' when calling pOSTGenericWorkflowCodeEnable1(Async)");
        }
        

        okhttp3.Call localVarCall = pOSTGenericWorkflowCodeEnable1Call(code, _callback);
        return localVarCall;

    }

    /**
     *  Enable a Workflow with a given code  
     *  Enable a Workflow with a given code  
     * @param code  code Workflow code  (required)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTGenericWorkflowCodeEnable1(String code) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTGenericWorkflowCodeEnable1WithHttpInfo(code);
        return localVarResp.getData();
    }

    /**
     *  Enable a Workflow with a given code  
     *  Enable a Workflow with a given code  
     * @param code  code Workflow code  (required)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTGenericWorkflowCodeEnable1WithHttpInfo(String code) throws ApiException {
        okhttp3.Call localVarCall = pOSTGenericWorkflowCodeEnable1ValidateBeforeCall(code, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Enable a Workflow with a given code   (asynchronously)
     *  Enable a Workflow with a given code  
     * @param code  code Workflow code  (required)
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTGenericWorkflowCodeEnable1Async(String code, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTGenericWorkflowCodeEnable1ValidateBeforeCall(code, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTGenericWorkflowCreate1
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTGenericWorkflowCreate1Call(GenericWorkflowDto genericWorkflowDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = genericWorkflowDto;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTGenericWorkflowCreate1ValidateBeforeCall(GenericWorkflowDto genericWorkflowDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTGenericWorkflowCreate1Call(genericWorkflowDto, _callback);
        return localVarCall;

    }

    /**
     *  Create a new workflow  
     *  Create a new workflow  
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTGenericWorkflowCreate1(GenericWorkflowDto genericWorkflowDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTGenericWorkflowCreate1WithHttpInfo(genericWorkflowDto);
        return localVarResp.getData();
    }

    /**
     *  Create a new workflow  
     *  Create a new workflow  
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTGenericWorkflowCreate1WithHttpInfo(GenericWorkflowDto genericWorkflowDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTGenericWorkflowCreate1ValidateBeforeCall(genericWorkflowDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Create a new workflow   (asynchronously)
     *  Create a new workflow  
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTGenericWorkflowCreate1Async(GenericWorkflowDto genericWorkflowDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTGenericWorkflowCreate1ValidateBeforeCall(genericWorkflowDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTGenericWorkflowCreateOrUpdate1
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTGenericWorkflowCreateOrUpdate1Call(GenericWorkflowDto genericWorkflowDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = genericWorkflowDto;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow/createOrUpdate";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTGenericWorkflowCreateOrUpdate1ValidateBeforeCall(GenericWorkflowDto genericWorkflowDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTGenericWorkflowCreateOrUpdate1Call(genericWorkflowDto, _callback);
        return localVarCall;

    }

    /**
     *  Create new or update an existing workflow with a given code  
     *  Create new or update an existing workflow with a given code  
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTGenericWorkflowCreateOrUpdate1(GenericWorkflowDto genericWorkflowDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTGenericWorkflowCreateOrUpdate1WithHttpInfo(genericWorkflowDto);
        return localVarResp.getData();
    }

    /**
     *  Create new or update an existing workflow with a given code  
     *  Create new or update an existing workflow with a given code  
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTGenericWorkflowCreateOrUpdate1WithHttpInfo(GenericWorkflowDto genericWorkflowDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTGenericWorkflowCreateOrUpdate1ValidateBeforeCall(genericWorkflowDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Create new or update an existing workflow with a given code   (asynchronously)
     *  Create new or update an existing workflow with a given code  
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTGenericWorkflowCreateOrUpdate1Async(GenericWorkflowDto genericWorkflowDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTGenericWorkflowCreateOrUpdate1ValidateBeforeCall(genericWorkflowDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTGenericWorkflowExecute1
     * @param baseEntityName  baseEntityName  (optional)
     * @param entityInstanceCode  entityInstanceCode  (optional)
     * @param workflowCode  workflowCode  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTGenericWorkflowExecute1Call(String baseEntityName, String entityInstanceCode, String workflowCode, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow/execute";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (baseEntityName != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("baseEntityName", baseEntityName));
        }

        if (entityInstanceCode != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("entityInstanceCode", entityInstanceCode));
        }

        if (workflowCode != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("workflowCode", workflowCode));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pOSTGenericWorkflowExecute1ValidateBeforeCall(String baseEntityName, String entityInstanceCode, String workflowCode, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pOSTGenericWorkflowExecute1Call(baseEntityName, entityInstanceCode, workflowCode, _callback);
        return localVarCall;

    }

    /**
     *  Execute a workflow  
     *  Execute a workflow  
     * @param baseEntityName  baseEntityName  (optional)
     * @param entityInstanceCode  entityInstanceCode  (optional)
     * @param workflowCode  workflowCode  (optional)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pOSTGenericWorkflowExecute1(String baseEntityName, String entityInstanceCode, String workflowCode) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTGenericWorkflowExecute1WithHttpInfo(baseEntityName, entityInstanceCode, workflowCode);
        return localVarResp.getData();
    }

    /**
     *  Execute a workflow  
     *  Execute a workflow  
     * @param baseEntityName  baseEntityName  (optional)
     * @param entityInstanceCode  entityInstanceCode  (optional)
     * @param workflowCode  workflowCode  (optional)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pOSTGenericWorkflowExecute1WithHttpInfo(String baseEntityName, String entityInstanceCode, String workflowCode) throws ApiException {
        okhttp3.Call localVarCall = pOSTGenericWorkflowExecute1ValidateBeforeCall(baseEntityName, entityInstanceCode, workflowCode, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Execute a workflow   (asynchronously)
     *  Execute a workflow  
     * @param baseEntityName  baseEntityName  (optional)
     * @param entityInstanceCode  entityInstanceCode  (optional)
     * @param workflowCode  workflowCode  (optional)
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTGenericWorkflowExecute1Async(String baseEntityName, String entityInstanceCode, String workflowCode, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTGenericWorkflowExecute1ValidateBeforeCall(baseEntityName, entityInstanceCode, workflowCode, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pUTGenericWorkflowUpdate1
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pUTGenericWorkflowUpdate1Call(GenericWorkflowDto genericWorkflowDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = genericWorkflowDto;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json", "application/xml"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call pUTGenericWorkflowUpdate1ValidateBeforeCall(GenericWorkflowDto genericWorkflowDto, final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = pUTGenericWorkflowUpdate1Call(genericWorkflowDto, _callback);
        return localVarCall;

    }

    /**
     *  Update an existing workflow  
     *  Update an existing workflow  
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus pUTGenericWorkflowUpdate1(GenericWorkflowDto genericWorkflowDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pUTGenericWorkflowUpdate1WithHttpInfo(genericWorkflowDto);
        return localVarResp.getData();
    }

    /**
     *  Update an existing workflow  
     *  Update an existing workflow  
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> pUTGenericWorkflowUpdate1WithHttpInfo(GenericWorkflowDto genericWorkflowDto) throws ApiException {
        okhttp3.Call localVarCall = pUTGenericWorkflowUpdate1ValidateBeforeCall(genericWorkflowDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Update an existing workflow   (asynchronously)
     *  Update an existing workflow  
     * @param genericWorkflowDto  genericWorkflowDto The workflow&#39;s data  (optional)
     * @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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pUTGenericWorkflowUpdate1Async(GenericWorkflowDto genericWorkflowDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pUTGenericWorkflowUpdate1ValidateBeforeCall(genericWorkflowDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for user50
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td> default response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call user50Call(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/admin/genericWorkflow/user";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json", "application/xml"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "auth" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call user50ValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = user50Call(_callback);
        return localVarCall;

    }

    /**
     * 
     * 
     * @return ActionStatus
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td> default response </td><td>  -  </td></tr>
     </table>
     */
    public ActionStatus user50() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = user50WithHttpInfo();
        return localVarResp.getData();
    }

    /**
     * 
     * 
     * @return ApiResponse&lt;ActionStatus&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td> default response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ActionStatus> user50WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = user50ValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  (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
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 0 </td><td> default response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call user50Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = user50ValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
}
