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

com.seeq.api.DatafilesApi 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.CsvDatafileOutputV1;
import com.seeq.model.DatafileInputV1;
import com.seeq.model.DatafileOutputV1;
import java.io.File;
import com.seeq.model.ItemPreviewListV1;
import com.seeq.model.StatusMessageBase;


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

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

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

    public DatafilesApi(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 datafile and all of its signals
    * 
    * @param id ID of the datafile to archive (required)
    * @return StatusMessageBase
    * @throws ApiException if fails to make API call
    */
    public StatusMessageBase archiveDatafile(String id) throws ApiException {
        ApiClient.ApiResponse localVarResponse = archiveDatafileWithHttpInfo(id);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Archive a datafile and all of its signals
    * 
    * @param id ID of the datafile to archive (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse archiveDatafileWithHttpInfo(String id) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return archiveDatafileWithHeadersAndHttpInfo(id, localVarHeaderParams);
        
    }

    /**
    * Archive a datafile and all of its signals
    * 
    * @param id ID of the datafile to archive (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse archiveDatafileWithHeadersAndHttpInfo(String id, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return archiveDatafileInternal(id, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse archiveDatafileInternal(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 archiveDatafile");
        }
        // create path and map variables
        String localVarPath = "/datafiles/{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, "DELETE", 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
    }
    /**
    * Create a datafile
    * 
    * @param body Datafile information (required)
    * @return DatafileOutputV1
    * @throws ApiException if fails to make API call
    */
    public DatafileOutputV1 createDatafile(DatafileInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = createDatafileWithHttpInfo(body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Create a datafile
    * 
    * @param body Datafile information (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse createDatafileWithHttpInfo(DatafileInputV1 body) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return createDatafileWithHeadersAndHttpInfo(body, localVarHeaderParams);
        
    }

    /**
    * Create a datafile
    * 
    * @param body Datafile information (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse createDatafileWithHeadersAndHttpInfo(DatafileInputV1 body, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return createDatafileInternal(body, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse createDatafileInternal(DatafileInputV1 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 createDatafile");
        }
        // create path and map variables
        String localVarPath = "/datafiles";

        // 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 Datafile
    * 
    * @param id ID of the datafile to retrieve (required)
    * @return DatafileOutputV1
    * @throws ApiException if fails to make API call
    */
    public DatafileOutputV1 getDatafile(String id) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getDatafileWithHttpInfo(id);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a Datafile
    * 
    * @param id ID of the datafile to retrieve (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getDatafileWithHttpInfo(String id) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getDatafileWithHeadersAndHttpInfo(id, localVarHeaderParams);
        
    }

    /**
    * Get a Datafile
    * 
    * @param id ID of the datafile to retrieve (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getDatafileWithHeadersAndHttpInfo(String id, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return getDatafileInternal(id, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse getDatafileInternal(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 getDatafile");
        }
        // create path and map variables
        String localVarPath = "/datafiles/{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 collection of datafiles
    * 
    * @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 getDatafiles(Integer offset, Integer limit) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getDatafilesWithHttpInfo(offset, limit);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a collection of datafiles
    * 
    * @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 getDatafilesWithHttpInfo(Integer offset, Integer limit) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getDatafilesWithHeadersAndHttpInfo(offset, limit, localVarHeaderParams);
        
    }

    /**
    * Get a collection of datafiles
    * 
    * @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 getDatafilesWithHeadersAndHttpInfo(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 getDatafilesInternal(localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse getDatafilesInternal(List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = null;
        // create path and map variables
        String localVarPath = "/datafiles";

        // 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 the items hosted by this datafile
    * 
    * @param id ID of the datafile (required)
    * @param dataId The dataId for a specific hosted item (optional)
    * @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 getItemsHostedByDatafile(String id, String dataId, Integer offset, Integer limit) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getItemsHostedByDatafileWithHttpInfo(id, dataId, offset, limit);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a list of the items hosted by this datafile
    * 
    * @param id ID of the datafile (required)
    * @param dataId The dataId for a specific hosted item (optional)
    * @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 getItemsHostedByDatafileWithHttpInfo(String id, String dataId, Integer offset, Integer limit) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getItemsHostedByDatafileWithHeadersAndHttpInfo(id, dataId, offset, limit, localVarHeaderParams);
        
    }

    /**
    * Get a list of the items hosted by this datafile
    * 
    * @param id ID of the datafile (required)
    * @param dataId The dataId for a specific hosted item (optional)
    * @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 getItemsHostedByDatafileWithHeadersAndHttpInfo(String id, String dataId, Integer offset, Integer limit, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "dataId", dataId));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
                localVarHeaderParams.putAll(customHeaders);
        return getItemsHostedByDatafileInternal(id, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse getItemsHostedByDatafileInternal(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 getItemsHostedByDatafile");
        }
        // create path and map variables
        String localVarPath = "/datafiles/{id}/items"
          .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
    }
    /**
    * Import a CSV file that can be used to create or update a Datafile
    * 
    * @param file  (optional)
    * @return CsvDatafileOutputV1
    * @throws ApiException if fails to make API call
    */
    public CsvDatafileOutputV1 importCSV(File file) throws ApiException {
        ApiClient.ApiResponse localVarResponse = importCSVWithHttpInfo(file);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Import a CSV file that can be used to create or update a Datafile
    * 
    * @param file  (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse importCSVWithHttpInfo(File file) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return importCSVWithHeadersAndHttpInfo(file, localVarHeaderParams);
        
    }

    /**
    * Import a CSV file that can be used to create or update a Datafile
    * 
    * @param file  (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse importCSVWithHeadersAndHttpInfo(File file, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return importCSVInternal(file, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse importCSVInternal(File file, List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = null;
        // create path and map variables
        String localVarPath = "/datafiles/csv";

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

        if (file != null)
            localVarFormParams.put("file", file);

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

        final String[] localVarContentTypes = {
        "multipart/form-data"
        };
        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
    }
    /**
    * Update a datafile
    * 
    * @param id ID of the datafile to retrieve (required)
    * @param body Datafile information (required)
    * @return DatafileOutputV1
    * @throws ApiException if fails to make API call
    */
    public DatafileOutputV1 updateDatafile(String id, DatafileInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = updateDatafileWithHttpInfo(id, body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Update a datafile
    * 
    * @param id ID of the datafile to retrieve (required)
    * @param body Datafile information (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse updateDatafileWithHttpInfo(String id, DatafileInputV1 body) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return updateDatafileWithHeadersAndHttpInfo(id, body, localVarHeaderParams);
        
    }

    /**
    * Update a datafile
    * 
    * @param id ID of the datafile to retrieve (required)
    * @param body Datafile information (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse updateDatafileWithHeadersAndHttpInfo(String id, DatafileInputV1 body, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return updateDatafileInternal(id, body, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse updateDatafileInternal(String id, DatafileInputV1 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 updateDatafile");
        }
        // verify the required body parameter 'body' is set
        if (body == null) {
            throw new ApiException(400, "Missing the required body parameter 'body' when calling updateDatafile");
        }
        // create path and map variables
        String localVarPath = "/datafiles/{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 collection of datafiles
    *
    * @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 getDatafiles(Integer offset) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

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

    /**
    * Get a collection of datafiles
    * @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 getDatafilesWithHttpInfo(Integer offset) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

        return getDatafilesInternal(localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get a collection of datafiles
    *
    * @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 getDatafilesWithHeadersAndHttpInfo(Integer offset, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

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


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


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

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


        return getDatafilesInternal(localVarQueryParams, localVarHeaderParams);
    }

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


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


    /**
    * Get a list of the items hosted by this datafile
    *
    * @param id ID of the datafile (required)
    * @param dataId The dataId for a specific hosted item (optional)
    * @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 getItemsHostedByDatafile(String id, String dataId, Integer offset) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

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

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

    /**
    * Get a list of the items hosted by this datafile
    * @param id ID of the datafile (required)
    * @param dataId The dataId for a specific hosted item (optional)
    * @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 getItemsHostedByDatafileWithHttpInfo(String id, String dataId, Integer offset) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

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

        return getItemsHostedByDatafileInternal(id, localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get a list of the items hosted by this datafile
    *
    * @param id ID of the datafile (required)
    * @param dataId The dataId for a specific hosted item (optional)
    * @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 getItemsHostedByDatafileWithHeadersAndHttpInfo(String id, String dataId, Integer offset, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

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

        localVarHeaderParams.putAll(customHeaders);
        return getItemsHostedByDatafileInternal(id, localVarQueryParams, localVarHeaderParams);
    }


    /**
    * Get a list of the items hosted by this datafile
    *
    * @param id ID of the datafile (required)
    * @param dataId The dataId for a specific hosted item (optional)
    * @return ItemPreviewListV1
    * @throws ApiException if fails to make API call
    */
    public ItemPreviewListV1 getItemsHostedByDatafile(String id, String dataId) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

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

    /**
    * Get a list of the items hosted by this datafile
    * @param id ID of the datafile (required)
    * @param dataId The dataId for a specific hosted item (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getItemsHostedByDatafileWithHttpInfo(String id, String dataId) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

        return getItemsHostedByDatafileInternal(id, localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get a list of the items hosted by this datafile
    *
    * @param id ID of the datafile (required)
    * @param dataId The dataId for a specific hosted item (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getItemsHostedByDatafileWithHeadersAndHttpInfo(String id, String dataId, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

        localVarHeaderParams.putAll(customHeaders);
        return getItemsHostedByDatafileInternal(id, localVarQueryParams, localVarHeaderParams);
    }


    /**
    * Get a list of the items hosted by this datafile
    *
    * @param id ID of the datafile (required)
    * @return ItemPreviewListV1
    * @throws ApiException if fails to make API call
    */
    public ItemPreviewListV1 getItemsHostedByDatafile(String id) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


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

    /**
    * Get a list of the items hosted by this datafile
    * @param id ID of the datafile (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getItemsHostedByDatafileWithHttpInfo(String id) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


        return getItemsHostedByDatafileInternal(id, localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get a list of the items hosted by this datafile
    *
    * @param id ID of the datafile (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getItemsHostedByDatafileWithHeadersAndHttpInfo(String id, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


        localVarHeaderParams.putAll(customHeaders);
        return getItemsHostedByDatafileInternal(id, localVarQueryParams, localVarHeaderParams);
    }

// OVERLOADS END
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy