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

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

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

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

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

import com.seeq.model.CalculatedItemOutputV1;
import com.seeq.model.FormulaCompileOutputV1;
import com.seeq.model.FormulaDocInputV1;
import com.seeq.model.FormulaDocOutputV1;
import com.seeq.model.FormulaDocSummariesOutputV1;
import com.seeq.model.FormulaErrorOutputV1;
import com.seeq.model.FormulaItemInputV1;
import com.seeq.model.FormulaItemOutputV1;
import com.seeq.model.FormulaPackageImportInputV1;
import com.seeq.model.FormulaPackageImportOutputV1;
import com.seeq.model.FormulaPackageInputV1;
import com.seeq.model.FormulaPackageOutputV1;
import com.seeq.model.FormulaRunInputV1;
import com.seeq.model.FormulaRunOutputV1;
import com.seeq.model.FunctionInputV1;
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 FormulasApi {
  private ApiClient apiClient;
  private long retryTimeout = 5_000; // Default of 5 seconds

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

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

    /**
    * Clear all formula caches
    * 
      * @return StatusMessageBase
    * @throws ApiException if fails to make API call
    */
    public StatusMessageBase clearCache() throws ApiException {
        ApiClient.ApiResponse localVarResponse = clearCacheWithHttpInfo();
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Clear all formula caches
    * 
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse clearCacheWithHttpInfo() throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/formulas/clearCache";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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
      }
    /**
    * Compile a Seeq Formula
    * 
      * @param formula A formula to be applied to the data from the series. The formula should reference the series using the $series variable. Formulas can be used to retrieve an aggregate. Examples: return $series.min(), return $series.sum(). Ignored for numeric (non-time) series. (optional)
      * @param parameters Parameters for the formula. Each parameter should have a format of 'name=id' where 'name' is the variable identifier, without the leading $ sign, and 'id' is the ID of the item referenced by the variable. (optional)
      * @return FormulaCompileOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaCompileOutputV1 compileFormula(String formula, List parameters) throws ApiException {
        ApiClient.ApiResponse localVarResponse = compileFormulaWithHttpInfo(formula, parameters);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Compile a Seeq Formula
    * 
      * @param formula A formula to be applied to the data from the series. The formula should reference the series using the $series variable. Formulas can be used to retrieve an aggregate. Examples: return $series.min(), return $series.sum(). Ignored for numeric (non-time) series. (optional)
      * @param parameters Parameters for the formula. Each parameter should have a format of 'name=id' where 'name' is the variable identifier, without the leading $ sign, and 'id' is the ID of the item referenced by the variable. (optional)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse compileFormulaWithHttpInfo(String formula, List parameters) throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/formulas/compile";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();

      localVarQueryParams.addAll(apiClient.parameterToPairs("", "formula", formula));
      localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "parameters", parameters));

    
    
      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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 function
    * 
      * @param body Function information (required)
      * @return CalculatedItemOutputV1
    * @throws ApiException if fails to make API call
    */
    public CalculatedItemOutputV1 createFunction(FunctionInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = createFunctionWithHttpInfo(body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Create a function
    * 
      * @param body Function information (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse createFunctionWithHttpInfo(FunctionInputV1 body) throws ApiException {
    Object localVarPostBody = body;
      // verify the required parameter 'body' is set
      if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling createFunction");
      }
    // create path and map variables
    String localVarPath = "/formulas/functions";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 formula item
    * 
      * @param body Item information (required)
      * @return FormulaItemOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaItemOutputV1 createItem(FormulaItemInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = createItemWithHttpInfo(body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Create a formula item
    * 
      * @param body Item information (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse createItemWithHttpInfo(FormulaItemInputV1 body) throws ApiException {
    Object localVarPostBody = body;
      // verify the required parameter 'body' is set
      if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling createItem");
      }
    // create path and map variables
    String localVarPath = "/formulas/items";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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
      }
    /**
    * Permanently delete the specified formula doc
    * 
      * @param packageName The name of the package (required)
      * @param docName The name of the formula doc (required)
      * @return StatusMessageBase
    * @throws ApiException if fails to make API call
    */
    public StatusMessageBase deleteFormulaDoc(String packageName, String docName) throws ApiException {
        ApiClient.ApiResponse localVarResponse = deleteFormulaDocWithHttpInfo(packageName, docName);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Permanently delete the specified formula doc
    * 
      * @param packageName The name of the package (required)
      * @param docName The name of the formula doc (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse deleteFormulaDocWithHttpInfo(String packageName, String docName) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'packageName' is set
      if (packageName == null) {
      throw new ApiException(400, "Missing the required parameter 'packageName' when calling deleteFormulaDoc");
      }
      // verify the required parameter 'docName' is set
      if (docName == null) {
      throw new ApiException(400, "Missing the required parameter 'docName' when calling deleteFormulaDoc");
      }
    // create path and map variables
    String localVarPath = "/formulas/docs/{packageName}/{docName}"
      .replaceAll("\\{" + "packageName" + "\\}", apiClient.escapeString(packageName.toString()))
      .replaceAll("\\{" + "docName" + "\\}", apiClient.escapeString(docName.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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
      }
    /**
    * Permanently delete a specific package
    * 
      * @param packageName The name of the package (required)
      * @return StatusMessageBase
    * @throws ApiException if fails to make API call
    */
    public StatusMessageBase deletePackage(String packageName) throws ApiException {
        ApiClient.ApiResponse localVarResponse = deletePackageWithHttpInfo(packageName);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Permanently delete a specific package
    * 
      * @param packageName The name of the package (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse deletePackageWithHttpInfo(String packageName) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'packageName' is set
      if (packageName == null) {
      throw new ApiException(400, "Missing the required parameter 'packageName' when calling deletePackage");
      }
    // create path and map variables
    String localVarPath = "/formulas/packages/{packageName}"
      .replaceAll("\\{" + "packageName" + "\\}", apiClient.escapeString(packageName.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 constants available for use in a calculation
    * 
      * @return List<String>
    * @throws ApiException if fails to make API call
    */
    public List getConstantNameList() throws ApiException {
        ApiClient.ApiResponse> localVarResponse = getConstantNameListWithHttpInfo();
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a list of the constants available for use in a calculation
    * 
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse> getConstantNameListWithHttpInfo() throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/formulas/docs/constants";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 documentation details about a specific function group or index
    * 
      * @param packageName The name of the package (required)
      * @param docName The name of the document for the desired function or index (required)
      * @return FormulaDocOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaDocOutputV1 getFormulaDoc(String packageName, String docName) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getFormulaDocWithHttpInfo(packageName, docName);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get documentation details about a specific function group or index
    * 
      * @param packageName The name of the package (required)
      * @param docName The name of the document for the desired function or index (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getFormulaDocWithHttpInfo(String packageName, String docName) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'packageName' is set
      if (packageName == null) {
      throw new ApiException(400, "Missing the required parameter 'packageName' when calling getFormulaDoc");
      }
      // verify the required parameter 'docName' is set
      if (docName == null) {
      throw new ApiException(400, "Missing the required parameter 'docName' when calling getFormulaDoc");
      }
    // create path and map variables
    String localVarPath = "/formulas/docs/{packageName}/{docName}"
      .replaceAll("\\{" + "packageName" + "\\}", apiClient.escapeString(packageName.toString()))
      .replaceAll("\\{" + "docName" + "\\}", apiClient.escapeString(docName.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 functions available for use in a calculation
    * 
      * @return FormulaDocSummariesOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaDocSummariesOutputV1 getFormulaDocs() throws ApiException {
        ApiClient.ApiResponse localVarResponse = getFormulaDocsWithHttpInfo();
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a list of the functions available for use in a calculation
    * 
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getFormulaDocsWithHttpInfo() throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/formulas/docs";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 Formula Functions
    * 
      * @param type The type of Formula Functions that should be included. Valid options are FormulaFunction, AggregatingFormulaFunction, Chart, and UserDefinedFormulaFunction (optional, default to FormulaFunction)
      * @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 getFormulaFunctions(String type, Integer offset, Integer limit) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getFormulaFunctionsWithHttpInfo(type, offset, limit);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a collection of Formula Functions
    * 
      * @param type The type of Formula Functions that should be included. Valid options are FormulaFunction, AggregatingFormulaFunction, Chart, and UserDefinedFormulaFunction (optional, default to FormulaFunction)
      * @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 getFormulaFunctionsWithHttpInfo(String type, Integer offset, Integer limit) throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/formulas/functions";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();

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

    
    
      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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 Formula Function
    * 
      * @param id ID of the function (required)
      * @return CalculatedItemOutputV1
    * @throws ApiException if fails to make API call
    */
    public CalculatedItemOutputV1 getFunction(String id) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getFunctionWithHttpInfo(id);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a Formula Function
    * 
      * @param id ID of the function (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getFunctionWithHttpInfo(String id) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'id' is set
      if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling getFunction");
      }
    // create path and map variables
    String localVarPath = "/formulas/functions/{id}"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 Formula Item
    * 
      * @param id ID of the item (required)
      * @return FormulaItemOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaItemOutputV1 getItem(String id) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getItemWithHttpInfo(id);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a Formula Item
    * 
      * @param id ID of the item (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getItemWithHttpInfo(String id) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'id' is set
      if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling getItem");
      }
    // create path and map variables
    String localVarPath = "/formulas/items/{id}"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 details of a specific package
    * 
      * @param packageName The name of the package (required)
      * @return FormulaPackageOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaPackageOutputV1 getPackage(String packageName) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getPackageWithHttpInfo(packageName);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get details of a specific package
    * 
      * @param packageName The name of the package (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse getPackageWithHttpInfo(String packageName) throws ApiException {
    Object localVarPostBody = null;
      // verify the required parameter 'packageName' is set
      if (packageName == null) {
      throw new ApiException(400, "Missing the required parameter 'packageName' when calling getPackage");
      }
    // create path and map variables
    String localVarPath = "/formulas/packages/{packageName}"
      .replaceAll("\\{" + "packageName" + "\\}", apiClient.escapeString(packageName.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 packages
    * 
      * @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 getPackages(Integer offset, Integer limit) throws ApiException {
        ApiClient.ApiResponse localVarResponse = getPackagesWithHttpInfo(offset, limit);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Get a collection of packages
    * 
      * @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 getPackagesWithHttpInfo(Integer offset, Integer limit) throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/formulas/packages";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();

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

    
    
      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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 a package of UDFs with documentation.
    * 
      * @param body Complete package specifications to sync (required)
      * @return FormulaPackageImportOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaPackageImportOutputV1 importPackage(FormulaPackageImportInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = importPackageWithHttpInfo(body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Create or update a package of UDFs with documentation.
    * 
      * @param body Complete package specifications to sync (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse importPackageWithHttpInfo(FormulaPackageImportInputV1 body) throws ApiException {
    Object localVarPostBody = body;
      // verify the required parameter 'body' is set
      if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling importPackage");
      }
    // create path and map variables
    String localVarPath = "/formulas/packages/import";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 the specified formula doc
    * 
      * @param packageName The name of the package (required)
      * @param docName The name of the document for the desired function or index (required)
      * @param body The details of the formula doc to create or update (required)
      * @return FormulaDocOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaDocOutputV1 putFormulaDoc(String packageName, String docName, FormulaDocInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = putFormulaDocWithHttpInfo(packageName, docName, body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Create or update the specified formula doc
    * 
      * @param packageName The name of the package (required)
      * @param docName The name of the document for the desired function or index (required)
      * @param body The details of the formula doc to create or update (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse putFormulaDocWithHttpInfo(String packageName, String docName, FormulaDocInputV1 body) throws ApiException {
    Object localVarPostBody = body;
      // verify the required parameter 'packageName' is set
      if (packageName == null) {
      throw new ApiException(400, "Missing the required parameter 'packageName' when calling putFormulaDoc");
      }
      // verify the required parameter 'docName' is set
      if (docName == null) {
      throw new ApiException(400, "Missing the required parameter 'docName' when calling putFormulaDoc");
      }
      // verify the required parameter 'body' is set
      if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling putFormulaDoc");
      }
    // create path and map variables
    String localVarPath = "/formulas/docs/{packageName}/{docName}"
      .replaceAll("\\{" + "packageName" + "\\}", apiClient.escapeString(packageName.toString()))
      .replaceAll("\\{" + "docName" + "\\}", apiClient.escapeString(docName.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 a package
    * 
      * @param packageName The name of the package (required)
      * @param body  (required)
      * @return FormulaPackageOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaPackageOutputV1 putPackage(String packageName, FormulaPackageInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = putPackageWithHttpInfo(packageName, body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Create or update a package
    * 
      * @param packageName The name of the package (required)
      * @param body  (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse putPackageWithHttpInfo(String packageName, FormulaPackageInputV1 body) throws ApiException {
    Object localVarPostBody = body;
      // verify the required parameter 'packageName' is set
      if (packageName == null) {
      throw new ApiException(400, "Missing the required parameter 'packageName' when calling putPackage");
      }
      // verify the required parameter 'body' is set
      if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling putPackage");
      }
    // create path and map variables
    String localVarPath = "/formulas/packages/{packageName}"
      .replaceAll("\\{" + "packageName" + "\\}", apiClient.escapeString(packageName.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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
      }
    /**
    * Run a Seeq Formula
    * 
      * @param start A string representing the starting index of the data to be returned. The contents and whether or not it is required depends on the result type. For time series: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). For numeric (non-time) series: a double-precision number, optionally including units. For example: \"2.5ft\" or \"10 °C\". (optional)
      * @param end A string representing the starting index of the data to be returned. The contents and whether or not it is required depends on the result type. For time series: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). For numeric (non-time) series: a double-precision number, optionally including units. For example: \"2.5ft\" or \"10 °C\". (optional)
      * @param formula The formula to be applied. This or function is required. (optional)
      * @param function The ID of the function item to be computed. This or formula is required. (optional)
      * @param parameters Parameters for the formula. Each parameter should have a format of 'name=value' where 'name' is the variable identifier, without the leading $ sign, and 'value' is the ID of an item or one of the following parameter expressions that can be used to access the properties of other items that are parameters: $signal.property('name') to access any property on an item, $signal.parentProperty('name') can be used if an item is in a tree to to access any property on the parent, and $signal.ancestors(', ') to return a list of all the ancestors, separated by the specified separator. In all of the above examples 'signal' would need to be another parameter that references an item using an ID. (optional)
      * @param fragments Formula fragments for unbound inputs the function. Each parameter should have a format of 'name=formula' where 'name' is the variable identifier, without the leading $ sign, and 'formula' is a self-contained formula fragment (optional)
      * @param root Used to run a formula across assets, this is the ID of the root asset whose immediate children will be iterated. The formula must produce a table. (optional)
      * @param reduceFormula Used when running a formula across assets, this is a formula that can further reduce the results of each asset result. The variable $result must be used to reference the data. Example of sorting the aggregated results: $result.sort('temperature')' (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 1000)
      * @param timeFormat  (optional, default to Legacy)
      * @return FormulaRunOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaRunOutputV1 runFormula(String start, String end, String formula, String function, List parameters, List fragments, String root, String reduceFormula, Integer offset, Integer limit, String timeFormat) throws ApiException {
        ApiClient.ApiResponse localVarResponse = runFormulaWithHttpInfo(start, end, formula, function, parameters, fragments, root, reduceFormula, offset, limit, timeFormat);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Run a Seeq Formula
    * 
      * @param start A string representing the starting index of the data to be returned. The contents and whether or not it is required depends on the result type. For time series: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). For numeric (non-time) series: a double-precision number, optionally including units. For example: \"2.5ft\" or \"10 °C\". (optional)
      * @param end A string representing the starting index of the data to be returned. The contents and whether or not it is required depends on the result type. For time series: a ISO 8601 timestamp (YYYY-MM-DDThh:mm:ss.sssssssss±hh:mm). For numeric (non-time) series: a double-precision number, optionally including units. For example: \"2.5ft\" or \"10 °C\". (optional)
      * @param formula The formula to be applied. This or function is required. (optional)
      * @param function The ID of the function item to be computed. This or formula is required. (optional)
      * @param parameters Parameters for the formula. Each parameter should have a format of 'name=value' where 'name' is the variable identifier, without the leading $ sign, and 'value' is the ID of an item or one of the following parameter expressions that can be used to access the properties of other items that are parameters: $signal.property('name') to access any property on an item, $signal.parentProperty('name') can be used if an item is in a tree to to access any property on the parent, and $signal.ancestors(', ') to return a list of all the ancestors, separated by the specified separator. In all of the above examples 'signal' would need to be another parameter that references an item using an ID. (optional)
      * @param fragments Formula fragments for unbound inputs the function. Each parameter should have a format of 'name=formula' where 'name' is the variable identifier, without the leading $ sign, and 'formula' is a self-contained formula fragment (optional)
      * @param root Used to run a formula across assets, this is the ID of the root asset whose immediate children will be iterated. The formula must produce a table. (optional)
      * @param reduceFormula Used when running a formula across assets, this is a formula that can further reduce the results of each asset result. The variable $result must be used to reference the data. Example of sorting the aggregated results: $result.sort('temperature')' (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 1000)
      * @param timeFormat  (optional, default to Legacy)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse runFormulaWithHttpInfo(String start, String end, String formula, String function, List parameters, List fragments, String root, String reduceFormula, Integer offset, Integer limit, String timeFormat) throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/formulas/run";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarFormParams = new HashMap();

      localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "formula", formula));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "function", function));
      localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "parameters", parameters));
      localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "fragments", fragments));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "root", root));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "reduceFormula", reduceFormula));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
      localVarQueryParams.addAll(apiClient.parameterToPairs("", "timeFormat", timeFormat));

    
    
      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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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
      }
    /**
    * Run a Seeq Formula.
    * 
      * @param body Seeq Formula information (required)
      * @return FormulaRunOutputV1
    * @throws ApiException if fails to make API call
    */
    public FormulaRunOutputV1 runFormula_0(FormulaRunInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = runFormula_0WithHttpInfo(body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Run a Seeq Formula.
    * 
      * @param body Seeq Formula information (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse runFormula_0WithHttpInfo(FormulaRunInputV1 body) throws ApiException {
    Object localVarPostBody = body;
      // verify the required parameter 'body' is set
      if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling runFormula_0");
      }
    // create path and map variables
    String localVarPath = "/formulas/run";

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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 function
    * 
      * @param id ID of the function to update (required)
      * @param body Function information (required)
      * @return CalculatedItemOutputV1
    * @throws ApiException if fails to make API call
    */
    public CalculatedItemOutputV1 updateFunction(String id, FunctionInputV1 body) throws ApiException {
        ApiClient.ApiResponse localVarResponse = updateFunctionWithHttpInfo(id, body);
        return localVarResponse != null ? localVarResponse.getData() : null;
    }
    
    /**
    * Update a function
    * 
      * @param id ID of the function to update (required)
      * @param body Function information (required)
    * @throws ApiException if fails to make API call
    */
    public ApiClient.ApiResponse updateFunctionWithHttpInfo(String id, FunctionInputV1 body) throws ApiException {
    Object localVarPostBody = body;
      // verify the required parameter 'id' is set
      if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling updateFunction");
      }
      // verify the required parameter 'body' is set
      if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling updateFunction");
      }
    // create path and map variables
    String localVarPath = "/formulas/functions/{id}"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    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", localVarQueryParams, localVarPostBody, localVarHeaderParams, 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
      }
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy