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

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

There is a newer version: 66.0.0-v202407310200
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.DisplayInputV1;
import com.seeq.model.DisplayOutputListV1;
import com.seeq.model.DisplayOutputV1;


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

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

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

    public DisplaysApi(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;
    }

    /**
    * Archive a display item
    * 
    * @param id ID of the display item to archive. (required)
    * @throws ApiException if fails to make API call
    */
    public void archiveDisplay(String id) throws ApiException {
        archiveDisplayWithHttpInfo(id);
    }
    
    /**
    * Archive a display item
    * 
    * @param id ID of the display item to archive. (required)
    * @throws ApiException if fails to make API call
    */
    public void archiveDisplayWithHttpInfo(String id) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        
         archiveDisplayWithHeadersAndHttpInfo(id, localVarHeaderParams);
    }

    /**
    * Archive a display item
    * 
    * @param id ID of the display item to archive. (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public void archiveDisplayWithHeadersAndHttpInfo(String id, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        archiveDisplayInternal(id, localVarQueryParams, localVarHeaderParams);
    }
    
    private void archiveDisplayInternal(String id, List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = null;
        // verify the required path parameter 'id' is set
        if (id == null) {
            throw new ApiException(400, "Missing the required path parameter 'id' when calling archiveDisplay");
        }
        // create path and map variables
        String localVarPath = "/displays/{id}"
          .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        // 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 {
                apiClient.invokeAPIWithHttpInfo(localVarPath, "DELETE", queryParams, localVarPostBody, headerParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
                return;
                // 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
    }
    /**
    * Create a new display item
    * 
    * @param body  (required)
    * @return DisplayOutputV1
    * @throws ApiException if fails to make API call
    */
    public DisplayOutputV1 createDisplay(DisplayInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = createDisplayWithHttpInfo(body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Create a new display item
    * 
    * @param body  (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse createDisplayWithHttpInfo(DisplayInputV1 body) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return createDisplayWithHeadersAndHttpInfo(body, localVarHeaderParams);
        
    }

    /**
    * Create a new display item
    * 
    * @param body  (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse createDisplayWithHeadersAndHttpInfo(DisplayInputV1 body, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return createDisplayInternal(body, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse createDisplayInternal(DisplayInputV1 body, List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = body;
        // verify the required body parameter 'body' is set
        if (body == null) {
            throw new ApiException(400, "Missing the required body parameter 'body' when calling createDisplay");
        }
        // create path and map variables
        String localVarPath = "/displays";

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

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

        final String[] localVarContentTypes = {
        "application/vnd.seeq.v1+json"
        };
        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, "POST", 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
    }
    /**
    * Get a display item
    * 
    * @param id The Seeq ID for the display (required)
    * @return DisplayOutputV1
    * @throws ApiException if fails to make API call
    */
    public DisplayOutputV1 getDisplay(String id) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getDisplayWithHttpInfo(id);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a display item
    * 
    * @param id The Seeq ID for the display (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getDisplayWithHttpInfo(String id) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getDisplayWithHeadersAndHttpInfo(id, localVarHeaderParams);
        
    }

    /**
    * Get a display item
    * 
    * @param id The Seeq ID for the display (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getDisplayWithHeadersAndHttpInfo(String id, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return getDisplayInternal(id, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse getDisplayInternal(String id, List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = null;
        // verify the required path parameter 'id' is set
        if (id == null) {
            throw new ApiException(400, "Missing the required path parameter 'id' when calling getDisplay");
        }
        // create path and map variables
        String localVarPath = "/displays/{id}"
          .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

        // 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
    }
    /**
    * Get a list of display items
    * 
    * @param offset The pagination offset, the index of the first display item that will be returned in this page of results (optional, default to 0)
    * @param limit The pagination limit, the total number of display items that will be returned in this page of results (optional, default to 40)
    * @return DisplayOutputListV1
    * @throws ApiException if fails to make API call
    */
    public DisplayOutputListV1 getDisplays(Integer offset, Integer limit) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getDisplaysWithHttpInfo(offset, limit);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a list of display items
    * 
    * @param offset The pagination offset, the index of the first display item that will be returned in this page of results (optional, default to 0)
    * @param limit The pagination limit, the total number of display 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 getDisplaysWithHttpInfo(Integer offset, Integer limit) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getDisplaysWithHeadersAndHttpInfo(offset, limit, localVarHeaderParams);
        
    }

    /**
    * Get a list of display items
    * 
    * @param offset The pagination offset, the index of the first display item that will be returned in this page of results (optional, default to 0)
    * @param limit The pagination limit, the total number of display 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 getDisplaysWithHeadersAndHttpInfo(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 getDisplaysInternal(localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse getDisplaysInternal(List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = null;
        // create path and map variables
        String localVarPath = "/displays";

        // 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
    }
    /**
    * Update a display
    * 
    * @param id The Seeq ID for the display (required)
    * @param body  (required)
    * @return DisplayOutputV1
    * @throws ApiException if fails to make API call
    */
    public DisplayOutputV1 updateDisplay(String id, DisplayInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = updateDisplayWithHttpInfo(id, body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Update a display
    * 
    * @param id The Seeq ID for the display (required)
    * @param body  (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse updateDisplayWithHttpInfo(String id, DisplayInputV1 body) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return updateDisplayWithHeadersAndHttpInfo(id, body, localVarHeaderParams);
        
    }

    /**
    * Update a display
    * 
    * @param id The Seeq ID for the display (required)
    * @param body  (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse updateDisplayWithHeadersAndHttpInfo(String id, DisplayInputV1 body, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return updateDisplayInternal(id, body, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse updateDisplayInternal(String id, DisplayInputV1 body, List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = body;
        // verify the required path parameter 'id' is set
        if (id == null) {
            throw new ApiException(400, "Missing the required path parameter 'id' when calling updateDisplay");
        }
        // verify the required body parameter 'body' is set
        if (body == null) {
            throw new ApiException(400, "Missing the required body parameter 'body' when calling updateDisplay");
        }
        // create path and map variables
        String localVarPath = "/displays/{id}"
          .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

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

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

        final String[] localVarContentTypes = {
        "application/vnd.seeq.v1+json"
        };
        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, "POST", 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 list of display items
    *
    * @param offset The pagination offset, the index of the first display item that will be returned in this page of results (optional)
    * @return DisplayOutputListV1
    * @throws ApiException if fails to make API call
    */
    public DisplayOutputListV1 getDisplays(Integer offset) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

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

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

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

        return getDisplaysInternal(localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get a list of display items
    *
    * @param offset The pagination offset, the index of the first display 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 getDisplaysWithHeadersAndHttpInfo(Integer offset, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

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


    /**
    * Get a list of display items
    *
    *
    * @return DisplayOutputListV1
    * @throws ApiException if fails to make API call
    */
    public DisplayOutputListV1 getDisplays() throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


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

    /**
    * Get a list of display items
    *
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getDisplaysWithHttpInfo() throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


        return getDisplaysInternal(localVarQueryParams, localVarHeaderParams);
    }

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


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

// OVERLOADS END
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy