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

enterprises.orbital.eve.esi.client.api.IncursionsApi Maven / Gradle / Ivy

The newest version!
/*
 * EVE Swagger Interface
 * An OpenAPI for EVE Online
 *
 * OpenAPI spec version: 1.2.3
 * 
 *
 * 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.
 */


package enterprises.orbital.eve.esi.client.api;

import enterprises.orbital.eve.esi.client.invoker.ApiCallback;
import enterprises.orbital.eve.esi.client.invoker.ApiClient;
import enterprises.orbital.eve.esi.client.invoker.ApiException;
import enterprises.orbital.eve.esi.client.invoker.ApiResponse;
import enterprises.orbital.eve.esi.client.invoker.Configuration;
import enterprises.orbital.eve.esi.client.invoker.Pair;
import enterprises.orbital.eve.esi.client.invoker.ProgressRequestBody;
import enterprises.orbital.eve.esi.client.invoker.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import enterprises.orbital.eve.esi.client.model.BadRequest;
import enterprises.orbital.eve.esi.client.model.ErrorLimited;
import enterprises.orbital.eve.esi.client.model.GatewayTimeout;
import enterprises.orbital.eve.esi.client.model.GetIncursions200Ok;
import enterprises.orbital.eve.esi.client.model.InternalServerError;
import enterprises.orbital.eve.esi.client.model.ServiceUnavailable;

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

public class IncursionsApi {
    private ApiClient apiClient;

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /* Build call for getIncursions */
    private com.squareup.okhttp.Call getIncursionsCall(String datasource, String ifNoneMatch, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        Object localVarPostBody = null;
        
        // create path and map variables
        String localVarPath = "/v1/incursions/".replaceAll("\\{format\\}","json");

        List localVarQueryParams = new ArrayList();
        if (datasource != null)
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "datasource", datasource));

        Map localVarHeaderParams = new HashMap();
        if (ifNoneMatch != null)
        localVarHeaderParams.put("If-None-Match", apiClient.parameterToString(ifNoneMatch));

        Map localVarFormParams = new HashMap();

        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);
    }
    
    @SuppressWarnings("rawtypes")
    private com.squareup.okhttp.Call getIncursionsValidateBeforeCall(String datasource, String ifNoneMatch, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
        
        
        com.squareup.okhttp.Call call = getIncursionsCall(datasource, ifNoneMatch, progressListener, progressRequestListener);
        return call;

        
        
        
        
    }

    /**
     * List incursions
     * Return a list of current incursions  ---  This route is cached for up to 300 seconds
     * @param datasource The server name you would like data from (optional, default to tranquility)
     * @param ifNoneMatch ETag from a previous request. A 304 will be returned if this matches the current ETag (optional)
     * @return List<GetIncursions200Ok>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public List getIncursions(String datasource, String ifNoneMatch) throws ApiException {
        ApiResponse> resp = getIncursionsWithHttpInfo(datasource, ifNoneMatch);
        return resp.getData();
    }

    /**
     * List incursions
     * Return a list of current incursions  ---  This route is cached for up to 300 seconds
     * @param datasource The server name you would like data from (optional, default to tranquility)
     * @param ifNoneMatch ETag from a previous request. A 304 will be returned if this matches the current ETag (optional)
     * @return ApiResponse<List<GetIncursions200Ok>>
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public ApiResponse> getIncursionsWithHttpInfo(String datasource, String ifNoneMatch) throws ApiException {
        com.squareup.okhttp.Call call = getIncursionsValidateBeforeCall(datasource, ifNoneMatch, null, null);
        Type localVarReturnType = new TypeToken>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }

    /**
     * List incursions (asynchronously)
     * Return a list of current incursions  ---  This route is cached for up to 300 seconds
     * @param datasource The server name you would like data from (optional, default to tranquility)
     * @param ifNoneMatch ETag from a previous request. A 304 will be returned if this matches the current ETag (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 getIncursionsAsync(String datasource, String ifNoneMatch, final ApiCallback> callback) throws ApiException {

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

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

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

        com.squareup.okhttp.Call call = getIncursionsValidateBeforeCall(datasource, ifNoneMatch, progressListener, progressRequestListener);
        Type localVarReturnType = new TypeToken>(){}.getType();
        apiClient.executeAsync(call, localVarReturnType, callback);
        return call;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy