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

com.seeq.api.NetworksApi Maven / Gradle / Ivy

There is a newer version: 66.0.0-v202410141803
Show newest version
package com.seeq.api;

import com.seeq.ApiException;
import com.seeq.ApiClient;
import com.seeq.Configuration;
import com.seeq.model.*;
import com.seeq.Pair;

import javax.ws.rs.core.GenericType;
import javax.ws.rs.ProcessingException;

import com.seeq.model.ItemPreviewListV1;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class NetworksApi {
    private ApiClient apiClient;
    private long retryTimeout = 5_000; // Default of 5 seconds

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

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

    public void setRetryTimeout(long retryTimeout) {
        this.retryTimeout = retryTimeout;
    }

    public long getRetryTimeout() {
        return this.retryTimeout;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
    * Get a collection of all available network types
    * 
    * @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
    * @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
    * @return ItemPreviewListV1
    * @throws ApiException if fails to make API call
    */
    public ItemPreviewListV1 getAllNetworkTypes(Integer offset, Integer limit) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getAllNetworkTypesWithHttpInfo(offset, limit);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a collection of all available network types
    * 
    * @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
    * @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getAllNetworkTypesWithHttpInfo(Integer offset, Integer limit) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getAllNetworkTypesWithHeadersAndHttpInfo(offset, limit, localVarHeaderParams);
        
    }

    /**
    * Get a collection of all available network types
    * 
    * @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
    * @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getAllNetworkTypesWithHeadersAndHttpInfo(Integer offset, Integer limit, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
                localVarHeaderParams.putAll(customHeaders);
        return getAllNetworkTypesInternal(localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse getAllNetworkTypesInternal(List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = null;
        // create path and map variables
        String localVarPath = "/networks";

        // query params
        Map localVarFormParams = new HashMap();

        
        final String[] localVarAccepts = {
        "application/vnd.seeq.v1+json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

        final String[] localVarContentTypes = {
        
        };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

        String[] localVarAuthNames = new String[] { "api_key" };

        long apiClientInvocationTime = System.currentTimeMillis();
        while(true) {
            try {
                GenericType localVarReturnType = new GenericType() {};
                return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", queryParams, localVarPostBody, headerParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
                // Possible exceptions:
                // ===================
                // * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
                //    during conversion of the response entity data to an instance of a particular Java type).
                // * ProcessingException - in case the request processing or subsequent I/O operation fails.
                // * WebApplicationException - in case the response status code of the response returned by the server is not
                //    successful and the specified response type is not Response.
                // * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
                //    in ApiException(s)
            } catch (ApiException | ProcessingException e) {
                if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
                    long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
                    if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
                        continue;
                    }
                }
                throw e;
            }
        } // while
    }
    // OVERLOADS START

    /**
    * Get a collection of all available network types
    *
    * @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional)
    * @return ItemPreviewListV1
    * @throws ApiException if fails to make API call
    */
    public ItemPreviewListV1 getAllNetworkTypes(Integer offset) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));

        ApiClient.ApiResponse localVarResponse = getAllNetworkTypesInternal(localVarQueryParams, localVarHeaderParams);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }

    /**
    * Get a collection of all available network types
    * @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getAllNetworkTypesWithHttpInfo(Integer offset) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));

        return getAllNetworkTypesInternal(localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get a collection of all available network types
    *
    * @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getAllNetworkTypesWithHeadersAndHttpInfo(Integer offset, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));

        localVarHeaderParams.putAll(customHeaders);
        return getAllNetworkTypesInternal(localVarQueryParams, localVarHeaderParams);
    }


    /**
    * Get a collection of all available network types
    *
    *
    * @return ItemPreviewListV1
    * @throws ApiException if fails to make API call
    */
    public ItemPreviewListV1 getAllNetworkTypes() throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


        ApiClient.ApiResponse localVarResponse = getAllNetworkTypesInternal(localVarQueryParams, localVarHeaderParams);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }

    /**
    * Get a collection of all available network types
    *
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getAllNetworkTypesWithHttpInfo() throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


        return getAllNetworkTypesInternal(localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get a collection of all available network types
    *
    *
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getAllNetworkTypesWithHeadersAndHttpInfo(Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


        localVarHeaderParams.putAll(customHeaders);
        return getAllNetworkTypesInternal(localVarQueryParams, localVarHeaderParams);
    }

// OVERLOADS END
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy