io.swagger.client.api.BioentityApi.java Source code

Java tutorial

Introduction

Here is the source code for io.swagger.client.api.BioentityApi.java

Source

/**
 * BioLink API
 * API integration layer for linked biological objects.   __Source:__ https://github.com/monarch-initiative/biolink-api/
 *
 * OpenAPI spec version: 0.1
 * 
 *
 * 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.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.swagger.client.api;

import io.swagger.client.ApiCallback;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.ProgressRequestBody;
import io.swagger.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;

import io.swagger.client.model.Allele;
import io.swagger.client.model.Association;
import io.swagger.client.model.AssociationResults;
import io.swagger.client.model.Gene;
import io.swagger.client.model.BioObject;
import io.swagger.client.model.Genotype;
import io.swagger.client.model.NamedObject;
import io.swagger.client.model.Substance;

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

public class BioentityApi {
    private ApiClient apiClient;

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /* Build call for getAlleleObject */
    private com.squareup.okhttp.Call getAlleleObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns allele object
     * This is a composition of multiple smaller operations, including fetching allele metadata, plus allele associations  TODO - should allele be subsumed into variant?
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Allele&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Allele> getAlleleObject(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Allele>> resp = getAlleleObjectWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns allele object
     * This is a composition of multiple smaller operations, including fetching allele metadata, plus allele associations  TODO - should allele be subsumed into variant?
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Allele&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Allele>> getAlleleObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getAlleleObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Allele>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns allele object (asynchronously)
     * This is a composition of multiple smaller operations, including fetching allele metadata, plus allele associations  TODO - should allele be subsumed into variant?
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getAlleleObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Allele>> 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 = getAlleleObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Allele>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getAnatomyGeneAssociations */
    private com.squareup.okhttp.Call getAnatomyGeneAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/anatomy/{id}/genes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associations between anatomical entity and genes
     * Typically encompasses genes expressed in a particular location.
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getAnatomyGeneAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getAnatomyGeneAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associations between anatomical entity and genes
     * Typically encompasses genes expressed in a particular location.
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getAnatomyGeneAssociationsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getAnatomyGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associations between anatomical entity and genes (asynchronously)
     * Typically encompasses genes expressed in a particular location.
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getAnatomyGeneAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Association>> 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 = getAnatomyGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getAnatomyObject */
    private com.squareup.okhttp.Call getAnatomyObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns anatomical entity
     * Anatomical entities span ranges from the subcellular (e.g. nucleus) through cells to tissues, organs and organ systems.
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getAnatomyObject(String id, Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions,
            Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        getAnatomyObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns anatomical entity
     * Anatomical entities span ranges from the subcellular (e.g. nucleus) through cells to tissues, organs and organ systems.
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getAnatomyObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getAnatomyObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns anatomical entity (asynchronously)
     * Anatomical entities span ranges from the subcellular (e.g. nucleus) through cells to tissues, organs and organ systems.
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getAnatomyObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getAnatomyObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getAnatomyPhenotypeAssociations */
    private com.squareup.okhttp.Call getAnatomyPhenotypeAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/anatomy/{id}/phenotypes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associations between anatomical entity and phenotypes
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getAnatomyPhenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getAnatomyPhenotypeAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associations between anatomical entity and phenotypes
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getAnatomyPhenotypeAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getAnatomyPhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associations between anatomical entity and phenotypes (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getAnatomyPhenotypeAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getAnatomyPhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getDiseaseAnatomyAssociations */
    private com.squareup.okhttp.Call getDiseaseAnatomyAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/disease/{id}/anatomy/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns anatomical locations associated with a disease
     * For example, neurodegeneratibe disease located in nervous system. For cancer, this may include both site of original and end location.
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getDiseaseAnatomyAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getDiseaseAnatomyAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns anatomical locations associated with a disease
     * For example, neurodegeneratibe disease located in nervous system. For cancer, this may include both site of original and end location.
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getDiseaseAnatomyAssociationsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getDiseaseAnatomyAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns anatomical locations associated with a disease (asynchronously)
     * For example, neurodegeneratibe disease located in nervous system. For cancer, this may include both site of original and end location.
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getDiseaseAnatomyAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getDiseaseAnatomyAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getDiseaseFunctionAssociations */
    private com.squareup.okhttp.Call getDiseaseFunctionAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/disease/{id}/function/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns biological functions associated with a disease
     * This may come from a combination of asserted knowledge (e.g. Fanconi Anemia affects DNA repair) or from data-driven approach (cf Translator)  Results are typically represented as GO classes
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getDiseaseFunctionAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getDiseaseFunctionAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns biological functions associated with a disease
     * This may come from a combination of asserted knowledge (e.g. Fanconi Anemia affects DNA repair) or from data-driven approach (cf Translator)  Results are typically represented as GO classes
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getDiseaseFunctionAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getDiseaseFunctionAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns biological functions associated with a disease (asynchronously)
     * This may come from a combination of asserted knowledge (e.g. Fanconi Anemia affects DNA repair) or from data-driven approach (cf Translator)  Results are typically represented as GO classes
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getDiseaseFunctionAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getDiseaseFunctionAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getDiseaseGeneAssociations */
    private com.squareup.okhttp.Call getDiseaseGeneAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/disease/{id}/genes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns genes associated with a disease
     * 
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getDiseaseGeneAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getDiseaseGeneAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns genes associated with a disease
     * 
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getDiseaseGeneAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getDiseaseGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns genes associated with a disease (asynchronously)
     * 
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getDiseaseGeneAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<AssociationResults>> 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 = getDiseaseGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getDiseaseModelAssociations */
    private com.squareup.okhttp.Call getDiseaseModelAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/disease/{id}/models/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns associations to models of the disease
     * In the association object returned, the subject will be the disease, and the object will be the model. The model may be a gene or genetic element.  If the query disease is a general class, the association subject may be to a specific disease.  In some cases the association will be *direct*, for example if a paper asserts a genotype is a model of a disease.  In other cases, the association will be *indirect*, for example, chaining over orthology. In these cases the chain will be reflected in the *evidence graph*  * TODO: provide hook into owlsim for dynamic computation of models by similarity
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getDiseaseModelAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getDiseaseModelAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns associations to models of the disease
     * In the association object returned, the subject will be the disease, and the object will be the model. The model may be a gene or genetic element.  If the query disease is a general class, the association subject may be to a specific disease.  In some cases the association will be *direct*, for example if a paper asserts a genotype is a model of a disease.  In other cases, the association will be *indirect*, for example, chaining over orthology. In these cases the chain will be reflected in the *evidence graph*  * TODO: provide hook into owlsim for dynamic computation of models by similarity
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getDiseaseModelAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getDiseaseModelAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns associations to models of the disease (asynchronously)
     * In the association object returned, the subject will be the disease, and the object will be the model. The model may be a gene or genetic element.  If the query disease is a general class, the association subject may be to a specific disease.  In some cases the association will be *direct*, for example if a paper asserts a genotype is a model of a disease.  In other cases, the association will be *indirect*, for example, chaining over orthology. In these cases the chain will be reflected in the *evidence graph*  * TODO: provide hook into owlsim for dynamic computation of models by similarity
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getDiseaseModelAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<AssociationResults>> 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 = getDiseaseModelAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getDiseaseModelTaxonAssociations */
    private com.squareup.okhttp.Call getDiseaseModelTaxonAssociationsCall(String taxon, String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        // create path and map variables
        String localVarPath = "/bioentity/disease/{id}/models/{taxon}".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "taxon" + "\\}", apiClient.escapeString(taxon.toString()))
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Same as &#x60;/disease/&lt;id&gt;/models&#x60; but constrain models by taxon
     * 
     * @param taxon CURIE of organism taxonomy class to constrain models, e.g NCBITaxon:6239 (C elegans).   Higher level taxa may be used (required)
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getDiseaseModelTaxonAssociations(String taxon, String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getDiseaseModelTaxonAssociationsWithHttpInfo(taxon, id,
                fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Same as &#x60;/disease/&lt;id&gt;/models&#x60; but constrain models by taxon
     * 
     * @param taxon CURIE of organism taxonomy class to constrain models, e.g NCBITaxon:6239 (C elegans).   Higher level taxa may be used (required)
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getDiseaseModelTaxonAssociationsWithHttpInfo(String taxon,
            String id, Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions,
            Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getDiseaseModelTaxonAssociationsCall(taxon, id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Same as &#x60;/disease/&lt;id&gt;/models&#x60; but constrain models by taxon (asynchronously)
     * 
     * @param taxon CURIE of organism taxonomy class to constrain models, e.g NCBITaxon:6239 (C elegans).   Higher level taxa may be used (required)
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getDiseaseModelTaxonAssociationsAsync(String taxon, String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<AssociationResults>> 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 = getDiseaseModelTaxonAssociationsCall(taxon, id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getDiseaseObject */
    private com.squareup.okhttp.Call getDiseaseObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns disease object
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getDiseaseObject(String id, Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions,
            Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        getDiseaseObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns disease object
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getDiseaseObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getDiseaseObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns disease object (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getDiseaseObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getDiseaseObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getDiseasePhenotypeAssociations */
    private com.squareup.okhttp.Call getDiseasePhenotypeAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/disease/{id}/phenotypes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns phenotypes associated with disease
     * 
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getDiseasePhenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getDiseasePhenotypeAssociationsWithHttpInfo(id, fetchObjects,
                rows, excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns phenotypes associated with disease
     * 
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getDiseasePhenotypeAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getDiseasePhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns phenotypes associated with disease (asynchronously)
     * 
     * @param id CURIE identifier of disease, e.g. OMIM:605543, DOID:678. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getDiseasePhenotypeAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<AssociationResults>> 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 = getDiseasePhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getDiseaseSubstanceAssociations */
    private com.squareup.okhttp.Call getDiseaseSubstanceAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/disease/{id}/substance/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns substances associated with a disease
     * e.g. drugs or small molecules used to treat
     * @param id CURIE identifier of disease, e.g. DOID:2841 (asthma). Equivalent IDs not yet supported (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getDiseaseSubstanceAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        getDiseaseSubstanceAssociationsWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations);
    }

    /**
     * Returns substances associated with a disease
     * e.g. drugs or small molecules used to treat
     * @param id CURIE identifier of disease, e.g. DOID:2841 (asthma). Equivalent IDs not yet supported (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getDiseaseSubstanceAssociationsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getDiseaseSubstanceAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * Returns substances associated with a disease (asynchronously)
     * e.g. drugs or small molecules used to treat
     * @param id CURIE identifier of disease, e.g. DOID:2841 (asthma). Equivalent IDs not yet supported (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getDiseaseSubstanceAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<Void> 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 = getDiseaseSubstanceAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getDiseaseSubstanceAssociations_0 */
    private com.squareup.okhttp.Call getDiseaseSubstanceAssociations_0Call(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/substance/{id}/treats/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns substances associated with a disease
     * e.g. drugs or small molecules used to treat
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getDiseaseSubstanceAssociations_0(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        getDiseaseSubstanceAssociations_0WithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations);
    }

    /**
     * Returns substances associated with a disease
     * e.g. drugs or small molecules used to treat
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getDiseaseSubstanceAssociations_0WithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getDiseaseSubstanceAssociations_0Call(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * Returns substances associated with a disease (asynchronously)
     * e.g. drugs or small molecules used to treat
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getDiseaseSubstanceAssociations_0Async(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<Void> 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 = getDiseaseSubstanceAssociations_0Call(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getEnvironmentObject */
    private com.squareup.okhttp.Call getEnvironmentObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns environment entity
     * TODO consider renaming exposure
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getEnvironmentObject(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        getEnvironmentObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns environment entity
     * TODO consider renaming exposure
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getEnvironmentObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getEnvironmentObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns environment entity (asynchronously)
     * TODO consider renaming exposure
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getEnvironmentObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getEnvironmentObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getEnvironmentPhenotypeAssociations */
    private com.squareup.okhttp.Call getEnvironmentPhenotypeAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/environment/{id}/phenotypes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns list of associations
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getEnvironmentPhenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getEnvironmentPhenotypeAssociationsWithHttpInfo(id, fetchObjects,
                rows, excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns list of associations
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getEnvironmentPhenotypeAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getEnvironmentPhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns list of associations (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getEnvironmentPhenotypeAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getEnvironmentPhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGeneExpressionAssociations */
    private com.squareup.okhttp.Call getGeneExpressionAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/gene/{id}/expressed/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns expression events for a gene
     * 
     * @param id CURIE identifier of gene, e.g. NCBIGene:4750. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getGeneExpressionAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getGeneExpressionAssociationsWithHttpInfo(id, fetchObjects,
                rows, excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns expression events for a gene
     * 
     * @param id CURIE identifier of gene, e.g. NCBIGene:4750. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getGeneExpressionAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGeneExpressionAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns expression events for a gene (asynchronously)
     * 
     * @param id CURIE identifier of gene, e.g. NCBIGene:4750. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGeneExpressionAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<AssociationResults>> 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 = getGeneExpressionAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGeneFunctionAssociations */
    private com.squareup.okhttp.Call getGeneFunctionAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, String type, String homologTaxon, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/gene/{id}/function/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (type != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));
        if (homologTaxon != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "homolog_taxon", homologTaxon));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns function associations for a gene
     * Note: currently this is implemented as a query to the GO solr instance. A smaller set of identifiers may be supported:   - ZFIN e.g. ZFIN:ZDB-GENE-050417-357  - MGI e.g. MGI:1342287  - Use UniProt for human (TODO: map this)
     * @param id id, e.g. NCBIGene:3630. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param type P, O or LDO (paralog, ortholog or least-diverged). (optional)
     * @param homologTaxon Taxon CURIE of homolog, e.g. NCBITaxon:9606. Can be intermediate note, includes inferred by default (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getGeneFunctionAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, String type, String homologTaxon, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getGeneFunctionAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, type, homologTaxon, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns function associations for a gene
     * Note: currently this is implemented as a query to the GO solr instance. A smaller set of identifiers may be supported:   - ZFIN e.g. ZFIN:ZDB-GENE-050417-357  - MGI e.g. MGI:1342287  - Use UniProt for human (TODO: map this)
     * @param id id, e.g. NCBIGene:3630. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param type P, O or LDO (paralog, ortholog or least-diverged). (optional)
     * @param homologTaxon Taxon CURIE of homolog, e.g. NCBITaxon:9606. Can be intermediate note, includes inferred by default (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getGeneFunctionAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, String type,
            String homologTaxon, Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGeneFunctionAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, type, homologTaxon, unselectEvidence, useCompactAssociations, null,
                null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns function associations for a gene (asynchronously)
     * Note: currently this is implemented as a query to the GO solr instance. A smaller set of identifiers may be supported:   - ZFIN e.g. ZFIN:ZDB-GENE-050417-357  - MGI e.g. MGI:1342287  - Use UniProt for human (TODO: map this)
     * @param id id, e.g. NCBIGene:3630. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param type P, O or LDO (paralog, ortholog or least-diverged). (optional)
     * @param homologTaxon Taxon CURIE of homolog, e.g. NCBITaxon:9606. Can be intermediate note, includes inferred by default (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGeneFunctionAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, String type, String homologTaxon, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<AssociationResults>> 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 = getGeneFunctionAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, type, homologTaxon, unselectEvidence, useCompactAssociations,
                progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGeneHomologAssociations */
    private com.squareup.okhttp.Call getGeneHomologAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, String type, String homologTaxon, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/gene/{id}/homologs/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (type != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type));
        if (homologTaxon != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "homolog_taxon", homologTaxon));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns homologs for a gene
     * 
     * @param id id, e.g. NCBIGene:3630. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param type P, O or LDO (paralog, ortholog or least-diverged). (optional)
     * @param homologTaxon Taxon CURIE of homolog, e.g. NCBITaxon:9606. Can be intermediate note, includes inferred by default (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getGeneHomologAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, String type, String homologTaxon, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getGeneHomologAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, type, homologTaxon, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns homologs for a gene
     * 
     * @param id id, e.g. NCBIGene:3630. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param type P, O or LDO (paralog, ortholog or least-diverged). (optional)
     * @param homologTaxon Taxon CURIE of homolog, e.g. NCBITaxon:9606. Can be intermediate note, includes inferred by default (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getGeneHomologAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, String type,
            String homologTaxon, Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGeneHomologAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, type, homologTaxon, unselectEvidence, useCompactAssociations, null,
                null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns homologs for a gene (asynchronously)
     * 
     * @param id id, e.g. NCBIGene:3630. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param type P, O or LDO (paralog, ortholog or least-diverged). (optional)
     * @param homologTaxon Taxon CURIE of homolog, e.g. NCBITaxon:9606. Can be intermediate note, includes inferred by default (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGeneHomologAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, String type, String homologTaxon, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<AssociationResults>> 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 = getGeneHomologAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, type, homologTaxon, unselectEvidence, useCompactAssociations,
                progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGeneInteractions */
    private com.squareup.okhttp.Call getGeneInteractionsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/gene/{id}/interactions/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns interactions for a gene
     * 
     * @param id id, e.g. NCBIGene:3630. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getGeneInteractions(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getGeneInteractionsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns interactions for a gene
     * 
     * @param id id, e.g. NCBIGene:3630. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getGeneInteractionsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGeneInteractionsCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns interactions for a gene (asynchronously)
     * 
     * @param id id, e.g. NCBIGene:3630. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGeneInteractionsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<AssociationResults>> 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 = getGeneInteractionsCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGeneObject */
    private com.squareup.okhttp.Call getGeneObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns gene object
     * 
     * @param id id, e.g. NCBIGene:84570 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Gene&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Gene> getGeneObject(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Gene>> resp = getGeneObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns gene object
     * 
     * @param id id, e.g. NCBIGene:84570 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Gene&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Gene>> getGeneObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getGeneObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Gene>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns gene object (asynchronously)
     * 
     * @param id id, e.g. NCBIGene:84570 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGeneObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Gene>> 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 = getGeneObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Gene>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGenePhenotypeAssociations */
    private com.squareup.okhttp.Call getGenePhenotypeAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/gene/{id}/phenotypes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns phenotypes associated with gene
     * 
     * @param id CURIE identifier of gene, e.g. NCBIGene:4750. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getGenePhenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        getGenePhenotypeAssociationsWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations);
    }

    /**
     * Returns phenotypes associated with gene
     * 
     * @param id CURIE identifier of gene, e.g. NCBIGene:4750. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getGenePhenotypeAssociationsWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getGenePhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * Returns phenotypes associated with gene (asynchronously)
     * 
     * @param id CURIE identifier of gene, e.g. NCBIGene:4750. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGenePhenotypeAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getGenePhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getGenePublicationList */
    private com.squareup.okhttp.Call getGenePublicationListCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/gene/{id}/pubs/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns expression events for a gene
     * 
     * @param id CURIE identifier of gene, e.g. NCBIGene:4750. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getGenePublicationList(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getGenePublicationListWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns expression events for a gene
     * 
     * @param id CURIE identifier of gene, e.g. NCBIGene:4750. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getGenePublicationListWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGenePublicationListCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns expression events for a gene (asynchronously)
     * 
     * @param id CURIE identifier of gene, e.g. NCBIGene:4750. Equivalent IDs can be used with same results (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGenePublicationListAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<AssociationResults>> 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 = getGenePublicationListCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGeneproductObject */
    private com.squareup.okhttp.Call getGeneproductObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns gene product object
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getGeneproductObject(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        getGeneproductObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns gene product object
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getGeneproductObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getGeneproductObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns gene product object (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGeneproductObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getGeneproductObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getGenericAssociations */
    private com.squareup.okhttp.Call getGenericAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns associations for an entity regardless of the type
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getGenericAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getGenericAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns associations for an entity regardless of the type
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getGenericAssociationsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGenericAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns associations for an entity regardless of the type (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGenericAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<AssociationResults>> 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 = getGenericAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGenericObject */
    private com.squareup.okhttp.Call getGenericObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns object of any type
     * 
     * @param id id, e.g. NCBIGene:84570 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;BioObject&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<BioObject> getGenericObject(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<BioObject>> resp = getGenericObjectWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns object of any type
     * 
     * @param id id, e.g. NCBIGene:84570 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;BioObject&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<BioObject>> getGenericObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getGenericObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<BioObject>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns object of any type (asynchronously)
     * 
     * @param id id, e.g. NCBIGene:84570 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGenericObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<BioObject>> 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 = getGenericObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<BioObject>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGenotypeDiseaseAssociations */
    private com.squareup.okhttp.Call getGenotypeDiseaseAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/genotype/{id}/diseases/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns diseases associated with a genotype
     * 
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-4286 (if non-human will return models) (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getGenotypeDiseaseAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getGenotypeDiseaseAssociationsWithHttpInfo(id, fetchObjects,
                rows, excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns diseases associated with a genotype
     * 
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-4286 (if non-human will return models) (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getGenotypeDiseaseAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGenotypeDiseaseAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns diseases associated with a genotype (asynchronously)
     * 
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-4286 (if non-human will return models) (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGenotypeDiseaseAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<AssociationResults>> 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 = getGenotypeDiseaseAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGenotypeGeneAssociations */
    private com.squareup.okhttp.Call getGenotypeGeneAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/genotype/{id}/genes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns genes associated with a genotype
     * 
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-6607 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getGenotypeGeneAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getGenotypeGeneAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns genes associated with a genotype
     * 
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-6607 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getGenotypeGeneAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGenotypeGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns genes associated with a genotype (asynchronously)
     * 
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-6607 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGenotypeGeneAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<AssociationResults>> 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 = getGenotypeGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGenotypeGenotypeAssociations */
    private com.squareup.okhttp.Call getGenotypeGenotypeAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/genotype/{id}/genotypes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns genotypes-genotype associations
     * Genotypes may be related to one another according to the GENO model
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-6607 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getGenotypeGenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getGenotypeGenotypeAssociationsWithHttpInfo(id, fetchObjects,
                rows, excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns genotypes-genotype associations
     * Genotypes may be related to one another according to the GENO model
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-6607 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getGenotypeGenotypeAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGenotypeGenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns genotypes-genotype associations (asynchronously)
     * Genotypes may be related to one another according to the GENO model
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-6607 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGenotypeGenotypeAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<AssociationResults>> 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 = getGenotypeGenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGenotypeObject */
    private com.squareup.okhttp.Call getGenotypeObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns genotype object
     * The genotype object will have the following association sets populated:   * gene  * phenotype  * disease
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-6607 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Genotype&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Genotype> getGenotypeObject(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Genotype>> resp = getGenotypeObjectWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns genotype object
     * The genotype object will have the following association sets populated:   * gene  * phenotype  * disease
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-6607 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Genotype&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Genotype>> getGenotypeObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getGenotypeObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Genotype>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns genotype object (asynchronously)
     * The genotype object will have the following association sets populated:   * gene  * phenotype  * disease
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-6607 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGenotypeObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Genotype>> 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 = getGenotypeObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Genotype>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGenotypePhenotypeAssociations */
    private com.squareup.okhttp.Call getGenotypePhenotypeAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/genotype/{id}/phenotypes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns phenotypes associated with a genotype
     * 
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-4286 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getGenotypePhenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getGenotypePhenotypeAssociationsWithHttpInfo(id, fetchObjects,
                rows, excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns phenotypes associated with a genotype
     * 
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-4286 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getGenotypePhenotypeAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGenotypePhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns phenotypes associated with a genotype (asynchronously)
     * 
     * @param id CURIE identifier of genotype, e.g. ZFIN:ZDB-FISH-150901-4286 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGenotypePhenotypeAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<AssociationResults>> 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 = getGenotypePhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGotermGeneAssociations */
    private com.squareup.okhttp.Call getGotermGeneAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/goterm/{id}/genes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associated phenotypes
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getGotermGeneAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getGotermGeneAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associated phenotypes
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getGotermGeneAssociationsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGotermGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associated phenotypes (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGotermGeneAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Association>> 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 = getGotermGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getGotermObject */
    private com.squareup.okhttp.Call getGotermObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns GO class object
     * 
     * @param id GO class CURIE identifier, e.g GO:0016301 (kinase activity) (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getGotermObject(String id, Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions,
            Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        getGotermObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns GO class object
     * 
     * @param id GO class CURIE identifier, e.g GO:0016301 (kinase activity) (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getGotermObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getGotermObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns GO class object (asynchronously)
     * 
     * @param id GO class CURIE identifier, e.g GO:0016301 (kinase activity) (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGotermObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getGotermObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getGotermPhenotypeAssociations */
    private com.squareup.okhttp.Call getGotermPhenotypeAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/goterm/{id}/phenotype/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associated phenotypes
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getGotermPhenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getGotermPhenotypeAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associated phenotypes
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getGotermPhenotypeAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getGotermPhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associated phenotypes (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getGotermPhenotypeAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getGotermPhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getLiteratureDiseaseAssociations */
    private com.squareup.okhttp.Call getLiteratureDiseaseAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/literature/{id}/diseases/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns associations between a lit entity and a disease
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getLiteratureDiseaseAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getLiteratureDiseaseAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns associations between a lit entity and a disease
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getLiteratureDiseaseAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getLiteratureDiseaseAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns associations between a lit entity and a disease (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getLiteratureDiseaseAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getLiteratureDiseaseAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getLiteratureGeneAssociations */
    private com.squareup.okhttp.Call getLiteratureGeneAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/literature/{id}/genes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns associations between a lit entity and a gene
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getLiteratureGeneAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getLiteratureGeneAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns associations between a lit entity and a gene
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getLiteratureGeneAssociationsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getLiteratureGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns associations between a lit entity and a gene (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getLiteratureGeneAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getLiteratureGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getLiteratureGenotypeAssociations */
    private com.squareup.okhttp.Call getLiteratureGenotypeAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/literature/{id}/genotypes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns associations between a lit entity and a genotype
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getLiteratureGenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getLiteratureGenotypeAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns associations between a lit entity and a genotype
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getLiteratureGenotypeAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getLiteratureGenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns associations between a lit entity and a genotype (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getLiteratureGenotypeAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getLiteratureGenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getParentObject */
    private com.squareup.okhttp.Call getParentObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns individual
     * Individuals may typically encompass patients, but can be individuals of any species
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getParentObject(String id, Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions,
            Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        getParentObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns individual
     * Individuals may typically encompass patients, but can be individuals of any species
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getParentObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getParentObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns individual (asynchronously)
     * Individuals may typically encompass patients, but can be individuals of any species
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getParentObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getParentObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getParentObject_0 */
    private com.squareup.okhttp.Call getParentObject_0Call(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns investigation object
     * Investigations encompass clinical trials, molecular biology experiments or any kind of study
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getParentObject_0(String id, Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions,
            Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        getParentObject_0WithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns investigation object
     * Investigations encompass clinical trials, molecular biology experiments or any kind of study
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getParentObject_0WithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getParentObject_0Call(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns investigation object (asynchronously)
     * Investigations encompass clinical trials, molecular biology experiments or any kind of study
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getParentObject_0Async(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getParentObject_0Call(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getPathwayGeneAssociations */
    private com.squareup.okhttp.Call getPathwayGeneAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/pathway/{id}/genes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns list of genes associated with a pathway
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getPathwayGeneAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getPathwayGeneAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns list of genes associated with a pathway
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getPathwayGeneAssociationsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getPathwayGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns list of genes associated with a pathway (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getPathwayGeneAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Association>> 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 = getPathwayGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getPathwayObject */
    private com.squareup.okhttp.Call getPathwayObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns pathway object
     * 
     * @param id CURIE any pathway element. May be a GO ID or a pathway database ID (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getPathwayObject(String id, Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions,
            Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        getPathwayObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns pathway object
     * 
     * @param id CURIE any pathway element. May be a GO ID or a pathway database ID (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getPathwayObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getPathwayObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns pathway object (asynchronously)
     * 
     * @param id CURIE any pathway element. May be a GO ID or a pathway database ID (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getPathwayObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getPathwayObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getPathwayParticipantAssociations */
    private com.squareup.okhttp.Call getPathwayParticipantAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/pathway/{id}/participants/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associations to participants (molecules, etc) for a pathway
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getPathwayParticipantAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getPathwayParticipantAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associations to participants (molecules, etc) for a pathway
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getPathwayParticipantAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getPathwayParticipantAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associations to participants (molecules, etc) for a pathway (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getPathwayParticipantAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getPathwayParticipantAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getPhenotypeAnatomyAssociations */
    private com.squareup.okhttp.Call getPhenotypeAnatomyAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/phenotype/{id}/anatomy/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns anatomical entities associated with a phenotype
     * Example IDs:   * ZP:0004204   * MP:0008521 abnormal Bowman membrane  For example, *abnormal limb development* will map to *limb*
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;NamedObject&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<NamedObject> getPhenotypeAnatomyAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<NamedObject>> resp = getPhenotypeAnatomyAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns anatomical entities associated with a phenotype
     * Example IDs:   * ZP:0004204   * MP:0008521 abnormal Bowman membrane  For example, *abnormal limb development* will map to *limb*
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;NamedObject&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<NamedObject>> getPhenotypeAnatomyAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getPhenotypeAnatomyAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<NamedObject>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns anatomical entities associated with a phenotype (asynchronously)
     * Example IDs:   * ZP:0004204   * MP:0008521 abnormal Bowman membrane  For example, *abnormal limb development* will map to *limb*
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getPhenotypeAnatomyAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<NamedObject>> 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 = getPhenotypeAnatomyAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<NamedObject>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getPhenotypeFunctionAssociations */
    private com.squareup.okhttp.Call getPhenotypeFunctionAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/phenotype/{id}/function/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns biological functions associated with a Phenotype
     * This may come from a combination of asserted knowledge (e.g. abnormal levels of metabolite to corresponding GO activity) or from data-driven approach (cf Translator)  Results are typically represented as GO classes
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getPhenotypeFunctionAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getPhenotypeFunctionAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns biological functions associated with a Phenotype
     * This may come from a combination of asserted knowledge (e.g. abnormal levels of metabolite to corresponding GO activity) or from data-driven approach (cf Translator)  Results are typically represented as GO classes
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getPhenotypeFunctionAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getPhenotypeFunctionAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns biological functions associated with a Phenotype (asynchronously)
     * This may come from a combination of asserted knowledge (e.g. abnormal levels of metabolite to corresponding GO activity) or from data-driven approach (cf Translator)  Results are typically represented as GO classes
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getPhenotypeFunctionAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getPhenotypeFunctionAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getPhenotypeGeneAssociations */
    private com.squareup.okhttp.Call getPhenotypeGeneAssociationsCall(String taxid, String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        // create path and map variables
        String localVarPath = "/bioentity/phenotype/{id}/gene/{taxid}/ids".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "taxid" + "\\}", apiClient.escapeString(taxid.toString()))
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns gene ids for all genes for a particular phenotype in a taxon
     * For example, + NCBITaxon:10090 (mouse)
     * @param taxid Species or high level taxon grouping, e.g  NCBITaxon:10090 (Mus musculus) (required)
     * @param id Pheno class CURIE identifier, e.g  MP:0001569 (abnormal circulating bilirubin level) (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getPhenotypeGeneAssociations(String taxid, String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        getPhenotypeGeneAssociationsWithHttpInfo(taxid, id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations);
    }

    /**
     * Returns gene ids for all genes for a particular phenotype in a taxon
     * For example, + NCBITaxon:10090 (mouse)
     * @param taxid Species or high level taxon grouping, e.g  NCBITaxon:10090 (Mus musculus) (required)
     * @param id Pheno class CURIE identifier, e.g  MP:0001569 (abnormal circulating bilirubin level) (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getPhenotypeGeneAssociationsWithHttpInfo(String taxid, String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getPhenotypeGeneAssociationsCall(taxid, id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * Returns gene ids for all genes for a particular phenotype in a taxon (asynchronously)
     * For example, + NCBITaxon:10090 (mouse)
     * @param taxid Species or high level taxon grouping, e.g  NCBITaxon:10090 (Mus musculus) (required)
     * @param id Pheno class CURIE identifier, e.g  MP:0001569 (abnormal circulating bilirubin level) (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getPhenotypeGeneAssociationsAsync(String taxid, String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<Void> 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 = getPhenotypeGeneAssociationsCall(taxid, id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getPhenotypeGeneAssociations_0 */
    private com.squareup.okhttp.Call getPhenotypeGeneAssociations_0Call(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/phenotype/{id}/genes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associated phenotypes
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getPhenotypeGeneAssociations_0(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getPhenotypeGeneAssociations_0WithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associated phenotypes
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getPhenotypeGeneAssociations_0WithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getPhenotypeGeneAssociations_0Call(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associated phenotypes (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getPhenotypeGeneAssociations_0Async(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getPhenotypeGeneAssociations_0Call(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getPhenotypeObject */
    private com.squareup.okhttp.Call getPhenotypeObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns phenotype class object
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getPhenotypeObject(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        getPhenotypeObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns phenotype class object
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getPhenotypeObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getPhenotypeObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns phenotype class object (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getPhenotypeObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getPhenotypeObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getPhenotypePhenotypeAssociations */
    private com.squareup.okhttp.Call getPhenotypePhenotypeAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associated phenotypes
     * Includes phenologs, as well as equivalent phenotypes in other species
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getPhenotypePhenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getPhenotypePhenotypeAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associated phenotypes
     * Includes phenologs, as well as equivalent phenotypes in other species
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getPhenotypePhenotypeAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getPhenotypePhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associated phenotypes (asynchronously)
     * Includes phenologs, as well as equivalent phenotypes in other species
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getPhenotypePhenotypeAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getPhenotypePhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getPubObject */
    private com.squareup.okhttp.Call getPubObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns publication object
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getPubObject(String id, Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions,
            Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        getPubObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns publication object
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getPubObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getPubObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns publication object (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getPubObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getPubObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getSequenceFeatureObject */
    private com.squareup.okhttp.Call getSequenceFeatureObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns seqfeature
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getSequenceFeatureObject(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        getSequenceFeatureObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns seqfeature
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getSequenceFeatureObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getSequenceFeatureObjectCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns seqfeature (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getSequenceFeatureObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getSequenceFeatureObjectCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getSubstanceExposures */
    private com.squareup.okhttp.Call getSubstanceExposuresCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/substance/{id}/exposures/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associations between a substance and related exposures
     * E.g. between pesticide and occupational exposure class
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getSubstanceExposures(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getSubstanceExposuresWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associations between a substance and related exposures
     * E.g. between pesticide and occupational exposure class
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getSubstanceExposuresWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getSubstanceExposuresCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associations between a substance and related exposures (asynchronously)
     * E.g. between pesticide and occupational exposure class
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getSubstanceExposuresAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Association>> 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 = getSubstanceExposuresCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getSubstanceInteractions */
    private com.squareup.okhttp.Call getSubstanceInteractionsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/substance/{id}/interactions/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associations between given drug and interactions
     * Interactions can encompass drugs or environments
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getSubstanceInteractions(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getSubstanceInteractionsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associations between given drug and interactions
     * Interactions can encompass drugs or environments
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getSubstanceInteractionsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getSubstanceInteractionsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associations between given drug and interactions (asynchronously)
     * Interactions can encompass drugs or environments
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getSubstanceInteractionsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Association>> 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 = getSubstanceInteractionsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getSubstanceObject */
    private com.squareup.okhttp.Call getSubstanceObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns substance entity
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Substance&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Substance> getSubstanceObject(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Substance>> resp = getSubstanceObjectWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns substance entity
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Substance&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Substance>> getSubstanceObjectWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getSubstanceObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Substance>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns substance entity (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getSubstanceObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Substance>> 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 = getSubstanceObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Substance>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getSubstanceParticipantInAssociations */
    private com.squareup.okhttp.Call getSubstanceParticipantInAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/substance/{id}/participant_in/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns associations between an activity and process and the specified substance
     * Examples relationships:   * substance is a metabolite of a process  * substance is synthesized by a process  * substance is modified by an activity  * substance elicits a response program/pathway  * substance is transported by activity or pathway  For example, CHEBI:40036 (amitrole)
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getSubstanceParticipantInAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getSubstanceParticipantInAssociationsWithHttpInfo(id, fetchObjects,
                rows, excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns associations between an activity and process and the specified substance
     * Examples relationships:   * substance is a metabolite of a process  * substance is synthesized by a process  * substance is modified by an activity  * substance elicits a response program/pathway  * substance is transported by activity or pathway  For example, CHEBI:40036 (amitrole)
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getSubstanceParticipantInAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getSubstanceParticipantInAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns associations between an activity and process and the specified substance (asynchronously)
     * Examples relationships:   * substance is a metabolite of a process  * substance is synthesized by a process  * substance is modified by an activity  * substance elicits a response program/pathway  * substance is transported by activity or pathway  For example, CHEBI:40036 (amitrole)
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getSubstanceParticipantInAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getSubstanceParticipantInAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getSubstanceRelationships */
    private com.squareup.okhttp.Call getSubstanceRelationshipsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/substance/{id}/substances/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associations between a substance and other substances
     * E.g. metabolite-of, tautomer-of, parent-of, ...
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getSubstanceRelationships(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getSubstanceRelationshipsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associations between a substance and other substances
     * E.g. metabolite-of, tautomer-of, parent-of, ...
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getSubstanceRelationshipsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getSubstanceRelationshipsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associations between a substance and other substances (asynchronously)
     * E.g. metabolite-of, tautomer-of, parent-of, ...
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getSubstanceRelationshipsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Association>> 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 = getSubstanceRelationshipsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getSubstanceRoleAssociations */
    private com.squareup.okhttp.Call getSubstanceRoleAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/substance/{id}/roles/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns associations between given drug and roles
     * Roles may be human-oriented (e.g. pesticide) or molecular (e.g. enzyme inhibitor)
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getSubstanceRoleAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getSubstanceRoleAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns associations between given drug and roles
     * Roles may be human-oriented (e.g. pesticide) or molecular (e.g. enzyme inhibitor)
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getSubstanceRoleAssociationsWithHttpInfo(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getSubstanceRoleAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns associations between given drug and roles (asynchronously)
     * Roles may be human-oriented (e.g. pesticide) or molecular (e.g. enzyme inhibitor)
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getSubstanceRoleAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<Association>> 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 = getSubstanceRoleAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getSubstanceTargetAssociations */
    private com.squareup.okhttp.Call getSubstanceTargetAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/substance/{id}/targets/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns associations between given drug and targets
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;Association&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<Association> getSubstanceTargetAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<Association>> resp = getSubstanceTargetAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * TODO Returns associations between given drug and targets
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;Association&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<Association>> getSubstanceTargetAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getSubstanceTargetAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * TODO Returns associations between given drug and targets (asynchronously)
     * 
     * @param id  (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getSubstanceTargetAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<Association>> 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 = getSubstanceTargetAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getVariantGeneAssociations */
    private com.squareup.okhttp.Call getVariantGeneAssociationsCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/variant/{id}/genes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns genes associated with a variant
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getVariantGeneAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getVariantGeneAssociationsWithHttpInfo(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns genes associated with a variant
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getVariantGeneAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getVariantGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns genes associated with a variant (asynchronously)
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getVariantGeneAssociationsAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<List<AssociationResults>> 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 = getVariantGeneAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getVariantGenotypeAssociations */
    private com.squareup.okhttp.Call getVariantGenotypeAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/variant/{id}/genotypes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns genotypes associated with a variant
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getVariantGenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getVariantGenotypeAssociationsWithHttpInfo(id, fetchObjects,
                rows, excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns genotypes associated with a variant
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getVariantGenotypeAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getVariantGenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns genotypes associated with a variant (asynchronously)
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getVariantGenotypeAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<AssociationResults>> 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 = getVariantGenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getVariantObject */
    private com.squareup.okhttp.Call getVariantObjectCall(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * TODO Returns sequence variant entity
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void getVariantObject(String id, Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions,
            Boolean unselectEvidence, Boolean useCompactAssociations) throws ApiException {
        getVariantObjectWithHttpInfo(id, fetchObjects, rows, excludeAutomaticAssertions, unselectEvidence,
                useCompactAssociations);
    }

    /**
     * TODO Returns sequence variant entity
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<Void> getVariantObjectWithHttpInfo(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        com.squareup.okhttp.Call call = getVariantObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, null, null);
        return apiClient.execute(call);
    }

    /**
     * TODO Returns sequence variant entity (asynchronously)
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getVariantObjectAsync(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations,
            final ApiCallback<Void> 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 = getVariantObjectCall(id, fetchObjects, rows, excludeAutomaticAssertions,
                unselectEvidence, useCompactAssociations, progressListener, progressRequestListener);
        apiClient.executeAsync(call, callback);
        return call;
    }

    /* Build call for getVariantPhenotypeAssociations */
    private com.squareup.okhttp.Call getVariantPhenotypeAssociationsCall(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/bioentity/variant/{id}/phenotypes/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (fetchObjects != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fetch_objects", fetchObjects));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (excludeAutomaticAssertions != null)
            localVarQueryParams.addAll(
                    apiClient.parameterToPairs("", "exclude_automatic_assertions", excludeAutomaticAssertions));
        if (unselectEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "unselect_evidence", unselectEvidence));
        if (useCompactAssociations != null)
            localVarQueryParams
                    .addAll(apiClient.parameterToPairs("", "use_compact_associations", useCompactAssociations));

        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 = { "application/json" };
        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, localVarPostBody, localVarHeaderParams,
                localVarFormParams, localVarAuthNames, progressRequestListener);
    }

    /**
     * Returns phenotypes associated with a variant
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return List&lt;AssociationResults&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List<AssociationResults> getVariantPhenotypeAssociations(String id, Boolean fetchObjects, Integer rows,
            Boolean excludeAutomaticAssertions, Boolean unselectEvidence, Boolean useCompactAssociations)
            throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getVariantPhenotypeAssociationsWithHttpInfo(id, fetchObjects,
                rows, excludeAutomaticAssertions, unselectEvidence, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns phenotypes associated with a variant
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (optional)
     * @return ApiResponse&lt;List&lt;AssociationResults&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse<List<AssociationResults>> getVariantPhenotypeAssociationsWithHttpInfo(String id,
            Boolean fetchObjects, Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getVariantPhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns phenotypes associated with a variant (asynchronously)
     * 
     * @param id CURIE identifier of variant, e.g. ZFIN:ZDB-ALT-010427-8, ClinVarVariant:39783 (required)
     * @param fetchObjects If true, returns a distinct set of association.objects (typically ontology terms). This appears at the top level of the results payload (optional, default to true)
     * @param rows number of rows (optional, default to 20)
     * @param excludeAutomaticAssertions If set, excludes associations that involve IEAs (ECO:0000501) (optional)
     * @param unselectEvidence If set, excludes evidence objects in response (optional)
     * @param useCompactAssociations If true, returns results in compact associations format (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 getVariantPhenotypeAssociationsAsync(String id, Boolean fetchObjects,
            Integer rows, Boolean excludeAutomaticAssertions, Boolean unselectEvidence,
            Boolean useCompactAssociations, final ApiCallback<List<AssociationResults>> 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 = getVariantPhenotypeAssociationsCall(id, fetchObjects, rows,
                excludeAutomaticAssertions, unselectEvidence, useCompactAssociations, progressListener,
                progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}