All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kibocommerce.sdk.fulfillment.api.WorkflowProcessControllerApi Maven / Gradle / Ivy

The newest version!
/*
 * Kibo Fulfillment API - Production Profile
 * REST API backing the Kibo Fulfiller User Interface
 *
 * OpenAPI spec version: 1.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.kibocommerce.sdk.fulfillment.api;

import com.kibocommerce.sdk.fulfillment.ApiCallback;
import com.kibocommerce.sdk.fulfillment.ApiClient;
import com.kibocommerce.sdk.fulfillment.ApiException;
import com.kibocommerce.sdk.fulfillment.ApiResponse;
import com.kibocommerce.sdk.fulfillment.Configuration;
import com.kibocommerce.sdk.fulfillment.Pair;
import com.kibocommerce.sdk.fulfillment.ProgressRequestBody;
import com.kibocommerce.sdk.fulfillment.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.kibocommerce.sdk.fulfillment.model.CollectionModelOfEntityModelOfWorkflowProcess;
import com.kibocommerce.sdk.fulfillment.model.EntityModelOfWorkflowProcess;

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

public class WorkflowProcessControllerApi {
    private ApiClient apiClient;

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

    public WorkflowProcessControllerApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
     * Build call for getDefinitionImageUsingGET
     * @param containerIdOrAlias containerIdOrAlias (required)
     * @param processId processId (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call getDefinitionImageUsingGETCall(String containerIdOrAlias, String processId, Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = new Object();

        // create path and map variables
        String localVarPath = "/commerce/processes/definitionImage/{containerIdOrAlias}/{processId}"
            .replaceAll("\\{" + "containerIdOrAlias" + "\\}", apiClient.escapeString(containerIdOrAlias.toString()))
            .replaceAll("\\{" + "processId" + "\\}", apiClient.escapeString(processId.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        if (xVolSite != null) {
            localVarHeaderParams.put("x-vol-site", apiClient.parameterToString(xVolSite));
        }

        if (xVolTenant != null) {
            localVarHeaderParams.put("x-vol-tenant", apiClient.parameterToString(xVolTenant));
        }

        Map localVarFormParams = new HashMap();
        final String[] localVarAccepts = {
            "application/xml", "image/svg+xml"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

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

        if (progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getDefinitionImageUsingGETValidateBeforeCall(String containerIdOrAlias, String processId, Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'containerIdOrAlias' is set
        if (containerIdOrAlias == null) {
            throw new ApiException("Missing the required parameter 'containerIdOrAlias' when calling getDefinitionImageUsingGET(Async)");
        }
        
        // verify the required parameter 'processId' is set
        if (processId == null) {
            throw new ApiException("Missing the required parameter 'processId' when calling getDefinitionImageUsingGET(Async)");
        }
        
        // verify the required parameter 'xVolTenant' is set
        if (xVolTenant == null) {
            throw new ApiException("Missing the required parameter 'xVolTenant' when calling getDefinitionImageUsingGET(Async)");
        }
        

        com.squareup.okhttp.Call call = getDefinitionImageUsingGETCall(containerIdOrAlias, processId, xVolTenant, xVolSite, progressListener, progressRequestListener);
        return call;

    }

    /**
     * getDefinitionImage
     * 
     * @param containerIdOrAlias containerIdOrAlias (required)
     * @param processId processId (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public String getDefinitionImageUsingGET(String containerIdOrAlias, String processId, Integer xVolTenant, Integer xVolSite) throws ApiException {
        ApiResponse resp = getDefinitionImageUsingGETWithHttpInfo(containerIdOrAlias, processId, xVolTenant, xVolSite);
        return resp.getData();
    }

    /**
     * getDefinitionImage
     * 
     * @param containerIdOrAlias containerIdOrAlias (required)
     * @param processId processId (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return ApiResponse<String>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getDefinitionImageUsingGETWithHttpInfo(String containerIdOrAlias, String processId, Integer xVolTenant, Integer xVolSite) throws ApiException {
        com.squareup.okhttp.Call call = getDefinitionImageUsingGETValidateBeforeCall(containerIdOrAlias, processId, xVolTenant, xVolSite, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * getDefinitionImage (asynchronously)
     * 
     * @param containerIdOrAlias containerIdOrAlias (required)
     * @param processId processId (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (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
     */
    public com.squareup.okhttp.Call getDefinitionImageUsingGETAsync(String containerIdOrAlias, String processId, Integer xVolTenant, Integer xVolSite, final ApiCallback callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        com.squareup.okhttp.Call call = getDefinitionImageUsingGETValidateBeforeCall(containerIdOrAlias, processId, xVolTenant, xVolSite, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getWorkflowProcessByShipmentTypeLocationCodeUsingGET
     * @param locationCode locationCode (required)
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call getWorkflowProcessByShipmentTypeLocationCodeUsingGETCall(String locationCode, String shipmentType, Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = new Object();

        // create path and map variables
        String localVarPath = "/commerce/processes/shipmentType/{shipmentType}/location/{locationCode}"
            .replaceAll("\\{" + "locationCode" + "\\}", apiClient.escapeString(locationCode.toString()))
            .replaceAll("\\{" + "shipmentType" + "\\}", apiClient.escapeString(shipmentType.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        if (xVolSite != null) {
            localVarHeaderParams.put("x-vol-site", apiClient.parameterToString(xVolSite));
        }

        if (xVolTenant != null) {
            localVarHeaderParams.put("x-vol-tenant", apiClient.parameterToString(xVolTenant));
        }

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

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

        if (progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getWorkflowProcessByShipmentTypeLocationCodeUsingGETValidateBeforeCall(String locationCode, String shipmentType, Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'locationCode' is set
        if (locationCode == null) {
            throw new ApiException("Missing the required parameter 'locationCode' when calling getWorkflowProcessByShipmentTypeLocationCodeUsingGET(Async)");
        }
        
        // verify the required parameter 'shipmentType' is set
        if (shipmentType == null) {
            throw new ApiException("Missing the required parameter 'shipmentType' when calling getWorkflowProcessByShipmentTypeLocationCodeUsingGET(Async)");
        }
        
        // verify the required parameter 'xVolTenant' is set
        if (xVolTenant == null) {
            throw new ApiException("Missing the required parameter 'xVolTenant' when calling getWorkflowProcessByShipmentTypeLocationCodeUsingGET(Async)");
        }
        

        com.squareup.okhttp.Call call = getWorkflowProcessByShipmentTypeLocationCodeUsingGETCall(locationCode, shipmentType, xVolTenant, xVolSite, progressListener, progressRequestListener);
        return call;

    }

    /**
     * getWorkflowProcessByShipmentTypeLocationCode
     * 
     * @param locationCode locationCode (required)
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return EntityModelOfWorkflowProcess
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public EntityModelOfWorkflowProcess getWorkflowProcessByShipmentTypeLocationCodeUsingGET(String locationCode, String shipmentType, Integer xVolTenant, Integer xVolSite) throws ApiException {
        ApiResponse resp = getWorkflowProcessByShipmentTypeLocationCodeUsingGETWithHttpInfo(locationCode, shipmentType, xVolTenant, xVolSite);
        return resp.getData();
    }

    /**
     * getWorkflowProcessByShipmentTypeLocationCode
     * 
     * @param locationCode locationCode (required)
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return ApiResponse<EntityModelOfWorkflowProcess>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getWorkflowProcessByShipmentTypeLocationCodeUsingGETWithHttpInfo(String locationCode, String shipmentType, Integer xVolTenant, Integer xVolSite) throws ApiException {
        com.squareup.okhttp.Call call = getWorkflowProcessByShipmentTypeLocationCodeUsingGETValidateBeforeCall(locationCode, shipmentType, xVolTenant, xVolSite, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * getWorkflowProcessByShipmentTypeLocationCode (asynchronously)
     * 
     * @param locationCode locationCode (required)
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (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
     */
    public com.squareup.okhttp.Call getWorkflowProcessByShipmentTypeLocationCodeUsingGETAsync(String locationCode, String shipmentType, Integer xVolTenant, Integer xVolSite, final ApiCallback callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        com.squareup.okhttp.Call call = getWorkflowProcessByShipmentTypeLocationCodeUsingGETValidateBeforeCall(locationCode, shipmentType, xVolTenant, xVolSite, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGET
     * @param locationGroupCode locationGroupCode (required)
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGETCall(String locationGroupCode, String shipmentType, Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = new Object();

        // create path and map variables
        String localVarPath = "/commerce/processes/shipmentType/{shipmentType}/locationGroup/{locationGroupCode}"
            .replaceAll("\\{" + "locationGroupCode" + "\\}", apiClient.escapeString(locationGroupCode.toString()))
            .replaceAll("\\{" + "shipmentType" + "\\}", apiClient.escapeString(shipmentType.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        if (xVolSite != null) {
            localVarHeaderParams.put("x-vol-site", apiClient.parameterToString(xVolSite));
        }

        if (xVolTenant != null) {
            localVarHeaderParams.put("x-vol-tenant", apiClient.parameterToString(xVolTenant));
        }

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

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

        if (progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGETValidateBeforeCall(String locationGroupCode, String shipmentType, Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'locationGroupCode' is set
        if (locationGroupCode == null) {
            throw new ApiException("Missing the required parameter 'locationGroupCode' when calling getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGET(Async)");
        }
        
        // verify the required parameter 'shipmentType' is set
        if (shipmentType == null) {
            throw new ApiException("Missing the required parameter 'shipmentType' when calling getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGET(Async)");
        }
        
        // verify the required parameter 'xVolTenant' is set
        if (xVolTenant == null) {
            throw new ApiException("Missing the required parameter 'xVolTenant' when calling getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGET(Async)");
        }
        

        com.squareup.okhttp.Call call = getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGETCall(locationGroupCode, shipmentType, xVolTenant, xVolSite, progressListener, progressRequestListener);
        return call;

    }

    /**
     * getWorkflowProcessByShipmentTypeLocationGroupCode
     * 
     * @param locationGroupCode locationGroupCode (required)
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return EntityModelOfWorkflowProcess
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public EntityModelOfWorkflowProcess getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGET(String locationGroupCode, String shipmentType, Integer xVolTenant, Integer xVolSite) throws ApiException {
        ApiResponse resp = getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGETWithHttpInfo(locationGroupCode, shipmentType, xVolTenant, xVolSite);
        return resp.getData();
    }

    /**
     * getWorkflowProcessByShipmentTypeLocationGroupCode
     * 
     * @param locationGroupCode locationGroupCode (required)
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return ApiResponse<EntityModelOfWorkflowProcess>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGETWithHttpInfo(String locationGroupCode, String shipmentType, Integer xVolTenant, Integer xVolSite) throws ApiException {
        com.squareup.okhttp.Call call = getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGETValidateBeforeCall(locationGroupCode, shipmentType, xVolTenant, xVolSite, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * getWorkflowProcessByShipmentTypeLocationGroupCode (asynchronously)
     * 
     * @param locationGroupCode locationGroupCode (required)
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (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
     */
    public com.squareup.okhttp.Call getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGETAsync(String locationGroupCode, String shipmentType, Integer xVolTenant, Integer xVolSite, final ApiCallback callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        com.squareup.okhttp.Call call = getWorkflowProcessByShipmentTypeLocationGroupCodeUsingGETValidateBeforeCall(locationGroupCode, shipmentType, xVolTenant, xVolSite, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getWorkflowProcessByShipmentTypeUsingGET
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @deprecated
     */
    @Deprecated
    public com.squareup.okhttp.Call getWorkflowProcessByShipmentTypeUsingGETCall(String shipmentType, Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = new Object();

        // create path and map variables
        String localVarPath = "/commerce/processes/shipmentType/{shipmentType}"
            .replaceAll("\\{" + "shipmentType" + "\\}", apiClient.escapeString(shipmentType.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        if (xVolSite != null) {
            localVarHeaderParams.put("x-vol-site", apiClient.parameterToString(xVolSite));
        }

        if (xVolTenant != null) {
            localVarHeaderParams.put("x-vol-tenant", apiClient.parameterToString(xVolTenant));
        }

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

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

        if (progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @Deprecated
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getWorkflowProcessByShipmentTypeUsingGETValidateBeforeCall(String shipmentType, Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'shipmentType' is set
        if (shipmentType == null) {
            throw new ApiException("Missing the required parameter 'shipmentType' when calling getWorkflowProcessByShipmentTypeUsingGET(Async)");
        }
        
        // verify the required parameter 'xVolTenant' is set
        if (xVolTenant == null) {
            throw new ApiException("Missing the required parameter 'xVolTenant' when calling getWorkflowProcessByShipmentTypeUsingGET(Async)");
        }
        

        com.squareup.okhttp.Call call = getWorkflowProcessByShipmentTypeUsingGETCall(shipmentType, xVolTenant, xVolSite, progressListener, progressRequestListener);
        return call;

    }

    /**
     * getWorkflowProcessByShipmentType
     * 
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return EntityModelOfWorkflowProcess
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @deprecated
     */
    @Deprecated
    public EntityModelOfWorkflowProcess getWorkflowProcessByShipmentTypeUsingGET(String shipmentType, Integer xVolTenant, Integer xVolSite) throws ApiException {
        ApiResponse resp = getWorkflowProcessByShipmentTypeUsingGETWithHttpInfo(shipmentType, xVolTenant, xVolSite);
        return resp.getData();
    }

    /**
     * getWorkflowProcessByShipmentType
     * 
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return ApiResponse<EntityModelOfWorkflowProcess>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @deprecated
     */
    @Deprecated
    public ApiResponse getWorkflowProcessByShipmentTypeUsingGETWithHttpInfo(String shipmentType, Integer xVolTenant, Integer xVolSite) throws ApiException {
        com.squareup.okhttp.Call call = getWorkflowProcessByShipmentTypeUsingGETValidateBeforeCall(shipmentType, xVolTenant, xVolSite, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * getWorkflowProcessByShipmentType (asynchronously)
     * 
     * @param shipmentType shipmentType (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (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
     * @deprecated
     */
    @Deprecated
    public com.squareup.okhttp.Call getWorkflowProcessByShipmentTypeUsingGETAsync(String shipmentType, Integer xVolTenant, Integer xVolSite, final ApiCallback callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        com.squareup.okhttp.Call call = getWorkflowProcessByShipmentTypeUsingGETValidateBeforeCall(shipmentType, xVolTenant, xVolSite, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getWorkflowProcessUsingGET
     * @param containerIdOrAlias containerIdOrAlias (required)
     * @param processId processId (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call getWorkflowProcessUsingGETCall(String containerIdOrAlias, String processId, Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = new Object();

        // create path and map variables
        String localVarPath = "/commerce/processes/definitions/{containerIdOrAlias}/{processId}"
            .replaceAll("\\{" + "containerIdOrAlias" + "\\}", apiClient.escapeString(containerIdOrAlias.toString()))
            .replaceAll("\\{" + "processId" + "\\}", apiClient.escapeString(processId.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        if (xVolSite != null) {
            localVarHeaderParams.put("x-vol-site", apiClient.parameterToString(xVolSite));
        }

        if (xVolTenant != null) {
            localVarHeaderParams.put("x-vol-tenant", apiClient.parameterToString(xVolTenant));
        }

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

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

        if (progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getWorkflowProcessUsingGETValidateBeforeCall(String containerIdOrAlias, String processId, Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'containerIdOrAlias' is set
        if (containerIdOrAlias == null) {
            throw new ApiException("Missing the required parameter 'containerIdOrAlias' when calling getWorkflowProcessUsingGET(Async)");
        }
        
        // verify the required parameter 'processId' is set
        if (processId == null) {
            throw new ApiException("Missing the required parameter 'processId' when calling getWorkflowProcessUsingGET(Async)");
        }
        
        // verify the required parameter 'xVolTenant' is set
        if (xVolTenant == null) {
            throw new ApiException("Missing the required parameter 'xVolTenant' when calling getWorkflowProcessUsingGET(Async)");
        }
        

        com.squareup.okhttp.Call call = getWorkflowProcessUsingGETCall(containerIdOrAlias, processId, xVolTenant, xVolSite, progressListener, progressRequestListener);
        return call;

    }

    /**
     * getWorkflowProcess
     * 
     * @param containerIdOrAlias containerIdOrAlias (required)
     * @param processId processId (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return EntityModelOfWorkflowProcess
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public EntityModelOfWorkflowProcess getWorkflowProcessUsingGET(String containerIdOrAlias, String processId, Integer xVolTenant, Integer xVolSite) throws ApiException {
        ApiResponse resp = getWorkflowProcessUsingGETWithHttpInfo(containerIdOrAlias, processId, xVolTenant, xVolSite);
        return resp.getData();
    }

    /**
     * getWorkflowProcess
     * 
     * @param containerIdOrAlias containerIdOrAlias (required)
     * @param processId processId (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return ApiResponse<EntityModelOfWorkflowProcess>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getWorkflowProcessUsingGETWithHttpInfo(String containerIdOrAlias, String processId, Integer xVolTenant, Integer xVolSite) throws ApiException {
        com.squareup.okhttp.Call call = getWorkflowProcessUsingGETValidateBeforeCall(containerIdOrAlias, processId, xVolTenant, xVolSite, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * getWorkflowProcess (asynchronously)
     * 
     * @param containerIdOrAlias containerIdOrAlias (required)
     * @param processId processId (required)
     * @param xVolTenant  (required)
     * @param xVolSite  (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
     */
    public com.squareup.okhttp.Call getWorkflowProcessUsingGETAsync(String containerIdOrAlias, String processId, Integer xVolTenant, Integer xVolSite, final ApiCallback callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        com.squareup.okhttp.Call call = getWorkflowProcessUsingGETValidateBeforeCall(containerIdOrAlias, processId, xVolTenant, xVolSite, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
    /**
     * Build call for getWorkflowProcessesUsingGET
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @param progressListener Progress listener
     * @param progressRequestListener Progress request listener
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     */
    public com.squareup.okhttp.Call getWorkflowProcessesUsingGETCall(Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = new Object();

        // create path and map variables
        String localVarPath = "/commerce/processes/definitions";

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        if (xVolSite != null) {
            localVarHeaderParams.put("x-vol-site", apiClient.parameterToString(xVolSite));
        }

        if (xVolTenant != null) {
            localVarHeaderParams.put("x-vol-tenant", apiClient.parameterToString(xVolTenant));
        }

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

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

        if (progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }

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

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getWorkflowProcessesUsingGETValidateBeforeCall(Integer xVolTenant, Integer xVolSite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        // verify the required parameter 'xVolTenant' is set
        if (xVolTenant == null) {
            throw new ApiException("Missing the required parameter 'xVolTenant' when calling getWorkflowProcessesUsingGET(Async)");
        }
        

        com.squareup.okhttp.Call call = getWorkflowProcessesUsingGETCall(xVolTenant, xVolSite, progressListener, progressRequestListener);
        return call;

    }

    /**
     * getWorkflowProcesses
     * 
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return CollectionModelOfEntityModelOfWorkflowProcess
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public CollectionModelOfEntityModelOfWorkflowProcess getWorkflowProcessesUsingGET(Integer xVolTenant, Integer xVolSite) throws ApiException {
        ApiResponse resp = getWorkflowProcessesUsingGETWithHttpInfo(xVolTenant, xVolSite);
        return resp.getData();
    }

    /**
     * getWorkflowProcesses
     * 
     * @param xVolTenant  (required)
     * @param xVolSite  (optional)
     * @return ApiResponse<CollectionModelOfEntityModelOfWorkflowProcess>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse getWorkflowProcessesUsingGETWithHttpInfo(Integer xVolTenant, Integer xVolSite) throws ApiException {
        com.squareup.okhttp.Call call = getWorkflowProcessesUsingGETValidateBeforeCall(xVolTenant, xVolSite, null, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * getWorkflowProcesses (asynchronously)
     * 
     * @param xVolTenant  (required)
     * @param xVolSite  (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
     */
    public com.squareup.okhttp.Call getWorkflowProcessesUsingGETAsync(Integer xVolTenant, Integer xVolSite, final ApiCallback callback) throws ApiException {

        ProgressResponseBody.ProgressListener progressListener = null;
        ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

        if (callback != null) {
            progressListener = new ProgressResponseBody.ProgressListener() {
                @Override
                public void update(long bytesRead, long contentLength, boolean done) {
                    callback.onDownloadProgress(bytesRead, contentLength, done);
                }
            };

            progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
                @Override
                public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                    callback.onUploadProgress(bytesWritten, contentLength, done);
                }
            };
        }

        com.squareup.okhttp.Call call = getWorkflowProcessesUsingGETValidateBeforeCall(xVolTenant, xVolSite, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy