Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
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 {
Object localVarPostBody = body;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling addCapsules");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling addCapsules");
}
// create path and map variables
String localVarPath = "/conditions/{id}/capsules"
.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
}
/**
* 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 {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling archiveCondition");
}
// create path and map variables
String localVarPath = "/conditions/{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, "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
}
/**
* 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 {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling createCondition");
}
// create path and map variables
String localVarPath = "/conditions";
// 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
}
/**
* 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 {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling deleteCapsules");
}
// create path and map variables
String localVarPath = "/conditions/{id}/capsules"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "clearCapsuleProperties", clearCapsuleProperties));
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 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 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)
* @return CapsulesOutputV1
* @throws ApiException if fails to make API call
*/
public CapsulesOutputV1 getCapsules(String id, String start, String end, String unitOfMeasure, String timeFormat, Integer offset, Integer limit) throws ApiException {
ApiClient.ApiResponse localVarResponse = getCapsulesWithHttpInfo(id, start, end, unitOfMeasure, timeFormat, offset, limit);
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 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)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getCapsulesWithHttpInfo(String id, String start, String end, String unitOfMeasure, String timeFormat, Integer offset, Integer limit) 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 getCapsules");
}
// verify the required parameter 'start' is set
if (start == null) {
throw new ApiException(400, "Missing the required parameter 'start' when calling getCapsules");
}
// verify the required parameter 'end' is set
if (end == null) {
throw new ApiException(400, "Missing the required parameter 'end' when calling getCapsules");
}
// create path and map variables
String localVarPath = "/conditions/{id}/capsules"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// 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("", "unitOfMeasure", unitOfMeasure));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "timeFormat", timeFormat));
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 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 {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getCondition");
}
// create path and map variables
String localVarPath = "/conditions/{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 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 {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/conditions";
// 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
}
/**
* 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 {
Object localVarPostBody = body;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling putCapsules");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling putCapsules");
}
// create path and map variables
String localVarPath = "/conditions/{id}/capsules"
.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, "PUT", 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 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 {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/conditions/batch";
// 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 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 {
Object localVarPostBody = body;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling updateExistingCondition");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling updateExistingCondition");
}
// create path and map variables
String localVarPath = "/conditions/{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
}
}