package nl.uva.sne.drip.commons.sure_tosca.client;

/*
 * tosca-sure
 * TOSCA Simple qUeRy sErvice (SURE). 
 *
 * OpenAPI spec version: 1.0.0
 * Contact: S.Koulouzis@uva.nl
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

import com.google.gson.reflect.TypeToken;

import java.io.IOException;

import java.io.File;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import nl.uva.sne.drip.model.NodeTemplate;
import nl.uva.sne.drip.model.TopologyTemplate;
import nl.uva.sne.drip.model.ToscaTemplate;

public class DefaultApi {

    private ApiClient apiClient;

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
     * Build call for getAllAncestorProperties
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @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 getAllAncestorPropertiesCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_properties"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
                .replaceAll("\\{" + "node_name" + "\\}", apiClient.escapeString(nodeName.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"
        };
        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 getAllAncestorPropertiesValidateBeforeCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getAllAncestorProperties(Async)");
        }

        // verify the required parameter 'nodeName' is set
        if (nodeName == null) {
            throw new ApiException("Missing the required parameter 'nodeName' when calling getAllAncestorProperties(Async)");
        }

        com.squareup.okhttp.Call call = getAllAncestorPropertiesCall(id, nodeName, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * Recursively get all requirements all the way to the ROOT including the
     * input node&#39;s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return List&lt;Map&lt;String, Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public List<Map<String, Object>> getAllAncestorProperties(String id, String nodeName) throws ApiException {
        ApiResponse<List<Map<String, Object>>> resp = getAllAncestorPropertiesWithHttpInfo(id, nodeName);
        return resp.getData();
    }

    /**
     *
     * Recursively get all requirements all the way to the ROOT including the
     * input node&#39;s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return ApiResponse&lt;List&lt;Map&lt;String, Object&gt;&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<List<Map<String, Object>>> getAllAncestorPropertiesWithHttpInfo(String id, String nodeName) throws ApiException {
        com.squareup.okhttp.Call call = getAllAncestorPropertiesValidateBeforeCall(id, nodeName, null, null);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) Recursively get all requirements all the way to the ROOT
     * including the input node&#39;s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (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
     */
    public com.squareup.okhttp.Call getAllAncestorPropertiesAsync(String id, String nodeName, final ApiCallback<List<Map<String, Object>>> 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 = getAllAncestorPropertiesValidateBeforeCall(id, nodeName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getAllAncestorTypes
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @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 getAllAncestorTypesCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_types"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
                .replaceAll("\\{" + "node_name" + "\\}", apiClient.escapeString(nodeName.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"
        };
        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 getAllAncestorTypesValidateBeforeCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getAllAncestorTypes(Async)");
        }

        // verify the required parameter 'nodeName' is set
        if (nodeName == null) {
            throw new ApiException("Missing the required parameter 'nodeName' when calling getAllAncestorTypes(Async)");
        }

        com.squareup.okhttp.Call call = getAllAncestorTypesCall(id, nodeName, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * Recursively get all requirements all the way to the ROOT including the
     * input node&#39;s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return List&lt;String&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public List<String> getAllAncestorTypes(String id, String nodeName) throws ApiException {
        ApiResponse<List<String>> resp = getAllAncestorTypesWithHttpInfo(id, nodeName);
        return resp.getData();
    }

    /**
     *
     * Recursively get all requirements all the way to the ROOT including the
     * input node&#39;s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return ApiResponse&lt;List&lt;String&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<List<String>> getAllAncestorTypesWithHttpInfo(String id, String nodeName) throws ApiException {
        com.squareup.okhttp.Call call = getAllAncestorTypesValidateBeforeCall(id, nodeName, null, null);
        Type localVarReturnType = new TypeToken<List<String>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) Recursively get all requirements all the way to the ROOT
     * including the input node&#39;s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (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
     */
    public com.squareup.okhttp.Call getAllAncestorTypesAsync(String id, String nodeName, final ApiCallback<List<String>> 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 = getAllAncestorTypesValidateBeforeCall(id, nodeName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<String>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getAncestorsRequirements
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @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 getAncestorsRequirementsCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_requirements"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
                .replaceAll("\\{" + "node_name" + "\\}", apiClient.escapeString(nodeName.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"
        };
        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 getAncestorsRequirementsValidateBeforeCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getAncestorsRequirements(Async)");
        }

        // verify the required parameter 'nodeName' is set
        if (nodeName == null) {
            throw new ApiException("Missing the required parameter 'nodeName' when calling getAncestorsRequirements(Async)");
        }

        com.squareup.okhttp.Call call = getAncestorsRequirementsCall(id, nodeName, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * Recursively get all requirements all the way to the ROOT including the
     * input node&#39;s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return Map&lt;String, Object&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public Map<String, Object> getAncestorsRequirements(String id, String nodeName) throws ApiException {
        ApiResponse<Map<String, Object>> resp = getAncestorsRequirementsWithHttpInfo(id, nodeName);
        return resp.getData();
    }

    /**
     *
     * Recursively get all requirements all the way to the ROOT including the
     * input node&#39;s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return ApiResponse&lt;Map&lt;String, Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<Map<String, Object>> getAncestorsRequirementsWithHttpInfo(String id, String nodeName) throws ApiException {
        com.squareup.okhttp.Call call = getAncestorsRequirementsValidateBeforeCall(id, nodeName, null, null);
        Type localVarReturnType = new TypeToken<Map<String, Object>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) Recursively get all requirements all the way to the ROOT
     * including the input node&#39;s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (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
     */
    public com.squareup.okhttp.Call getAncestorsRequirementsAsync(String id, String nodeName, final ApiCallback<Map<String, Object>> 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 = getAncestorsRequirementsValidateBeforeCall(id, nodeName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<Map<String, Object>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getDslDefinitions
     *
     * @param id ID of topolog template uplodaed (required)
     * @param anchors the anchors the definition is for (optional)
     * @param derivedFrom derived from (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 getDslDefinitionsCall(String id, List<String> anchors, String derivedFrom, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/dsl_definitions"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (anchors != null) {
            localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "anchors", anchors));
        }
        if (derivedFrom != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("derived_from", derivedFrom));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/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 getDslDefinitionsValidateBeforeCall(String id, List<String> anchors, String derivedFrom, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getDslDefinitions(Async)");
        }

        com.squareup.okhttp.Call call = getDslDefinitionsCall(id, anchors, derivedFrom, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @param anchors the anchors the definition is for (optional)
     * @param derivedFrom derived from (optional)
     * @return List&lt;Map&lt;String, Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public List<Map<String, Object>> getDslDefinitions(String id, List<String> anchors, String derivedFrom) throws ApiException {
        ApiResponse<List<Map<String, Object>>> resp = getDslDefinitionsWithHttpInfo(id, anchors, derivedFrom);
        return resp.getData();
    }

    /**
     *
     * returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @param anchors the anchors the definition is for (optional)
     * @param derivedFrom derived from (optional)
     * @return ApiResponse&lt;List&lt;Map&lt;String, Object&gt;&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<List<Map<String, Object>>> getDslDefinitionsWithHttpInfo(String id, List<String> anchors, String derivedFrom) throws ApiException {
        com.squareup.okhttp.Call call = getDslDefinitionsValidateBeforeCall(id, anchors, derivedFrom, null, null);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @param anchors the anchors the definition is for (optional)
     * @param derivedFrom derived from (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 getDslDefinitionsAsync(String id, List<String> anchors, String derivedFrom, final ApiCallback<List<Map<String, Object>>> 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 = getDslDefinitionsValidateBeforeCall(id, anchors, derivedFrom, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getImports
     *
     * @param id ID of topolog template uplodaed (required)
     * @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 getImportsCall(String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/imports"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.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"
        };
        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 getImportsValidateBeforeCall(String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getImports(Async)");
        }

        com.squareup.okhttp.Call call = getImportsCall(id, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @return List&lt;Map&lt;String, Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public List<Map<String, Object>> getImports(String id) throws ApiException {
        ApiResponse<List<Map<String, Object>>> resp = getImportsWithHttpInfo(id);
        return resp.getData();
    }

    /**
     *
     * returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @return ApiResponse&lt;List&lt;Map&lt;String, Object&gt;&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<List<Map<String, Object>>> getImportsWithHttpInfo(String id) throws ApiException {
        com.squareup.okhttp.Call call = getImportsValidateBeforeCall(id, null, null);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) returns the interface types
     *
     * @param id ID of topolog template uplodaed (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
     */
    public com.squareup.okhttp.Call getImportsAsync(String id, final ApiCallback<List<Map<String, Object>>> 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 = getImportsValidateBeforeCall(id, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getNodeOutputs
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @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 getNodeOutputsCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates/{node_name}/outputs"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
                .replaceAll("\\{" + "node_name" + "\\}", apiClient.escapeString(nodeName.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"
        };
        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 getNodeOutputsValidateBeforeCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getNodeOutputs(Async)");
        }

        // verify the required parameter 'nodeName' is set
        if (nodeName == null) {
            throw new ApiException("Missing the required parameter 'nodeName' when calling getNodeOutputs(Async)");
        }

        com.squareup.okhttp.Call call = getNodeOutputsCall(id, nodeName, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return List&lt;Map&lt;String, Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public List<Map<String, Object>> getNodeOutputs(String id, String nodeName) throws ApiException {
        ApiResponse<List<Map<String, Object>>> resp = getNodeOutputsWithHttpInfo(id, nodeName);
        return resp.getData();
    }

    /**
     *
     * s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return ApiResponse&lt;List&lt;Map&lt;String, Object&gt;&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<List<Map<String, Object>>> getNodeOutputsWithHttpInfo(String id, String nodeName) throws ApiException {
        com.squareup.okhttp.Call call = getNodeOutputsValidateBeforeCall(id, nodeName, null, null);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (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
     */
    public com.squareup.okhttp.Call getNodeOutputsAsync(String id, String nodeName, final ApiCallback<List<Map<String, Object>>> 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 = getNodeOutputsValidateBeforeCall(id, nodeName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getNodeProperties
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @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 getNodePropertiesCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates/{node_name}/properties"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
                .replaceAll("\\{" + "node_name" + "\\}", apiClient.escapeString(nodeName.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"
        };
        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 getNodePropertiesValidateBeforeCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getNodeProperties(Async)");
        }

        // verify the required parameter 'nodeName' is set
        if (nodeName == null) {
            throw new ApiException("Missing the required parameter 'nodeName' when calling getNodeProperties(Async)");
        }

        com.squareup.okhttp.Call call = getNodePropertiesCall(id, nodeName, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return Map&lt;String, Object&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public Map<String, Object> getNodeProperties(String id, String nodeName) throws ApiException {
        ApiResponse<Map<String, Object>> resp = getNodePropertiesWithHttpInfo(id, nodeName);
        return resp.getData();
    }

    /**
     *
     * s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return ApiResponse&lt;Map&lt;String, Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<Map<String, Object>> getNodePropertiesWithHttpInfo(String id, String nodeName) throws ApiException {
        com.squareup.okhttp.Call call = getNodePropertiesValidateBeforeCall(id, nodeName, null, null);
        Type localVarReturnType = new TypeToken<Map<String, Object>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (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
     */
    public com.squareup.okhttp.Call getNodePropertiesAsync(String id, String nodeName, final ApiCallback<Map<String, Object>> 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 = getNodePropertiesValidateBeforeCall(id, nodeName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<Map<String, Object>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getNodeRequirements
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @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 getNodeRequirementsCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates/{node_name}/requirements"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
                .replaceAll("\\{" + "node_name" + "\\}", apiClient.escapeString(nodeName.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"
        };
        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 getNodeRequirementsValidateBeforeCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getNodeRequirements(Async)");
        }

        // verify the required parameter 'nodeName' is set
        if (nodeName == null) {
            throw new ApiException("Missing the required parameter 'nodeName' when calling getNodeRequirements(Async)");
        }

        com.squareup.okhttp.Call call = getNodeRequirementsCall(id, nodeName, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * Returns the requirements for an input node as described in the template
     * not in the node&#39;s definition
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return Map&lt;String, Object&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public Map<String, Object> getNodeRequirements(String id, String nodeName) throws ApiException {
        ApiResponse<Map<String, Object>> resp = getNodeRequirementsWithHttpInfo(id, nodeName);
        return resp.getData();
    }

    /**
     *
     * Returns the requirements for an input node as described in the template
     * not in the node&#39;s definition
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return ApiResponse&lt;Map&lt;String, Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<Map<String, Object>> getNodeRequirementsWithHttpInfo(String id, String nodeName) throws ApiException {
        com.squareup.okhttp.Call call = getNodeRequirementsValidateBeforeCall(id, nodeName, null, null);
        Type localVarReturnType = new TypeToken<Map<String, Object>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) Returns the requirements for an input node as described
     * in the template not in the node&#39;s definition
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (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
     */
    public com.squareup.okhttp.Call getNodeRequirementsAsync(String id, String nodeName, final ApiCallback<Map<String, Object>> 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 = getNodeRequirementsValidateBeforeCall(id, nodeName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<Map<String, Object>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getNodeTemplates
     *
     * @param id ID of topolog template uplodaed (required)
     * @param typeName The type (optional)
     * @param nodeName the name (optional)
     * @param hasInterfaces filter if has interfaces (optional)
     * @param hasProperties filter if has properties (optional)
     * @param hasAttributes filter if has attributes (optional)
     * @param hasRequirements filter if has requirements (optional)
     * @param hasCapabilities filter if has capabilities (optional)
     * @param hasArtifacts filter if has artifacts (optional)
     * @param derivedFrom derived from (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 getNodeTemplatesCall(String id, String typeName, String nodeName, Boolean hasInterfaces, Boolean hasProperties, Boolean hasAttributes, Boolean hasRequirements, Boolean hasCapabilities, Boolean hasArtifacts, String derivedFrom, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (typeName != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("type_name", typeName));
        }
        if (nodeName != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("node_name", nodeName));
        }
        if (hasInterfaces != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_interfaces", hasInterfaces));
        }
        if (hasProperties != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_properties", hasProperties));
        }
        if (hasAttributes != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_attributes", hasAttributes));
        }
        if (hasRequirements != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_requirements", hasRequirements));
        }
        if (hasCapabilities != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_capabilities", hasCapabilities));
        }
        if (hasArtifacts != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_artifacts", hasArtifacts));
        }
        if (derivedFrom != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("derived_from", derivedFrom));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/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 getNodeTemplatesValidateBeforeCall(String id, String typeName, String nodeName, Boolean hasInterfaces, Boolean hasProperties, Boolean hasAttributes, Boolean hasRequirements, Boolean hasCapabilities, Boolean hasArtifacts, String derivedFrom, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getNodeTemplates(Async)");
        }

        com.squareup.okhttp.Call call = getNodeTemplatesCall(id, typeName, nodeName, hasInterfaces, hasProperties, hasAttributes, hasRequirements, hasCapabilities, hasArtifacts, derivedFrom, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * returns nodes templates in topology
     *
     * @param id ID of topolog template uplodaed (required)
     * @param typeName The type (optional)
     * @param nodeName the name (optional)
     * @param hasInterfaces filter if has interfaces (optional)
     * @param hasProperties filter if has properties (optional)
     * @param hasAttributes filter if has attributes (optional)
     * @param hasRequirements filter if has requirements (optional)
     * @param hasCapabilities filter if has capabilities (optional)
     * @param hasArtifacts filter if has artifacts (optional)
     * @param derivedFrom derived from (optional)
     * @return List&lt;NodeTemplate&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public List<NodeTemplate> getNodeTemplates(String id, String typeName, String nodeName, Boolean hasInterfaces, Boolean hasProperties, Boolean hasAttributes, Boolean hasRequirements, Boolean hasCapabilities, Boolean hasArtifacts, String derivedFrom) throws ApiException {
        ApiResponse<List<NodeTemplate>> resp = getNodeTemplatesWithHttpInfo(id, typeName, nodeName, hasInterfaces, hasProperties, hasAttributes, hasRequirements, hasCapabilities, hasArtifacts, derivedFrom);
        return resp.getData();
    }

    /**
     *
     * returns nodes templates in topology
     *
     * @param id ID of topolog template uplodaed (required)
     * @param typeName The type (optional)
     * @param nodeName the name (optional)
     * @param hasInterfaces filter if has interfaces (optional)
     * @param hasProperties filter if has properties (optional)
     * @param hasAttributes filter if has attributes (optional)
     * @param hasRequirements filter if has requirements (optional)
     * @param hasCapabilities filter if has capabilities (optional)
     * @param hasArtifacts filter if has artifacts (optional)
     * @param derivedFrom derived from (optional)
     * @return ApiResponse&lt;List&lt;NodeTemplate&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<List<NodeTemplate>> getNodeTemplatesWithHttpInfo(String id, String typeName, String nodeName, Boolean hasInterfaces, Boolean hasProperties, Boolean hasAttributes, Boolean hasRequirements, Boolean hasCapabilities, Boolean hasArtifacts, String derivedFrom) throws ApiException {
        com.squareup.okhttp.Call call = getNodeTemplatesValidateBeforeCall(id, typeName, nodeName, hasInterfaces, hasProperties, hasAttributes, hasRequirements, hasCapabilities, hasArtifacts, derivedFrom, null, null);
        Type localVarReturnType = new TypeToken<List<NodeTemplate>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) returns nodes templates in topology
     *
     * @param id ID of topolog template uplodaed (required)
     * @param typeName The type (optional)
     * @param nodeName the name (optional)
     * @param hasInterfaces filter if has interfaces (optional)
     * @param hasProperties filter if has properties (optional)
     * @param hasAttributes filter if has attributes (optional)
     * @param hasRequirements filter if has requirements (optional)
     * @param hasCapabilities filter if has capabilities (optional)
     * @param hasArtifacts filter if has artifacts (optional)
     * @param derivedFrom derived from (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 getNodeTemplatesAsync(String id, String typeName, String nodeName, Boolean hasInterfaces, Boolean hasProperties, Boolean hasAttributes, Boolean hasRequirements, Boolean hasCapabilities, Boolean hasArtifacts, String derivedFrom, final ApiCallback<List<NodeTemplate>> 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 = getNodeTemplatesValidateBeforeCall(id, typeName, nodeName, hasInterfaces, hasProperties, hasAttributes, hasRequirements, hasCapabilities, hasArtifacts, derivedFrom, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<NodeTemplate>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getNodeTypeName
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @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 getNodeTypeNameCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates/{node_name}/type_name"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
                .replaceAll("\\{" + "node_name" + "\\}", apiClient.escapeString(nodeName.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"
        };
        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 getNodeTypeNameValidateBeforeCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getNodeTypeName(Async)");
        }

        // verify the required parameter 'nodeName' is set
        if (nodeName == null) {
            throw new ApiException("Missing the required parameter 'nodeName' when calling getNodeTypeName(Async)");
        }

        com.squareup.okhttp.Call call = getNodeTypeNameCall(id, nodeName, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public String getNodeTypeName(String id, String nodeName) throws ApiException {
        ApiResponse<String> resp = getNodeTypeNameWithHttpInfo(id, nodeName);
        return resp.getData();
    }

    /**
     *
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return ApiResponse&lt;String&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<String> getNodeTypeNameWithHttpInfo(String id, String nodeName) throws ApiException {
        com.squareup.okhttp.Call call = getNodeTypeNameValidateBeforeCall(id, nodeName, null, null);
        Type localVarReturnType = new TypeToken<String>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously)
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (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
     */
    public com.squareup.okhttp.Call getNodeTypeNameAsync(String id, String nodeName, final ApiCallback<String> 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 = getNodeTypeNameValidateBeforeCall(id, nodeName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<String>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getParentTypeName
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @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 getParentTypeNameCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates/{node_name}/derived_from"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
                .replaceAll("\\{" + "node_name" + "\\}", apiClient.escapeString(nodeName.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"
        };
        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 getParentTypeNameValidateBeforeCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getParentTypeName(Async)");
        }

        // verify the required parameter 'nodeName' is set
        if (nodeName == null) {
            throw new ApiException("Missing the required parameter 'nodeName' when calling getParentTypeName(Async)");
        }

        com.squareup.okhttp.Call call = getParentTypeNameCall(id, nodeName, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public String getParentTypeName(String id, String nodeName) throws ApiException {
        ApiResponse<String> resp = getParentTypeNameWithHttpInfo(id, nodeName);
        return resp.getData();
    }

    /**
     *
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return ApiResponse&lt;String&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<String> getParentTypeNameWithHttpInfo(String id, String nodeName) throws ApiException {
        com.squareup.okhttp.Call call = getParentTypeNameValidateBeforeCall(id, nodeName, null, null);
        Type localVarReturnType = new TypeToken<String>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously)
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (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
     */
    public com.squareup.okhttp.Call getParentTypeNameAsync(String id, String nodeName, final ApiCallback<String> 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 = getParentTypeNameValidateBeforeCall(id, nodeName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<String>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getRelatedNodes
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @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 getRelatedNodesCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates/{node_name}/related"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
                .replaceAll("\\{" + "node_name" + "\\}", apiClient.escapeString(nodeName.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"
        };
        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 getRelatedNodesValidateBeforeCall(String id, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getRelatedNodes(Async)");
        }

        // verify the required parameter 'nodeName' is set
        if (nodeName == null) {
            throw new ApiException("Missing the required parameter 'nodeName' when calling getRelatedNodes(Async)");
        }

        com.squareup.okhttp.Call call = getRelatedNodesCall(id, nodeName, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return List&lt;NodeTemplate&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public List<NodeTemplate> getRelatedNodes(String id, String nodeName) throws ApiException {
        ApiResponse<List<NodeTemplate>> resp = getRelatedNodesWithHttpInfo(id, nodeName);
        return resp.getData();
    }

    /**
     *
     * s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (required)
     * @return ApiResponse&lt;List&lt;NodeTemplate&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<List<NodeTemplate>> getRelatedNodesWithHttpInfo(String id, String nodeName) throws ApiException {
        com.squareup.okhttp.Call call = getRelatedNodesValidateBeforeCall(id, nodeName, null, null);
        Type localVarReturnType = new TypeToken<List<NodeTemplate>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param nodeName node_name (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
     */
    public com.squareup.okhttp.Call getRelatedNodesAsync(String id, String nodeName, final ApiCallback<List<NodeTemplate>> 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 = getRelatedNodesValidateBeforeCall(id, nodeName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<NodeTemplate>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getRelationshipTemplates
     *
     * @param id ID of topolog template uplodaed (required)
     * @param typeName The relationship type (optional)
     * @param derivedFrom derived from (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 getRelationshipTemplatesCall(String id, String typeName, String derivedFrom, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/relationship_templates"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (typeName != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("type_name", typeName));
        }
        if (derivedFrom != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("derived_from", derivedFrom));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/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 getRelationshipTemplatesValidateBeforeCall(String id, String typeName, String derivedFrom, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getRelationshipTemplates(Async)");
        }

        com.squareup.okhttp.Call call = getRelationshipTemplatesCall(id, typeName, derivedFrom, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @param typeName The relationship type (optional)
     * @param derivedFrom derived from (optional)
     * @return List&lt;Map&lt;String, Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public List<Map<String, Object>> getRelationshipTemplates(String id, String typeName, String derivedFrom) throws ApiException {
        ApiResponse<List<Map<String, Object>>> resp = getRelationshipTemplatesWithHttpInfo(id, typeName, derivedFrom);
        return resp.getData();
    }

    /**
     *
     * returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @param typeName The relationship type (optional)
     * @param derivedFrom derived from (optional)
     * @return ApiResponse&lt;List&lt;Map&lt;String, Object&gt;&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<List<Map<String, Object>>> getRelationshipTemplatesWithHttpInfo(String id, String typeName, String derivedFrom) throws ApiException {
        com.squareup.okhttp.Call call = getRelationshipTemplatesValidateBeforeCall(id, typeName, derivedFrom, null, null);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @param typeName The relationship type (optional)
     * @param derivedFrom derived from (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 getRelationshipTemplatesAsync(String id, String typeName, String derivedFrom, final ApiCallback<List<Map<String, Object>>> 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 = getRelationshipTemplatesValidateBeforeCall(id, typeName, derivedFrom, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getTopologyTemplate
     *
     * @param id ID of topolog template uplodaed (required)
     * @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 getTopologyTemplateCall(String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.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"
        };
        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 getTopologyTemplateValidateBeforeCall(String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getTopologyTemplate(Async)");
        }

        com.squareup.okhttp.Call call = getTopologyTemplateCall(id, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * r
     *
     * @param id ID of topolog template uplodaed (required)
     * @return TopologyTemplate
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public TopologyTemplate getTopologyTemplate(String id) throws ApiException {
        ApiResponse<TopologyTemplate> resp = getTopologyTemplateWithHttpInfo(id);
        return resp.getData();
    }

    /**
     *
     * r
     *
     * @param id ID of topolog template uplodaed (required)
     * @return ApiResponse&lt;TopologyTemplate&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<TopologyTemplate> getTopologyTemplateWithHttpInfo(String id) throws ApiException {
        com.squareup.okhttp.Call call = getTopologyTemplateValidateBeforeCall(id, null, null);
        Type localVarReturnType = new TypeToken<TopologyTemplate>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) r
     *
     * @param id ID of topolog template uplodaed (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
     */
    public com.squareup.okhttp.Call getTopologyTemplateAsync(String id, final ApiCallback<TopologyTemplate> 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 = getTopologyTemplateValidateBeforeCall(id, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<TopologyTemplate>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getToscaTemplate
     *
     * @param id ID of topolog template uplodaed (required)
     * @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 getToscaTemplateCall(String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.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"
        };
        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 getToscaTemplateValidateBeforeCall(String id, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getToscaTemplate(Async)");
        }

        com.squareup.okhttp.Call call = getToscaTemplateCall(id, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     *
     * @param id ID of topolog template uplodaed (required)
     * @return ToscaTemplate
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ToscaTemplate getToscaTemplate(String id) throws ApiException {
        ApiResponse<ToscaTemplate> resp = getToscaTemplateWithHttpInfo(id);
        return resp.getData();
    }

    /**
     *
     *
     * @param id ID of topolog template uplodaed (required)
     * @return ApiResponse&lt;ToscaTemplate&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<ToscaTemplate> getToscaTemplateWithHttpInfo(String id) throws ApiException {
        com.squareup.okhttp.Call call = getToscaTemplateValidateBeforeCall(id, null, null);
        Type localVarReturnType = new TypeToken<ToscaTemplate>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously)
     *
     * @param id ID of topolog template uplodaed (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
     */
    public com.squareup.okhttp.Call getToscaTemplateAsync(String id, final ApiCallback<ToscaTemplate> 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 = getToscaTemplateValidateBeforeCall(id, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<ToscaTemplate>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for getTypes
     *
     * @param id ID of topolog template uplodaed (required)
     * @param kindOfType the type we are looking for e.g. capability_types,
     * artifact_types. etc. (optional)
     * @param hasInterfaces filter if has interfaces (optional)
     * @param typeName The type_name (optional)
     * @param hasProperties filter if has properties (optional)
     * @param hasAttributes filter if has attributes (optional)
     * @param hasRequirements filter if has requirements (optional)
     * @param hasCapabilities filter if has capabilities (optional)
     * @param hasArtifacts filter if has artifacts (optional)
     * @param derivedFrom derived from (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 getTypesCall(String id, String kindOfType, Boolean hasInterfaces, String typeName, Boolean hasProperties, Boolean hasAttributes, Boolean hasRequirements, Boolean hasCapabilities, Boolean hasArtifacts, String derivedFrom, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/types"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (kindOfType != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("kind_of_type", kindOfType));
        }
        if (hasInterfaces != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_interfaces", hasInterfaces));
        }
        if (typeName != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("type_name", typeName));
        }
        if (hasProperties != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_properties", hasProperties));
        }
        if (hasAttributes != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_attributes", hasAttributes));
        }
        if (hasRequirements != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_requirements", hasRequirements));
        }
        if (hasCapabilities != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_capabilities", hasCapabilities));
        }
        if (hasArtifacts != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("has_artifacts", hasArtifacts));
        }
        if (derivedFrom != null) {
            localVarQueryParams.addAll(apiClient.parameterToPair("derived_from", derivedFrom));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();

        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/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 getTypesValidateBeforeCall(String id, String kindOfType, Boolean hasInterfaces, String typeName, Boolean hasProperties, Boolean hasAttributes, Boolean hasRequirements, Boolean hasCapabilities, Boolean hasArtifacts, String derivedFrom, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling getTypes(Async)");
        }

        com.squareup.okhttp.Call call = getTypesCall(id, kindOfType, hasInterfaces, typeName, hasProperties, hasAttributes, hasRequirements, hasCapabilities, hasArtifacts, derivedFrom, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @param kindOfType the type we are looking for e.g. capability_types,
     * artifact_types. etc. (optional)
     * @param hasInterfaces filter if has interfaces (optional)
     * @param typeName The type_name (optional)
     * @param hasProperties filter if has properties (optional)
     * @param hasAttributes filter if has attributes (optional)
     * @param hasRequirements filter if has requirements (optional)
     * @param hasCapabilities filter if has capabilities (optional)
     * @param hasArtifacts filter if has artifacts (optional)
     * @param derivedFrom derived from (optional)
     * @return List&lt;Map&lt;String, Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public List<Map<String, Object>> getTypes(String id, String kindOfType, Boolean hasInterfaces, String typeName, Boolean hasProperties, Boolean hasAttributes, Boolean hasRequirements, Boolean hasCapabilities, Boolean hasArtifacts, String derivedFrom) throws ApiException {
        ApiResponse<List<Map<String, Object>>> resp = getTypesWithHttpInfo(id, kindOfType, hasInterfaces, typeName, hasProperties, hasAttributes, hasRequirements, hasCapabilities, hasArtifacts, derivedFrom);
        return resp.getData();
    }

    /**
     *
     * returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @param kindOfType the type we are looking for e.g. capability_types,
     * artifact_types. etc. (optional)
     * @param hasInterfaces filter if has interfaces (optional)
     * @param typeName The type_name (optional)
     * @param hasProperties filter if has properties (optional)
     * @param hasAttributes filter if has attributes (optional)
     * @param hasRequirements filter if has requirements (optional)
     * @param hasCapabilities filter if has capabilities (optional)
     * @param hasArtifacts filter if has artifacts (optional)
     * @param derivedFrom derived from (optional)
     * @return ApiResponse&lt;List&lt;Map&lt;String, Object&gt;&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<List<Map<String, Object>>> getTypesWithHttpInfo(String id, String kindOfType, Boolean hasInterfaces, String typeName, Boolean hasProperties, Boolean hasAttributes, Boolean hasRequirements, Boolean hasCapabilities, Boolean hasArtifacts, String derivedFrom) throws ApiException {
        com.squareup.okhttp.Call call = getTypesValidateBeforeCall(id, kindOfType, hasInterfaces, typeName, hasProperties, hasAttributes, hasRequirements, hasCapabilities, hasArtifacts, derivedFrom, null, null);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) returns the interface types
     *
     * @param id ID of topolog template uplodaed (required)
     * @param kindOfType the type we are looking for e.g. capability_types,
     * artifact_types. etc. (optional)
     * @param hasInterfaces filter if has interfaces (optional)
     * @param typeName The type_name (optional)
     * @param hasProperties filter if has properties (optional)
     * @param hasAttributes filter if has attributes (optional)
     * @param hasRequirements filter if has requirements (optional)
     * @param hasCapabilities filter if has capabilities (optional)
     * @param hasArtifacts filter if has artifacts (optional)
     * @param derivedFrom derived from (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 getTypesAsync(String id, String kindOfType, Boolean hasInterfaces, String typeName, Boolean hasProperties, Boolean hasAttributes, Boolean hasRequirements, Boolean hasCapabilities, Boolean hasArtifacts, String derivedFrom, final ApiCallback<List<Map<String, Object>>> 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 = getTypesValidateBeforeCall(id, kindOfType, hasInterfaces, typeName, hasProperties, hasAttributes, hasRequirements, hasCapabilities, hasArtifacts, derivedFrom, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Map<String, Object>>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for setNodeProperties
     *
     * @param id ID of topolog template uplodaed (required)
     * @param properties (required)
     * @param nodeName node_name (required)
     * @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 setNodePropertiesCall(String id, Object properties, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = properties;

        // create path and map variables
        String localVarPath = "/tosca_template/{id}/topology_template/node_templates/{node_name}/properties"
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
                .replaceAll("\\{" + "node_name" + "\\}", apiClient.escapeString(nodeName.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"
        };
        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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call setNodePropertiesValidateBeforeCall(String id, Object properties, String nodeName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'id' is set
        if (id == null) {
            throw new ApiException("Missing the required parameter 'id' when calling setNodeProperties(Async)");
        }

        // verify the required parameter 'properties' is set
        if (properties == null) {
            throw new ApiException("Missing the required parameter 'properties' when calling setNodeProperties(Async)");
        }

        // verify the required parameter 'nodeName' is set
        if (nodeName == null) {
            throw new ApiException("Missing the required parameter 'nodeName' when calling setNodeProperties(Async)");
        }

        com.squareup.okhttp.Call call = setNodePropertiesCall(id, properties, nodeName, progressListener, progressRequestListener);
        return call;

    }

    /**
     *
     * s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param properties (required)
     * @param nodeName node_name (required)
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public String setNodeProperties(String id, Object properties, String nodeName) throws ApiException {
        ApiResponse<String> resp = setNodePropertiesWithHttpInfo(id, properties, nodeName);
        return resp.getData();
    }

    /**
     *
     * s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param properties (required)
     * @param nodeName node_name (required)
     * @return ApiResponse&lt;String&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<String> setNodePropertiesWithHttpInfo(String id, Object properties, String nodeName) throws ApiException {
        com.squareup.okhttp.Call call = setNodePropertiesValidateBeforeCall(id, properties, nodeName, null, null);
        Type localVarReturnType = new TypeToken<String>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * (asynchronously) s
     *
     * @param id ID of topolog template uplodaed (required)
     * @param properties (required)
     * @param nodeName node_name (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
     */
    public com.squareup.okhttp.Call setNodePropertiesAsync(String id, Object properties, String nodeName, final ApiCallback<String> 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 = setNodePropertiesValidateBeforeCall(id, properties, nodeName, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<String>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /**
     * Build call for uploadToscaTemplate
     *
     * @param file tosca Template description (required)
     * @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 uploadToscaTemplateCall(File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/tosca_template";

        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>();
        if (file != null) {
            localVarFormParams.put("file", file);
        }

        final String[] localVarAccepts = {};
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "multipart/form-data"
        };
        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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call uploadToscaTemplateValidateBeforeCall(File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {

        // verify the required parameter 'file' is set
        if (file == null) {
            throw new ApiException("Missing the required parameter 'file' when calling uploadToscaTemplate(Async)");
        }

        com.squareup.okhttp.Call call = uploadToscaTemplateCall(file, progressListener, progressRequestListener);
        return call;

    }

    /**
     * upload a tosca template description file upload and validate a tosca
     * template description file
     *
     * @param file tosca Template description (required)
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public String uploadToscaTemplate(File file) throws ApiException {
        ApiResponse<String> resp = uploadToscaTemplateWithHttpInfo(file);
        return resp.getData();
    }

    /**
     * upload a tosca template description file upload and validate a tosca
     * template description file
     *
     * @param file tosca Template description (required)
     * @return ApiResponse&lt;String&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot
     * deserialize the response body
     */
    public ApiResponse<String> uploadToscaTemplateWithHttpInfo(File file) throws ApiException {
        com.squareup.okhttp.Call call = uploadToscaTemplateValidateBeforeCall(file, null, null);
        Type localVarReturnType = new TypeToken<String>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * upload a tosca template description file (asynchronously) upload and
     * validate a tosca template description file
     *
     * @param file tosca Template description (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
     */
    public com.squareup.okhttp.Call uploadToscaTemplateAsync(File file, final ApiCallback<String> 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 = uploadToscaTemplateValidateBeforeCall(file, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<String>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}
