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

Java tutorial

Introduction

Here is the source code for io.swagger.client.api.AssociationApi.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.Association;
import io.swagger.client.model.AssociationResults;

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

public class AssociationApi {
    private ApiClient apiClient;

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /* Build call for getAssociationObject */
    private com.squareup.okhttp.Call getAssociationObjectCall(String id, Integer rows, Boolean flExcludesEvidence,
            String evidence, Integer page, String object, String subject, String subjectTaxon, Boolean graphize,
            String mapIdentifiers, 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 getAssociationObject(Async)");
        }

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (flExcludesEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fl_excludes_evidence", flExcludesEvidence));
        if (evidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "evidence", evidence));
        if (page != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
        if (object != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "object", object));
        if (subject != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject", subject));
        if (subjectTaxon != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject_taxon", subjectTaxon));
        if (graphize != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "graphize", graphize));
        if (mapIdentifiers != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "map_identifiers", mapIdentifiers));

        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 the association with a given identifier
     * An association connects, at a minimum, two things, designated subject and object, via some relationship. Associations also include evidence, provenance etc.
     * @param id  (required)
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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> getAssociationObject(String id, Integer rows, Boolean flExcludesEvidence,
            String evidence, Integer page, String object, String subject, String subjectTaxon, Boolean graphize,
            String mapIdentifiers) throws ApiException {
        ApiResponse<List<Association>> resp = getAssociationObjectWithHttpInfo(id, rows, flExcludesEvidence,
                evidence, page, object, subject, subjectTaxon, graphize, mapIdentifiers);
        return resp.getData();
    }

    /**
     * Returns the association with a given identifier
     * An association connects, at a minimum, two things, designated subject and object, via some relationship. Associations also include evidence, provenance etc.
     * @param id  (required)
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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>> getAssociationObjectWithHttpInfo(String id, Integer rows,
            Boolean flExcludesEvidence, String evidence, Integer page, String object, String subject,
            String subjectTaxon, Boolean graphize, String mapIdentifiers) throws ApiException {
        com.squareup.okhttp.Call call = getAssociationObjectCall(id, rows, flExcludesEvidence, evidence, page,
                object, subject, subjectTaxon, graphize, mapIdentifiers, null, null);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns the association with a given identifier (asynchronously)
     * An association connects, at a minimum, two things, designated subject and object, via some relationship. Associations also include evidence, provenance etc.
     * @param id  (required)
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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 getAssociationObjectAsync(String id, Integer rows, Boolean flExcludesEvidence,
            String evidence, Integer page, String object, String subject, String subjectTaxon, Boolean graphize,
            String mapIdentifiers, 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 = getAssociationObjectCall(id, rows, flExcludesEvidence, evidence, page,
                object, subject, subjectTaxon, graphize, mapIdentifiers, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<Association>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getAssociationSearch */
    private com.squareup.okhttp.Call getAssociationSearchCall(Integer rows, Boolean flExcludesEvidence,
            String evidence, Integer page, String object, String subject, String subjectTaxon, Boolean graphize,
            String mapIdentifiers, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/association/find/".replaceAll("\\{format\\}", "json");

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (flExcludesEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fl_excludes_evidence", flExcludesEvidence));
        if (evidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "evidence", evidence));
        if (page != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
        if (object != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "object", object));
        if (subject != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject", subject));
        if (subjectTaxon != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject_taxon", subjectTaxon));
        if (graphize != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "graphize", graphize));
        if (mapIdentifiers != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "map_identifiers", mapIdentifiers));

        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 list of matching associations
     * 
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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> getAssociationSearch(Integer rows, Boolean flExcludesEvidence, String evidence,
            Integer page, String object, String subject, String subjectTaxon, Boolean graphize,
            String mapIdentifiers) throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getAssociationSearchWithHttpInfo(rows, flExcludesEvidence,
                evidence, page, object, subject, subjectTaxon, graphize, mapIdentifiers);
        return resp.getData();
    }

    /**
     * Returns list of matching associations
     * 
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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>> getAssociationSearchWithHttpInfo(Integer rows,
            Boolean flExcludesEvidence, String evidence, Integer page, String object, String subject,
            String subjectTaxon, Boolean graphize, String mapIdentifiers) throws ApiException {
        com.squareup.okhttp.Call call = getAssociationSearchCall(rows, flExcludesEvidence, evidence, page, object,
                subject, subjectTaxon, graphize, mapIdentifiers, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns list of matching associations (asynchronously)
     * 
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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 getAssociationSearchAsync(Integer rows, Boolean flExcludesEvidence,
            String evidence, Integer page, String object, String subject, String subjectTaxon, Boolean graphize,
            String mapIdentifiers, 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 = getAssociationSearchCall(rows, flExcludesEvidence, evidence, page, object,
                subject, subjectTaxon, graphize, mapIdentifiers, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getAssociationSearch_0 */
    private com.squareup.okhttp.Call getAssociationSearch_0Call(String objectCategory, String subjectCategory,
            Integer rows, Boolean flExcludesEvidence, String evidence, Integer page, String object, String subject,
            String subjectTaxon, Boolean graphize, String mapIdentifiers,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        // create path and map variables
        String localVarPath = "/association/find/{subject_category}/".replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "object_category" + "\\}", apiClient.escapeString(objectCategory.toString()))
                .replaceAll("\\{" + "subject_category" + "\\}", apiClient.escapeString(subjectCategory.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (flExcludesEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fl_excludes_evidence", flExcludesEvidence));
        if (evidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "evidence", evidence));
        if (page != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
        if (object != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "object", object));
        if (subject != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject", subject));
        if (subjectTaxon != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject_taxon", subjectTaxon));
        if (graphize != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "graphize", graphize));
        if (mapIdentifiers != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "map_identifiers", mapIdentifiers));

        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 list of matching associations
     * 
     * @param objectCategory CATEGORY of entity at link OBJECT (target), e.g. phenotype, disease (required)
     * @param subjectCategory CATEGORY of entity at link SUBJECT (source), e.g. gene, disease, genotype (required)
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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> getAssociationSearch_0(String objectCategory, String subjectCategory,
            Integer rows, Boolean flExcludesEvidence, String evidence, Integer page, String object, String subject,
            String subjectTaxon, Boolean graphize, String mapIdentifiers) throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getAssociationSearch_0WithHttpInfo(objectCategory,
                subjectCategory, rows, flExcludesEvidence, evidence, page, object, subject, subjectTaxon, graphize,
                mapIdentifiers);
        return resp.getData();
    }

    /**
     * Returns list of matching associations
     * 
     * @param objectCategory CATEGORY of entity at link OBJECT (target), e.g. phenotype, disease (required)
     * @param subjectCategory CATEGORY of entity at link SUBJECT (source), e.g. gene, disease, genotype (required)
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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>> getAssociationSearch_0WithHttpInfo(String objectCategory,
            String subjectCategory, Integer rows, Boolean flExcludesEvidence, String evidence, Integer page,
            String object, String subject, String subjectTaxon, Boolean graphize, String mapIdentifiers)
            throws ApiException {
        com.squareup.okhttp.Call call = getAssociationSearch_0Call(objectCategory, subjectCategory, rows,
                flExcludesEvidence, evidence, page, object, subject, subjectTaxon, graphize, mapIdentifiers, null,
                null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns list of matching associations (asynchronously)
     * 
     * @param objectCategory CATEGORY of entity at link OBJECT (target), e.g. phenotype, disease (required)
     * @param subjectCategory CATEGORY of entity at link SUBJECT (source), e.g. gene, disease, genotype (required)
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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 getAssociationSearch_0Async(String objectCategory, String subjectCategory,
            Integer rows, Boolean flExcludesEvidence, String evidence, Integer page, String object, String subject,
            String subjectTaxon, Boolean graphize, String mapIdentifiers,
            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 = getAssociationSearch_0Call(objectCategory, subjectCategory, rows,
                flExcludesEvidence, evidence, page, object, subject, subjectTaxon, graphize, mapIdentifiers,
                progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getAssociationSearch_1 */
    private com.squareup.okhttp.Call getAssociationSearch_1Call(String objectCategory, String subjectCategory,
            Integer rows, Boolean flExcludesEvidence, String evidence, Integer page, String object, String subject,
            String subjectTaxon, Boolean graphize, String mapIdentifiers,
            final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        // create path and map variables
        String localVarPath = "/association/find/{subject_category}/{object_category}/"
                .replaceAll("\\{format\\}", "json")
                .replaceAll("\\{" + "object_category" + "\\}", apiClient.escapeString(objectCategory.toString()))
                .replaceAll("\\{" + "subject_category" + "\\}", apiClient.escapeString(subjectCategory.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        if (flExcludesEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fl_excludes_evidence", flExcludesEvidence));
        if (evidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "evidence", evidence));
        if (page != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
        if (object != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "object", object));
        if (subject != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject", subject));
        if (subjectTaxon != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject_taxon", subjectTaxon));
        if (graphize != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "graphize", graphize));
        if (mapIdentifiers != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "map_identifiers", mapIdentifiers));

        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 list of matching associations
     * 
     * @param objectCategory CATEGORY of entity at link OBJECT (target), e.g. phenotype, disease (required)
     * @param subjectCategory CATEGORY of entity at link SUBJECT (source), e.g. gene, disease, genotype (required)
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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> getAssociationSearch_1(String objectCategory, String subjectCategory,
            Integer rows, Boolean flExcludesEvidence, String evidence, Integer page, String object, String subject,
            String subjectTaxon, Boolean graphize, String mapIdentifiers) throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getAssociationSearch_1WithHttpInfo(objectCategory,
                subjectCategory, rows, flExcludesEvidence, evidence, page, object, subject, subjectTaxon, graphize,
                mapIdentifiers);
        return resp.getData();
    }

    /**
     * Returns list of matching associations
     * 
     * @param objectCategory CATEGORY of entity at link OBJECT (target), e.g. phenotype, disease (required)
     * @param subjectCategory CATEGORY of entity at link SUBJECT (source), e.g. gene, disease, genotype (required)
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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>> getAssociationSearch_1WithHttpInfo(String objectCategory,
            String subjectCategory, Integer rows, Boolean flExcludesEvidence, String evidence, Integer page,
            String object, String subject, String subjectTaxon, Boolean graphize, String mapIdentifiers)
            throws ApiException {
        com.squareup.okhttp.Call call = getAssociationSearch_1Call(objectCategory, subjectCategory, rows,
                flExcludesEvidence, evidence, page, object, subject, subjectTaxon, graphize, mapIdentifiers, null,
                null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns list of matching associations (asynchronously)
     * 
     * @param objectCategory CATEGORY of entity at link OBJECT (target), e.g. phenotype, disease (required)
     * @param subjectCategory CATEGORY of entity at link SUBJECT (source), e.g. gene, disease, genotype (required)
     * @param rows number of rows (optional, default to 10)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param page Page number (optional, default to 1)
     * @param object OBJECT id, e.g. HP:0011927. Includes inferred by default (optional)
     * @param subject SUBJECT id, e.g. NCBIGene:84570, ZFIN:ZDB-GENE-050417-357. Includes inferred by default (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (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 getAssociationSearch_1Async(String objectCategory, String subjectCategory,
            Integer rows, Boolean flExcludesEvidence, String evidence, Integer page, String object, String subject,
            String subjectTaxon, Boolean graphize, String mapIdentifiers,
            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 = getAssociationSearch_1Call(objectCategory, subjectCategory, rows,
                flExcludesEvidence, evidence, page, object, subject, subjectTaxon, graphize, mapIdentifiers,
                progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getAssociationsFrom */
    private com.squareup.okhttp.Call getAssociationsFromCall(String object, String subject, String objectCategory,
            String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (objectCategory != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "object_category", objectCategory));
        if (mapIdentifiers != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "map_identifiers", mapIdentifiers));
        if (evidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "evidence", evidence));
        if (subjectCategory != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject_category", subjectCategory));
        if (page != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
        if (flExcludesEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fl_excludes_evidence", flExcludesEvidence));
        if (subjectTaxon != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject_taxon", subjectTaxon));
        if (graphize != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "graphize", graphize));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        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 connecting two entities
     * Given two entities (e.g. a particular gene and a particular disease), if these two entities are connected (directly or indirectly), then return the association objects describing the connection.
     * @param object E.g. e.g. MP:0013765, can also be a biological entity such as a gene (required)
     * @param subject E.g. e.g. MGI:1342287 (required)
     * @param objectCategory e.g. disease, phenotype, gene (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param subjectCategory e.g. gene, genotype, disease (optional)
     * @param page Page number (optional, default to 1)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param rows number of rows (optional, default to 10)
     * @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> getAssociationsFrom(String object, String subject, String objectCategory,
            String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            Boolean useCompactAssociations) throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getAssociationsFromWithHttpInfo(object, subject,
                objectCategory, mapIdentifiers, evidence, subjectCategory, page, flExcludesEvidence, subjectTaxon,
                graphize, rows, useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns associations connecting two entities
     * Given two entities (e.g. a particular gene and a particular disease), if these two entities are connected (directly or indirectly), then return the association objects describing the connection.
     * @param object E.g. e.g. MP:0013765, can also be a biological entity such as a gene (required)
     * @param subject E.g. e.g. MGI:1342287 (required)
     * @param objectCategory e.g. disease, phenotype, gene (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param subjectCategory e.g. gene, genotype, disease (optional)
     * @param page Page number (optional, default to 1)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param rows number of rows (optional, default to 10)
     * @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>> getAssociationsFromWithHttpInfo(String object, String subject,
            String objectCategory, String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getAssociationsFromCall(object, subject, objectCategory, mapIdentifiers,
                evidence, subjectCategory, page, flExcludesEvidence, subjectTaxon, graphize, rows,
                useCompactAssociations, null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns associations connecting two entities (asynchronously)
     * Given two entities (e.g. a particular gene and a particular disease), if these two entities are connected (directly or indirectly), then return the association objects describing the connection.
     * @param object E.g. e.g. MP:0013765, can also be a biological entity such as a gene (required)
     * @param subject E.g. e.g. MGI:1342287 (required)
     * @param objectCategory e.g. disease, phenotype, gene (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param subjectCategory e.g. gene, genotype, disease (optional)
     * @param page Page number (optional, default to 1)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param rows number of rows (optional, default to 10)
     * @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 getAssociationsFromAsync(String object, String subject, String objectCategory,
            String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            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 = getAssociationsFromCall(object, subject, objectCategory, mapIdentifiers,
                evidence, subjectCategory, page, flExcludesEvidence, subjectTaxon, graphize, rows,
                useCompactAssociations, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getAssociationsFrom_0 */
    private com.squareup.okhttp.Call getAssociationsFrom_0Call(String subject, String objectCategory,
            String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (objectCategory != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "object_category", objectCategory));
        if (mapIdentifiers != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "map_identifiers", mapIdentifiers));
        if (evidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "evidence", evidence));
        if (subjectCategory != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject_category", subjectCategory));
        if (page != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
        if (flExcludesEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fl_excludes_evidence", flExcludesEvidence));
        if (subjectTaxon != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject_taxon", subjectTaxon));
        if (graphize != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "graphize", graphize));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        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 list of matching associations
     * 
     * @param subject E.g. e.g. NCBIGene:84570 (required)
     * @param objectCategory e.g. disease, phenotype, gene (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param subjectCategory e.g. gene, genotype, disease (optional)
     * @param page Page number (optional, default to 1)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param rows number of rows (optional, default to 10)
     * @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> getAssociationsFrom_0(String subject, String objectCategory,
            String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            Boolean useCompactAssociations) throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getAssociationsFrom_0WithHttpInfo(subject, objectCategory,
                mapIdentifiers, evidence, subjectCategory, page, flExcludesEvidence, subjectTaxon, graphize, rows,
                useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns list of matching associations
     * 
     * @param subject E.g. e.g. NCBIGene:84570 (required)
     * @param objectCategory e.g. disease, phenotype, gene (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param subjectCategory e.g. gene, genotype, disease (optional)
     * @param page Page number (optional, default to 1)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param rows number of rows (optional, default to 10)
     * @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>> getAssociationsFrom_0WithHttpInfo(String subject,
            String objectCategory, String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getAssociationsFrom_0Call(subject, objectCategory, mapIdentifiers, evidence,
                subjectCategory, page, flExcludesEvidence, subjectTaxon, graphize, rows, useCompactAssociations,
                null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns list of matching associations (asynchronously)
     * 
     * @param subject E.g. e.g. NCBIGene:84570 (required)
     * @param objectCategory e.g. disease, phenotype, gene (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param subjectCategory e.g. gene, genotype, disease (optional)
     * @param page Page number (optional, default to 1)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param rows number of rows (optional, default to 10)
     * @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 getAssociationsFrom_0Async(String subject, String objectCategory,
            String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            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 = getAssociationsFrom_0Call(subject, objectCategory, mapIdentifiers, evidence,
                subjectCategory, page, flExcludesEvidence, subjectTaxon, graphize, rows, useCompactAssociations,
                progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }

    /* Build call for getAssociationsTo */
    private com.squareup.okhttp.Call getAssociationsToCall(String object, String objectCategory,
            String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            Boolean useCompactAssociations, final ProgressResponseBody.ProgressListener progressListener,
            final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;

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

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

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        if (objectCategory != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "object_category", objectCategory));
        if (mapIdentifiers != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "map_identifiers", mapIdentifiers));
        if (evidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "evidence", evidence));
        if (subjectCategory != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject_category", subjectCategory));
        if (page != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
        if (flExcludesEvidence != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "fl_excludes_evidence", flExcludesEvidence));
        if (subjectTaxon != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "subject_taxon", subjectTaxon));
        if (graphize != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "graphize", graphize));
        if (rows != null)
            localVarQueryParams.addAll(apiClient.parameterToPairs("", "rows", rows));
        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 list of matching associations
     * 
     * @param object E.g. e.g. MP:0013765, can also be a biological entity such as a gene (required)
     * @param objectCategory e.g. disease, phenotype, gene (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param subjectCategory e.g. gene, genotype, disease (optional)
     * @param page Page number (optional, default to 1)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param rows number of rows (optional, default to 10)
     * @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> getAssociationsTo(String object, String objectCategory, String mapIdentifiers,
            String evidence, String subjectCategory, Integer page, Boolean flExcludesEvidence, String subjectTaxon,
            Boolean graphize, Integer rows, Boolean useCompactAssociations) throws ApiException {
        ApiResponse<List<AssociationResults>> resp = getAssociationsToWithHttpInfo(object, objectCategory,
                mapIdentifiers, evidence, subjectCategory, page, flExcludesEvidence, subjectTaxon, graphize, rows,
                useCompactAssociations);
        return resp.getData();
    }

    /**
     * Returns list of matching associations
     * 
     * @param object E.g. e.g. MP:0013765, can also be a biological entity such as a gene (required)
     * @param objectCategory e.g. disease, phenotype, gene (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param subjectCategory e.g. gene, genotype, disease (optional)
     * @param page Page number (optional, default to 1)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param rows number of rows (optional, default to 10)
     * @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>> getAssociationsToWithHttpInfo(String object, String objectCategory,
            String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            Boolean useCompactAssociations) throws ApiException {
        com.squareup.okhttp.Call call = getAssociationsToCall(object, objectCategory, mapIdentifiers, evidence,
                subjectCategory, page, flExcludesEvidence, subjectTaxon, graphize, rows, useCompactAssociations,
                null, null);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * Returns list of matching associations (asynchronously)
     * 
     * @param object E.g. e.g. MP:0013765, can also be a biological entity such as a gene (required)
     * @param objectCategory e.g. disease, phenotype, gene (optional)
     * @param mapIdentifiers Prefix to map all IDs to. E.g. NCBIGene (optional)
     * @param evidence Object id, e.g. ECO:0000501 (for IEA; Includes inferred by default)                     or a specific publication or other supporting ibject, e.g. ZFIN:ZDB-PUB-060503-2.                      (optional)
     * @param subjectCategory e.g. gene, genotype, disease (optional)
     * @param page Page number (optional, default to 1)
     * @param flExcludesEvidence If set, excludes evidence objects in response (optional)
     * @param subjectTaxon SUBJECT TAXON id, e.g. NCBITaxon:9606. Includes inferred by default (optional)
     * @param graphize If set, includes graph object in response (optional)
     * @param rows number of rows (optional, default to 10)
     * @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 getAssociationsToAsync(String object, String objectCategory,
            String mapIdentifiers, String evidence, String subjectCategory, Integer page,
            Boolean flExcludesEvidence, String subjectTaxon, Boolean graphize, Integer rows,
            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 = getAssociationsToCall(object, objectCategory, mapIdentifiers, evidence,
                subjectCategory, page, flExcludesEvidence, subjectTaxon, graphize, rows, useCompactAssociations,
                progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken<List<AssociationResults>>() {
        }.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}