/*
 * 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.CustomEntityInstanceDto;
import org.openapitools.client.model.CustomEntityInstanceResponseDto;
import org.openapitools.client.model.CustomEntityInstancesResponseDto;

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

public class CustomEntityInstanceApi {
    private ApiClient localVarApiClient;

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

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

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

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

    /**
     * Build call for dELETECustomEntityInstanceCustomEntityTemplateCodeCode1
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code The custom entity instance&#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 dELETECustomEntityInstanceCustomEntityTemplateCodeCode1Call(String customEntityTemplateCode, String code, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/customEntityInstance/{customEntityTemplateCode}/{code}"
            .replaceAll("\\{" + "customEntityTemplateCode" + "\\}", localVarApiClient.escapeString(customEntityTemplateCode.toString()))
            .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 dELETECustomEntityInstanceCustomEntityTemplateCodeCode1ValidateBeforeCall(String customEntityTemplateCode, String code, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'customEntityTemplateCode' is set
        if (customEntityTemplateCode == null) {
            throw new ApiException("Missing the required parameter 'customEntityTemplateCode' when calling dELETECustomEntityInstanceCustomEntityTemplateCodeCode1(Async)");
        }
        
        // verify the required parameter 'code' is set
        if (code == null) {
            throw new ApiException("Missing the required parameter 'code' when calling dELETECustomEntityInstanceCustomEntityTemplateCodeCode1(Async)");
        }
        

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

    }

    /**
     *  Remove an existing custom entity instance with a given code from a custom entity template given by code  
     *  Remove an existing custom entity instance with a given code from a custom entity template given by code  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code The custom entity instance&#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 dELETECustomEntityInstanceCustomEntityTemplateCodeCode1(String customEntityTemplateCode, String code) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = dELETECustomEntityInstanceCustomEntityTemplateCodeCode1WithHttpInfo(customEntityTemplateCode, code);
        return localVarResp.getData();
    }

    /**
     *  Remove an existing custom entity instance with a given code from a custom entity template given by code  
     *  Remove an existing custom entity instance with a given code from a custom entity template given by code  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code The custom entity instance&#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> dELETECustomEntityInstanceCustomEntityTemplateCodeCode1WithHttpInfo(String customEntityTemplateCode, String code) throws ApiException {
        okhttp3.Call localVarCall = dELETECustomEntityInstanceCustomEntityTemplateCodeCode1ValidateBeforeCall(customEntityTemplateCode, code, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Remove an existing custom entity instance with a given code from a custom entity template given by code   (asynchronously)
     *  Remove an existing custom entity instance with a given code from a custom entity template given by code  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code The custom entity instance&#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 dELETECustomEntityInstanceCustomEntityTemplateCodeCode1Async(String customEntityTemplateCode, String code, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = dELETECustomEntityInstanceCustomEntityTemplateCodeCode1ValidateBeforeCall(customEntityTemplateCode, code, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETCustomEntityInstanceCustomEntityTemplateCodeCode1
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code The custom entity instance&#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>  Return a customEntityInstance  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETCustomEntityInstanceCustomEntityTemplateCodeCode1Call(String customEntityTemplateCode, String code, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/customEntityInstance/{customEntityTemplateCode}/{code}"
            .replaceAll("\\{" + "customEntityTemplateCode" + "\\}", localVarApiClient.escapeString(customEntityTemplateCode.toString()))
            .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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

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

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

    }

    /**
     *  Find a #### with a given (exemple) code .  
     *  Find a #### with a given (exemple) code .  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code The custom entity instance&#39;s code  (required)
     * @return CustomEntityInstanceResponseDto
     * @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>  Return a customEntityInstance  </td><td>  -  </td></tr>
     </table>
     */
    public CustomEntityInstanceResponseDto gETCustomEntityInstanceCustomEntityTemplateCodeCode1(String customEntityTemplateCode, String code) throws ApiException {
        ApiResponse<CustomEntityInstanceResponseDto> localVarResp = gETCustomEntityInstanceCustomEntityTemplateCodeCode1WithHttpInfo(customEntityTemplateCode, code);
        return localVarResp.getData();
    }

    /**
     *  Find a #### with a given (exemple) code .  
     *  Find a #### with a given (exemple) code .  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code The custom entity instance&#39;s code  (required)
     * @return ApiResponse&lt;CustomEntityInstanceResponseDto&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>  Return a customEntityInstance  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<CustomEntityInstanceResponseDto> gETCustomEntityInstanceCustomEntityTemplateCodeCode1WithHttpInfo(String customEntityTemplateCode, String code) throws ApiException {
        okhttp3.Call localVarCall = gETCustomEntityInstanceCustomEntityTemplateCodeCode1ValidateBeforeCall(customEntityTemplateCode, code, null);
        Type localVarReturnType = new TypeToken<CustomEntityInstanceResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Find a #### with a given (exemple) code .   (asynchronously)
     *  Find a #### with a given (exemple) code .  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code The custom entity instance&#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>  Return a customEntityInstance  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETCustomEntityInstanceCustomEntityTemplateCodeCode1Async(String customEntityTemplateCode, String code, final ApiCallback<CustomEntityInstanceResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETCustomEntityInstanceCustomEntityTemplateCodeCode1ValidateBeforeCall(customEntityTemplateCode, code, _callback);
        Type localVarReturnType = new TypeToken<CustomEntityInstanceResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETCustomEntityInstanceListCustomEntityTemplateCode1
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity instance&#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>  A list of custom entity instances  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETCustomEntityInstanceListCustomEntityTemplateCode1Call(String customEntityTemplateCode, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/customEntityInstance/list/{customEntityTemplateCode}"
            .replaceAll("\\{" + "customEntityTemplateCode" + "\\}", localVarApiClient.escapeString(customEntityTemplateCode.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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
    }

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

        okhttp3.Call localVarCall = gETCustomEntityInstanceListCustomEntityTemplateCode1Call(customEntityTemplateCode, _callback);
        return localVarCall;

    }

    /**
     *  List custom entity instances.  
     *  List custom entity instances.  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity instance&#39;s code  (required)
     * @return CustomEntityInstancesResponseDto
     * @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 custom entity instances  </td><td>  -  </td></tr>
     </table>
     */
    public CustomEntityInstancesResponseDto gETCustomEntityInstanceListCustomEntityTemplateCode1(String customEntityTemplateCode) throws ApiException {
        ApiResponse<CustomEntityInstancesResponseDto> localVarResp = gETCustomEntityInstanceListCustomEntityTemplateCode1WithHttpInfo(customEntityTemplateCode);
        return localVarResp.getData();
    }

    /**
     *  List custom entity instances.  
     *  List custom entity instances.  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity instance&#39;s code  (required)
     * @return ApiResponse&lt;CustomEntityInstancesResponseDto&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 custom entity instances  </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<CustomEntityInstancesResponseDto> gETCustomEntityInstanceListCustomEntityTemplateCode1WithHttpInfo(String customEntityTemplateCode) throws ApiException {
        okhttp3.Call localVarCall = gETCustomEntityInstanceListCustomEntityTemplateCode1ValidateBeforeCall(customEntityTemplateCode, null);
        Type localVarReturnType = new TypeToken<CustomEntityInstancesResponseDto>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  List custom entity instances.   (asynchronously)
     *  List custom entity instances.  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity instance&#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>  A list of custom entity instances  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call gETCustomEntityInstanceListCustomEntityTemplateCode1Async(String customEntityTemplateCode, final ApiCallback<CustomEntityInstancesResponseDto> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETCustomEntityInstanceListCustomEntityTemplateCode1ValidateBeforeCall(customEntityTemplateCode, _callback);
        Type localVarReturnType = new TypeToken<CustomEntityInstancesResponseDto>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for gETIBaseVersion69
     * @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 gETIBaseVersion69Call(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/customEntityInstance/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 gETIBaseVersion69ValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = gETIBaseVersion69Call(_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 gETIBaseVersion69() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = gETIBaseVersion69WithHttpInfo();
        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> gETIBaseVersion69WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = gETIBaseVersion69ValidateBeforeCall(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 gETIBaseVersion69Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = gETIBaseVersion69ValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTCustomEntityInstanceCustomEntityTemplateCode1
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode The custom entity template&#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>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTCustomEntityInstanceCustomEntityTemplateCode1Call(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = customEntityInstanceDto;

        // create path and map variables
        String localVarPath = "/customEntityInstance/{customEntityTemplateCode}"
            .replaceAll("\\{" + "customEntityTemplateCode" + "\\}", localVarApiClient.escapeString(customEntityTemplateCode.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 = {
            "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 pOSTCustomEntityInstanceCustomEntityTemplateCode1ValidateBeforeCall(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'customEntityTemplateCode' is set
        if (customEntityTemplateCode == null) {
            throw new ApiException("Missing the required parameter 'customEntityTemplateCode' when calling pOSTCustomEntityInstanceCustomEntityTemplateCode1(Async)");
        }
        

        okhttp3.Call localVarCall = pOSTCustomEntityInstanceCustomEntityTemplateCode1Call(customEntityTemplateCode, customEntityInstanceDto, _callback);
        return localVarCall;

    }

    /**
     *  Create a new custom entity instance using a custom entity template. 
     *  Create a new custom entity instance using a custom entity template. 
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode The custom entity template&#39;s code  (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 pOSTCustomEntityInstanceCustomEntityTemplateCode1(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTCustomEntityInstanceCustomEntityTemplateCode1WithHttpInfo(customEntityTemplateCode, customEntityInstanceDto);
        return localVarResp.getData();
    }

    /**
     *  Create a new custom entity instance using a custom entity template. 
     *  Create a new custom entity instance using a custom entity template. 
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode The custom entity template&#39;s code  (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> pOSTCustomEntityInstanceCustomEntityTemplateCode1WithHttpInfo(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTCustomEntityInstanceCustomEntityTemplateCode1ValidateBeforeCall(customEntityTemplateCode, customEntityInstanceDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Create a new custom entity instance using a custom entity template.  (asynchronously)
     *  Create a new custom entity instance using a custom entity template. 
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode The custom entity template&#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>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pOSTCustomEntityInstanceCustomEntityTemplateCode1Async(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTCustomEntityInstanceCustomEntityTemplateCode1ValidateBeforeCall(customEntityTemplateCode, customEntityInstanceDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code Custom entity instance 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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1Call(String customEntityTemplateCode, String code, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/customEntityInstance/{customEntityTemplateCode}/{code}/disable"
            .replaceAll("\\{" + "customEntityTemplateCode" + "\\}", localVarApiClient.escapeString(customEntityTemplateCode.toString()))
            .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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1ValidateBeforeCall(String customEntityTemplateCode, String code, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'customEntityTemplateCode' is set
        if (customEntityTemplateCode == null) {
            throw new ApiException("Missing the required parameter 'customEntityTemplateCode' when calling pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1(Async)");
        }
        
        // verify the required parameter 'code' is set
        if (code == null) {
            throw new ApiException("Missing the required parameter 'code' when calling pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1(Async)");
        }
        

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

    }

    /**
     *  Disable a Custom entity instance with a given code  
     *  Disable a Custom entity instance with a given code  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code Custom entity instance 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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1(String customEntityTemplateCode, String code) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1WithHttpInfo(customEntityTemplateCode, code);
        return localVarResp.getData();
    }

    /**
     *  Disable a Custom entity instance with a given code  
     *  Disable a Custom entity instance with a given code  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code Custom entity instance 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> pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1WithHttpInfo(String customEntityTemplateCode, String code) throws ApiException {
        okhttp3.Call localVarCall = pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1ValidateBeforeCall(customEntityTemplateCode, code, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Disable a Custom entity instance with a given code   (asynchronously)
     *  Disable a Custom entity instance with a given code  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code Custom entity instance 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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1Async(String customEntityTemplateCode, String code, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeDisable1ValidateBeforeCall(customEntityTemplateCode, code, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code Custom entity instance 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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1Call(String customEntityTemplateCode, String code, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/customEntityInstance/{customEntityTemplateCode}/{code}/enable"
            .replaceAll("\\{" + "customEntityTemplateCode" + "\\}", localVarApiClient.escapeString(customEntityTemplateCode.toString()))
            .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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1ValidateBeforeCall(String customEntityTemplateCode, String code, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'customEntityTemplateCode' is set
        if (customEntityTemplateCode == null) {
            throw new ApiException("Missing the required parameter 'customEntityTemplateCode' when calling pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1(Async)");
        }
        
        // verify the required parameter 'code' is set
        if (code == null) {
            throw new ApiException("Missing the required parameter 'code' when calling pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1(Async)");
        }
        

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

    }

    /**
     *  Enable a Custom entity instance with a given code  
     *  Enable a Custom entity instance with a given code  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code Custom entity instance 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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1(String customEntityTemplateCode, String code) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1WithHttpInfo(customEntityTemplateCode, code);
        return localVarResp.getData();
    }

    /**
     *  Enable a Custom entity instance with a given code  
     *  Enable a Custom entity instance with a given code  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code Custom entity instance 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> pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1WithHttpInfo(String customEntityTemplateCode, String code) throws ApiException {
        okhttp3.Call localVarCall = pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1ValidateBeforeCall(customEntityTemplateCode, code, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Enable a Custom entity instance with a given code   (asynchronously)
     *  Enable a Custom entity instance with a given code  
     * @param customEntityTemplateCode  customEntityTemplateCode The custom entity template&#39;s code  (required)
     * @param code  code Custom entity instance 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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1Async(String customEntityTemplateCode, String code, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTCustomEntityInstanceCustomEntityTemplateCodeCodeEnable1ValidateBeforeCall(customEntityTemplateCode, code, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode code of custome entity template.  (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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1Call(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = customEntityInstanceDto;

        // create path and map variables
        String localVarPath = "/customEntityInstance/{customEntityTemplateCode}/createOrUpdate"
            .replaceAll("\\{" + "customEntityTemplateCode" + "\\}", localVarApiClient.escapeString(customEntityTemplateCode.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 = {
            "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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1ValidateBeforeCall(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'customEntityTemplateCode' is set
        if (customEntityTemplateCode == null) {
            throw new ApiException("Missing the required parameter 'customEntityTemplateCode' when calling pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1(Async)");
        }
        

        okhttp3.Call localVarCall = pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1Call(customEntityTemplateCode, customEntityInstanceDto, _callback);
        return localVarCall;

    }

    /**
     *  Create new or update an existing custom entity instance with a given code.  
     *  Create new or update an existing custom entity instance with a given code.  
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode code of custome entity template.  (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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1WithHttpInfo(customEntityTemplateCode, customEntityInstanceDto);
        return localVarResp.getData();
    }

    /**
     *  Create new or update an existing custom entity instance with a given code.  
     *  Create new or update an existing custom entity instance with a given code.  
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode code of custome entity template.  (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> pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1WithHttpInfo(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto) throws ApiException {
        okhttp3.Call localVarCall = pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1ValidateBeforeCall(customEntityTemplateCode, customEntityInstanceDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Create new or update an existing custom entity instance with a given code.   (asynchronously)
     *  Create new or update an existing custom entity instance with a given code.  
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode code of custome entity template.  (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 pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1Async(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pOSTCustomEntityInstanceCustomEntityTemplateCodeCreateOrUpdate1ValidateBeforeCall(customEntityTemplateCode, customEntityInstanceDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for pUTCustomEntityInstanceCustomEntityTemplateCode1
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode The custom entity template&#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>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pUTCustomEntityInstanceCustomEntityTemplateCode1Call(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = customEntityInstanceDto;

        // create path and map variables
        String localVarPath = "/customEntityInstance/{customEntityTemplateCode}"
            .replaceAll("\\{" + "customEntityTemplateCode" + "\\}", localVarApiClient.escapeString(customEntityTemplateCode.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 = {
            "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 pUTCustomEntityInstanceCustomEntityTemplateCode1ValidateBeforeCall(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'customEntityTemplateCode' is set
        if (customEntityTemplateCode == null) {
            throw new ApiException("Missing the required parameter 'customEntityTemplateCode' when calling pUTCustomEntityInstanceCustomEntityTemplateCode1(Async)");
        }
        

        okhttp3.Call localVarCall = pUTCustomEntityInstanceCustomEntityTemplateCode1Call(customEntityTemplateCode, customEntityInstanceDto, _callback);
        return localVarCall;

    }

    /**
     *  Update an existing custom entity instance using a custom entity template  
     *  Update an existing custom entity instance using a custom entity template  
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode The custom entity template&#39;s code  (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 pUTCustomEntityInstanceCustomEntityTemplateCode1(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto) throws ApiException {
        ApiResponse<ActionStatus> localVarResp = pUTCustomEntityInstanceCustomEntityTemplateCode1WithHttpInfo(customEntityTemplateCode, customEntityInstanceDto);
        return localVarResp.getData();
    }

    /**
     *  Update an existing custom entity instance using a custom entity template  
     *  Update an existing custom entity instance using a custom entity template  
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode The custom entity template&#39;s code  (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> pUTCustomEntityInstanceCustomEntityTemplateCode1WithHttpInfo(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto) throws ApiException {
        okhttp3.Call localVarCall = pUTCustomEntityInstanceCustomEntityTemplateCode1ValidateBeforeCall(customEntityTemplateCode, customEntityInstanceDto, null);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     *  Update an existing custom entity instance using a custom entity template   (asynchronously)
     *  Update an existing custom entity instance using a custom entity template  
     * @param customEntityTemplateCode  dto The custom entity instance&#39;s data  (required)
     * @param customEntityInstanceDto  customEntityTemplateCode The custom entity template&#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>  Request processing status  </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call pUTCustomEntityInstanceCustomEntityTemplateCode1Async(String customEntityTemplateCode, CustomEntityInstanceDto customEntityInstanceDto, final ApiCallback<ActionStatus> _callback) throws ApiException {

        okhttp3.Call localVarCall = pUTCustomEntityInstanceCustomEntityTemplateCode1ValidateBeforeCall(customEntityTemplateCode, customEntityInstanceDto, _callback);
        Type localVarReturnType = new TypeToken<ActionStatus>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for user39
     * @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 user39Call(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/customEntityInstance/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 user39ValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = user39Call(_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 user39() throws ApiException {
        ApiResponse<ActionStatus> localVarResp = user39WithHttpInfo();
        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> user39WithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = user39ValidateBeforeCall(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 user39Async(final ApiCallback<ActionStatus> _callback) throws ApiException {

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