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

com.seeq.api.ConditionsApi 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.ArchiveOutputV1;
import com.seeq.model.CapsulesInputV1;
import com.seeq.model.CapsulesOutputV1;
import com.seeq.model.CapsulesOverwriteInputV1;
import com.seeq.model.ConditionBatchInputV1;
import com.seeq.model.ConditionInputV1;
import com.seeq.model.ConditionOutputV1;
import com.seeq.model.ConditionUpdateInputV1;
import com.seeq.model.ItemBatchOutputV1;
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 ConditionsApi {
    private ApiClient apiClient;
    private long retryTimeout = 5_000; // Default of 5 seconds

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

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

    /**
    * Add capsules to a stored condition
    * 
    * @param id ID of the stored condition that will receive the capsules (required)
    * @param body Capsules to be added to the stored condition (required)
    * @return StatusMessageBase
    * @throws ApiException if fails to make API call
    */
    public StatusMessageBase addCapsules(String id, CapsulesInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = addCapsulesWithHttpInfo(id, body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Add capsules to a stored condition
    * 
    * @param id ID of the stored condition that will receive the capsules (required)
    * @param body Capsules to be added to the stored condition (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse addCapsulesWithHttpInfo(String id, CapsulesInputV1 body) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return addCapsulesWithHeadersAndHttpInfo(id, body, localVarHeaderParams);
        
    }

    /**
    * Add capsules to a stored condition
    * 
    * @param id ID of the stored condition that will receive the capsules (required)
    * @param body Capsules to be added to the stored condition (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse addCapsulesWithHeadersAndHttpInfo(String id, CapsulesInputV1 body, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return addCapsulesInternal(id, body, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse addCapsulesInternal(String id, CapsulesInputV1 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 addCapsules");
        }
        // verify the required body parameter 'body' is set
        if (body == null) {
            throw new ApiException(400, "Missing the required body parameter 'body' when calling addCapsules");
        }
        // create path and map variables
        String localVarPath = "/conditions/{id}/capsules"
          .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
    }
    /**
    * Archive a condition and its capsules
    * 
    * @param id ID of the condition to archive (required)
    * @return ArchiveOutputV1
    * @throws ApiException if fails to make API call
    */
    public ArchiveOutputV1 archiveCondition(String id) throws ApiException {
        ApiClient.ApiResponse localVarResponse = archiveConditionWithHttpInfo(id);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Archive a condition and its capsules
    * 
    * @param id ID of the condition to archive (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse archiveConditionWithHttpInfo(String id) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return archiveConditionWithHeadersAndHttpInfo(id, localVarHeaderParams);
        
    }

    /**
    * Archive a condition and its capsules
    * 
    * @param id ID of the condition 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 archiveConditionWithHeadersAndHttpInfo(String id, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return archiveConditionInternal(id, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse archiveConditionInternal(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 archiveCondition");
        }
        // create path and map variables
        String localVarPath = "/conditions/{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 condition
    * 
    * @param body Condition information (required)
    * @return ConditionOutputV1
    * @throws ApiException if fails to make API call
    */
    public ConditionOutputV1 createCondition(ConditionInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = createConditionWithHttpInfo(body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Create a condition
    * 
    * @param body Condition information (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse createConditionWithHttpInfo(ConditionInputV1 body) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return createConditionWithHeadersAndHttpInfo(body, localVarHeaderParams);
        
    }

    /**
    * Create a condition
    * 
    * @param body Condition 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 createConditionWithHeadersAndHttpInfo(ConditionInputV1 body, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return createConditionInternal(body, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse createConditionInternal(ConditionInputV1 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 createCondition");
        }
        // create path and map variables
        String localVarPath = "/conditions";

        // 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
    }
    /**
    * Delete all capsules in a condition
    * 
    * @param id The Seeq ID for the signal (required)
    * @param clearCapsuleProperties When true, clears capsule property definitions from the condition after deleting the capsules. (optional, default to false)
    * @return StatusMessageBase
    * @throws ApiException if fails to make API call
    */
    public StatusMessageBase deleteCapsules(String id, Boolean clearCapsuleProperties) throws ApiException {
        ApiClient.ApiResponse localVarResponse = deleteCapsulesWithHttpInfo(id, clearCapsuleProperties);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Delete all capsules in a condition
    * 
    * @param id The Seeq ID for the signal (required)
    * @param clearCapsuleProperties When true, clears capsule property definitions from the condition after deleting the capsules. (optional, default to false)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse deleteCapsulesWithHttpInfo(String id, Boolean clearCapsuleProperties) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return deleteCapsulesWithHeadersAndHttpInfo(id, clearCapsuleProperties, localVarHeaderParams);
        
    }

    /**
    * Delete all capsules in a condition
    * 
    * @param id The Seeq ID for the signal (required)
    * @param clearCapsuleProperties When true, clears capsule property definitions from the condition after deleting the capsules. (optional, default to false)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse deleteCapsulesWithHeadersAndHttpInfo(String id, Boolean clearCapsuleProperties, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "clearCapsuleProperties", clearCapsuleProperties));
                localVarHeaderParams.putAll(customHeaders);
        return deleteCapsulesInternal(id, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse deleteCapsulesInternal(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 deleteCapsules");
        }
        // create path and map variables
        String localVarPath = "/conditions/{id}/capsules"
          .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
    }
    /**
    * Get capsules from a condition
    * 
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @param timeFormat The timestamp format. (optional, default to ISO8601)
    * @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 1000)
    * @param continuationToken An opaque token used to query for the next page of results. Only use if returned by a previous call. (optional)
    * @return CapsulesOutputV1
    * @throws ApiException if fails to make API call
    */
    public CapsulesOutputV1 getCapsules(String id, String start, String end, String unitOfMeasure, String timeFormat, Integer limit, String continuationToken) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getCapsulesWithHttpInfo(id, start, end, unitOfMeasure, timeFormat, limit, continuationToken);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get capsules from a condition
    * 
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @param timeFormat The timestamp format. (optional, default to ISO8601)
    * @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 1000)
    * @param continuationToken An opaque token used to query for the next page of results. Only use if returned by a previous call. (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getCapsulesWithHttpInfo(String id, String start, String end, String unitOfMeasure, String timeFormat, Integer limit, String continuationToken) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getCapsulesWithHeadersAndHttpInfo(id, start, end, unitOfMeasure, timeFormat, limit, continuationToken, localVarHeaderParams);
        
    }

    /**
    * Get capsules from a condition
    * 
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @param timeFormat The timestamp format. (optional, default to ISO8601)
    * @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 1000)
    * @param continuationToken An opaque token used to query for the next page of results. Only use if returned by a previous call. (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getCapsulesWithHeadersAndHttpInfo(String id, String start, String end, String unitOfMeasure, String timeFormat, Integer limit, String continuationToken, Map customHeaders) throws ApiException {
          // verify the required query parameter 'start' is set
        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
          // verify the required query parameter 'end' is set
        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "unitOfMeasure", unitOfMeasure));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "timeFormat", timeFormat));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "continuationToken", continuationToken));
                localVarHeaderParams.putAll(customHeaders);
        return getCapsulesInternal(id, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse getCapsulesInternal(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 getCapsules");
        }
        // create path and map variables
        String localVarPath = "/conditions/{id}/capsules"
          .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 condition
    * 
    * @param id ID of the condition to retrieve (required)
    * @return ConditionOutputV1
    * @throws ApiException if fails to make API call
    */
    public ConditionOutputV1 getCondition(String id) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getConditionWithHttpInfo(id);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a condition
    * 
    * @param id ID of the condition to retrieve (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getConditionWithHttpInfo(String id) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getConditionWithHeadersAndHttpInfo(id, localVarHeaderParams);
        
    }

    /**
    * Get a condition
    * 
    * @param id ID of the condition 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 getConditionWithHeadersAndHttpInfo(String id, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return getConditionInternal(id, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse getConditionInternal(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 getCondition");
        }
        // create path and map variables
        String localVarPath = "/conditions/{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 conditions
    * 
    * @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 getConditions(Integer offset, Integer limit) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getConditionsWithHttpInfo(offset, limit);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a collection of conditions
    * 
    * @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 getConditionsWithHttpInfo(Integer offset, Integer limit) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return getConditionsWithHeadersAndHttpInfo(offset, limit, localVarHeaderParams);
        
    }

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

        // 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
    }
    /**
    * Replace any capsules in the same time range
    * 
    * @param id ID of the stored condition that will receive the capsules (required)
    * @param body Capsules to be added to the stored condition (required)
    * @return StatusMessageBase
    * @throws ApiException if fails to make API call
    */
    public StatusMessageBase putCapsules(String id, CapsulesOverwriteInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = putCapsulesWithHttpInfo(id, body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Replace any capsules in the same time range
    * 
    * @param id ID of the stored condition that will receive the capsules (required)
    * @param body Capsules to be added to the stored condition (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse putCapsulesWithHttpInfo(String id, CapsulesOverwriteInputV1 body) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return putCapsulesWithHeadersAndHttpInfo(id, body, localVarHeaderParams);
        
    }

    /**
    * Replace any capsules in the same time range
    * 
    * @param id ID of the stored condition that will receive the capsules (required)
    * @param body Capsules to be added to the stored condition (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse putCapsulesWithHeadersAndHttpInfo(String id, CapsulesOverwriteInputV1 body, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return putCapsulesInternal(id, body, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse putCapsulesInternal(String id, CapsulesOverwriteInputV1 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 putCapsules");
        }
        // verify the required body parameter 'body' is set
        if (body == null) {
            throw new ApiException(400, "Missing the required body parameter 'body' when calling putCapsules");
        }
        // create path and map variables
        String localVarPath = "/conditions/{id}/capsules"
          .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, "PUT", 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 or update multiple conditions
    * 
    * @param body  (optional)
    * @return ItemBatchOutputV1
    * @throws ApiException if fails to make API call
    */
    public ItemBatchOutputV1 putConditions(ConditionBatchInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = putConditionsWithHttpInfo(body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Create or update multiple conditions
    * 
    * @param body  (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse putConditionsWithHttpInfo(ConditionBatchInputV1 body) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return putConditionsWithHeadersAndHttpInfo(body, localVarHeaderParams);
        
    }

    /**
    * Create or update multiple conditions
    * 
    * @param body  (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse putConditionsWithHeadersAndHttpInfo(ConditionBatchInputV1 body, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return putConditionsInternal(body, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse putConditionsInternal(ConditionBatchInputV1 body, List queryParams, Map headerParams) throws ApiException {
        Object localVarPostBody = body;
        // create path and map variables
        String localVarPath = "/conditions/batch";

        // 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
    }
    /**
    * Update an existing condition
    * 
    * @param id The id for the condition to be updated (required)
    * @param body  (required)
    * @return ConditionOutputV1
    * @throws ApiException if fails to make API call
    */
    public ConditionOutputV1 updateExistingCondition(String id, ConditionUpdateInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = updateExistingConditionWithHttpInfo(id, body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Update an existing condition
    * 
    * @param id The id for the condition to be updated (required)
    * @param body  (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse updateExistingConditionWithHttpInfo(String id, ConditionUpdateInputV1 body) throws ApiException {
        Map localVarHeaderParams = new HashMap();
        return updateExistingConditionWithHeadersAndHttpInfo(id, body, localVarHeaderParams);
        
    }

    /**
    * Update an existing condition
    * 
    * @param id The id for the condition to be updated (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 updateExistingConditionWithHeadersAndHttpInfo(String id, ConditionUpdateInputV1 body, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
                localVarHeaderParams.putAll(customHeaders);
        return updateExistingConditionInternal(id, body, localVarQueryParams, localVarHeaderParams);
    }
    
    private ApiClient.ApiResponse updateExistingConditionInternal(String id, ConditionUpdateInputV1 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 updateExistingCondition");
        }
        // verify the required body parameter 'body' is set
        if (body == null) {
            throw new ApiException(400, "Missing the required body parameter 'body' when calling updateExistingCondition");
        }
        // create path and map variables
        String localVarPath = "/conditions/{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 conditions
    *
    * @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 getConditions(Integer offset) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

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

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

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

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

        return getConditionsInternal(localVarQueryParams, localVarHeaderParams);
    }

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

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

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


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


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

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


        return getConditionsInternal(localVarQueryParams, localVarHeaderParams);
    }

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


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


    /**
    * Delete all capsules in a condition
    *
    * @param id The Seeq ID for the signal (required)
    * @return StatusMessageBase
    * @throws ApiException if fails to make API call
    */
    public StatusMessageBase deleteCapsules(String id) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


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

    /**
    * Delete all capsules in a condition
    * @param id The Seeq ID for the signal (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse deleteCapsulesWithHttpInfo(String id) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


        return deleteCapsulesInternal(id, localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Delete all capsules in a condition
    *
    * @param id The Seeq ID for the signal (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse deleteCapsulesWithHeadersAndHttpInfo(String id, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();


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


    /**
    * Get capsules from a condition
    *
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @param timeFormat The timestamp format. (optional)
    * @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional)
    * @return CapsulesOutputV1
    * @throws ApiException if fails to make API call
    */
    public CapsulesOutputV1 getCapsules(String id, String start, String end, String unitOfMeasure, String timeFormat, Integer limit) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

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

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

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

    /**
    * Get capsules from a condition
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @param timeFormat The timestamp format. (optional)
    * @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getCapsulesWithHttpInfo(String id, String start, String end, String unitOfMeasure, String timeFormat, Integer limit) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

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

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

        return getCapsulesInternal(id, localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get capsules from a condition
    *
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @param timeFormat The timestamp format. (optional)
    * @param limit The pagination limit, the total number of collection items 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 getCapsulesWithHeadersAndHttpInfo(String id, String start, String end, String unitOfMeasure, String timeFormat, Integer limit, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

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

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

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


    /**
    * Get capsules from a condition
    *
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @param timeFormat The timestamp format. (optional)
    * @return CapsulesOutputV1
    * @throws ApiException if fails to make API call
    */
    public CapsulesOutputV1 getCapsules(String id, String start, String end, String unitOfMeasure, String timeFormat) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

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

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

    /**
    * Get capsules from a condition
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @param timeFormat The timestamp format. (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getCapsulesWithHttpInfo(String id, String start, String end, String unitOfMeasure, String timeFormat) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

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

        return getCapsulesInternal(id, localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get capsules from a condition
    *
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @param timeFormat The timestamp format. (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getCapsulesWithHeadersAndHttpInfo(String id, String start, String end, String unitOfMeasure, String timeFormat, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

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

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


    /**
    * Get capsules from a condition
    *
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @return CapsulesOutputV1
    * @throws ApiException if fails to make API call
    */
    public CapsulesOutputV1 getCapsules(String id, String start, String end, String unitOfMeasure) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

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

    /**
    * Get capsules from a condition
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getCapsulesWithHttpInfo(String id, String start, String end, String unitOfMeasure) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

        return getCapsulesInternal(id, localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get capsules from a condition
    *
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param unitOfMeasure The unit of measure in which to return the condition's capsules' starts and ends. If none is supplied, the data is returned in the condition's default unit of measure. (optional)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getCapsulesWithHeadersAndHttpInfo(String id, String start, String end, String unitOfMeasure, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

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


    /**
    * Get capsules from a condition
    *
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @return CapsulesOutputV1
    * @throws ApiException if fails to make API call
    */
    public CapsulesOutputV1 getCapsules(String id, String start, String end) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

    /**
    * Get capsules from a condition
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getCapsulesWithHttpInfo(String id, String start, String end) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

        return getCapsulesInternal(id, localVarQueryParams, localVarHeaderParams);
    }

    /**
    * Get capsules from a condition
    *
    * @param id ID of the condition from which to retrieve capsules (required)
    * @param start A string representing the start of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param end A string representing the end of the range of the capsules to be returned. The contents vary based on the condition type. For time conditions: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). (required)
    * @param customHeaders a map with custom headers for the HTTP request (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getCapsulesWithHeadersAndHttpInfo(String id, String start, String end, Map customHeaders) throws ApiException {
        List localVarQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();

        if (start == null) {
            throw new ApiException(400, "Missing the required query parameter 'start' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));

        if (end == null) {
            throw new ApiException(400, "Missing the required query parameter 'end' when calling getCapsules");
        }
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));

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

// OVERLOADS END
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy