Example usage for com.squareup.okhttp Response newBuilder

List of usage examples for com.squareup.okhttp Response newBuilder

Introduction

In this page you can find the example usage for com.squareup.okhttp Response newBuilder.

Prototype

public Builder newBuilder() 

Source Link

Usage

From source file:io.swagger.client.api.BioentityApi.java

License:Apache License

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)");
    }//from w  ww. j av a 2 s . c om

    // 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);
}

From source file:io.swagger.client.api.BioentityApi.java

License:Apache License

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)");
    }/*from  w w  w .j  a v a  2  s  .  co m*/

    // 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);
}

From source file:io.swagger.client.api.BioentityApi.java

License:Apache License

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)");
    }/*from w w  w  .j a v a  2 s . co m*/

    // 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);
}

From source file:io.swagger.client.api.BioentityApi.java

License:Apache License

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)");
    }/*w  ww  .  j  av  a2 s. co m*/

    // 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);
}

From source file:io.swagger.client.api.BioentityApi.java

License:Apache License

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)");
    }/*from   ww w  .j  a  v  a 2s .  c  om*/

    // 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);
}

From source file:io.swagger.client.api.BioentityApi.java

License:Apache License

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)");
    }/*w  w  w  .  j  a  va  2 s. co m*/

    // 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);
}

From source file:io.swagger.client.api.BioentityApi.java

License:Apache License

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)");
    }/*from  ww  w .ja v a 2 s.  co m*/

    // 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);
}

From source file:io.swagger.client.api.BioentityApi.java

License:Apache License

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)");
    }//from   ww  w  .  j  a  v  a  2  s .com

    // 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);
}

From source file:io.swagger.client.api.BioentityApi.java

License:Apache License

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)");
    }/*from  w  w  w  .j  ava2 s .  co m*/

    // 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);
}

From source file:io.swagger.client.api.BioentityApi.java

License:Apache License

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)");
    }//from w w w .j ava2s .  c o m

    // 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);
}