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.AssetBatchInputV1;
import com.seeq.model.AssetInputV1;
import com.seeq.model.AssetOutputV1;
import com.seeq.model.ItemBatchOutputV1;
import com.seeq.model.ItemPreviewListV1;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AssetsApi {
private ApiClient apiClient;
private long retryTimeout = 5_000; // Default of 5 seconds
public AssetsApi() {
this(Configuration.getDefaultApiClient());
}
public AssetsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public void setRetryTimeout(long retryTimeout) {
this.retryTimeout = retryTimeout;
}
public long getRetryTimeout() {
return this.retryTimeout;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Archive an asset
*
* @param id ID of the asset to archived (required)
* @return ArchiveOutputV1
* @throws ApiException if fails to make API call
*/
public ArchiveOutputV1 archiveAsset(String id) throws ApiException {
ApiClient.ApiResponse localVarResponse = archiveAssetWithHttpInfo(id);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Archive an asset
*
* @param id ID of the asset to archived (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse archiveAssetWithHttpInfo(String id) throws ApiException {
Map localVarHeaderParams = new HashMap();
return archiveAssetWithHeadersAndHttpInfo(id, localVarHeaderParams);
}
/**
* Archive an asset
*
* @param id ID of the asset to archived (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse archiveAssetWithHeadersAndHttpInfo(String id, Map customHeaders) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarHeaderParams.putAll(customHeaders);
return archiveAssetInternal(id, localVarQueryParams, localVarHeaderParams);
}
private ApiClient.ApiResponse archiveAssetInternal(String id, List queryParams, Map headerParams) throws ApiException {
Object localVarPostBody = null;
// verify the required path parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required path parameter 'id' when calling archiveAsset");
}
// create path and map variables
String localVarPath = "/assets/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "DELETE", queryParams, localVarPostBody, headerParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Create or update multiple assets at one time
*
* @param body (optional)
* @return ItemBatchOutputV1
* @throws ApiException if fails to make API call
*/
public ItemBatchOutputV1 batchCreateAssets(AssetBatchInputV1 body) throws ApiException {
ApiClient.ApiResponse localVarResponse = batchCreateAssetsWithHttpInfo(body);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Create or update multiple assets at one time
*
* @param body (optional)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse batchCreateAssetsWithHttpInfo(AssetBatchInputV1 body) throws ApiException {
Map localVarHeaderParams = new HashMap();
return batchCreateAssetsWithHeadersAndHttpInfo(body, localVarHeaderParams);
}
/**
* Create or update multiple assets at one time
*
* @param body (optional)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse batchCreateAssetsWithHeadersAndHttpInfo(AssetBatchInputV1 body, Map customHeaders) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarHeaderParams.putAll(customHeaders);
return batchCreateAssetsInternal(body, localVarQueryParams, localVarHeaderParams);
}
private ApiClient.ApiResponse batchCreateAssetsInternal(AssetBatchInputV1 body, List queryParams, Map headerParams) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/assets/batch";
// query params
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/vnd.seeq.v1+json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", queryParams, localVarPostBody, headerParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Create an asset
*
* @param body Asset information (required)
* @return AssetOutputV1
* @throws ApiException if fails to make API call
*/
public AssetOutputV1 createAsset(AssetInputV1 body) throws ApiException {
ApiClient.ApiResponse localVarResponse = createAssetWithHttpInfo(body);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Create an asset
*
* @param body Asset information (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse createAssetWithHttpInfo(AssetInputV1 body) throws ApiException {
Map localVarHeaderParams = new HashMap();
return createAssetWithHeadersAndHttpInfo(body, localVarHeaderParams);
}
/**
* Create an asset
*
* @param body Asset information (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse createAssetWithHeadersAndHttpInfo(AssetInputV1 body, Map customHeaders) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarHeaderParams.putAll(customHeaders);
return createAssetInternal(body, localVarQueryParams, localVarHeaderParams);
}
private ApiClient.ApiResponse createAssetInternal(AssetInputV1 body, List queryParams, Map headerParams) throws ApiException {
Object localVarPostBody = body;
// verify the required body parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required body parameter 'body' when calling createAsset");
}
// create path and map variables
String localVarPath = "/assets";
// query params
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/vnd.seeq.v1+json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", queryParams, localVarPostBody, headerParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Get an asset
*
* @param id ID of the asset to retrieve (required)
* @return AssetOutputV1
* @throws ApiException if fails to make API call
*/
public AssetOutputV1 getAsset(String id) throws ApiException {
ApiClient.ApiResponse localVarResponse = getAssetWithHttpInfo(id);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get an asset
*
* @param id ID of the asset to retrieve (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getAssetWithHttpInfo(String id) throws ApiException {
Map localVarHeaderParams = new HashMap();
return getAssetWithHeadersAndHttpInfo(id, localVarHeaderParams);
}
/**
* Get an asset
*
* @param id ID of the asset to retrieve (required)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getAssetWithHeadersAndHttpInfo(String id, Map customHeaders) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarHeaderParams.putAll(customHeaders);
return getAssetInternal(id, localVarQueryParams, localVarHeaderParams);
}
private ApiClient.ApiResponse getAssetInternal(String id, List queryParams, Map headerParams) throws ApiException {
Object localVarPostBody = null;
// verify the required path parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required path parameter 'id' when calling getAsset");
}
// create path and map variables
String localVarPath = "/assets/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", queryParams, localVarPostBody, headerParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Get a collection of assets
*
* @param scopedTo The ID of the workbook to which the items are scoped<br>If the scopedTo is set to the Empty GUID then the scoped items are excluded (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @return ItemPreviewListV1
* @throws ApiException if fails to make API call
*/
public ItemPreviewListV1 getAssets(String scopedTo, Integer offset, Integer limit) throws ApiException {
ApiClient.ApiResponse localVarResponse = getAssetsWithHttpInfo(scopedTo, offset, limit);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get a collection of assets
*
* @param scopedTo The ID of the workbook to which the items are scoped<br>If the scopedTo is set to the Empty GUID then the scoped items are excluded (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getAssetsWithHttpInfo(String scopedTo, Integer offset, Integer limit) throws ApiException {
Map localVarHeaderParams = new HashMap();
return getAssetsWithHeadersAndHttpInfo(scopedTo, offset, limit, localVarHeaderParams);
}
/**
* Get a collection of assets
*
* @param scopedTo The ID of the workbook to which the items are scoped<br>If the scopedTo is set to the Empty GUID then the scoped items are excluded (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getAssetsWithHeadersAndHttpInfo(String scopedTo, Integer offset, Integer limit, Map customHeaders) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "scopedTo", scopedTo));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
localVarHeaderParams.putAll(customHeaders);
return getAssetsInternal(localVarQueryParams, localVarHeaderParams);
}
private ApiClient.ApiResponse getAssetsInternal(List queryParams, Map headerParams) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/assets";
// query params
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", queryParams, localVarPostBody, headerParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
// OVERLOADS START
/**
* Get a collection of assets
*
* @param scopedTo The ID of the workbook to which the items are scopedIf the scopedTo is set to the Empty GUID then the scoped items are excluded (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional)
* @return ItemPreviewListV1
* @throws ApiException if fails to make API call
*/
public ItemPreviewListV1 getAssets(String scopedTo, Integer offset) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "scopedTo", scopedTo));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
ApiClient.ApiResponse localVarResponse = getAssetsInternal(localVarQueryParams, localVarHeaderParams);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get a collection of assets
* @param scopedTo The ID of the workbook to which the items are scopedIf the scopedTo is set to the Empty GUID then the scoped items are excluded (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getAssetsWithHttpInfo(String scopedTo, Integer offset) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "scopedTo", scopedTo));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
return getAssetsInternal(localVarQueryParams, localVarHeaderParams);
}
/**
* Get a collection of assets
*
* @param scopedTo The ID of the workbook to which the items are scopedIf the scopedTo is set to the Empty GUID then the scoped items are excluded (optional)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getAssetsWithHeadersAndHttpInfo(String scopedTo, Integer offset, Map customHeaders) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "scopedTo", scopedTo));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarHeaderParams.putAll(customHeaders);
return getAssetsInternal(localVarQueryParams, localVarHeaderParams);
}
/**
* Get a collection of assets
*
* @param scopedTo The ID of the workbook to which the items are scopedIf the scopedTo is set to the Empty GUID then the scoped items are excluded (optional)
* @return ItemPreviewListV1
* @throws ApiException if fails to make API call
*/
public ItemPreviewListV1 getAssets(String scopedTo) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "scopedTo", scopedTo));
ApiClient.ApiResponse localVarResponse = getAssetsInternal(localVarQueryParams, localVarHeaderParams);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get a collection of assets
* @param scopedTo The ID of the workbook to which the items are scopedIf the scopedTo is set to the Empty GUID then the scoped items are excluded (optional)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getAssetsWithHttpInfo(String scopedTo) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "scopedTo", scopedTo));
return getAssetsInternal(localVarQueryParams, localVarHeaderParams);
}
/**
* Get a collection of assets
*
* @param scopedTo The ID of the workbook to which the items are scopedIf the scopedTo is set to the Empty GUID then the scoped items are excluded (optional)
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getAssetsWithHeadersAndHttpInfo(String scopedTo, Map customHeaders) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "scopedTo", scopedTo));
localVarHeaderParams.putAll(customHeaders);
return getAssetsInternal(localVarQueryParams, localVarHeaderParams);
}
/**
* Get a collection of assets
*
*
* @return ItemPreviewListV1
* @throws ApiException if fails to make API call
*/
public ItemPreviewListV1 getAssets() throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
ApiClient.ApiResponse localVarResponse = getAssetsInternal(localVarQueryParams, localVarHeaderParams);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get a collection of assets
*
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getAssetsWithHttpInfo() throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
return getAssetsInternal(localVarQueryParams, localVarHeaderParams);
}
/**
* Get a collection of assets
*
*
* @param customHeaders a map with custom headers for the HTTP request (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getAssetsWithHeadersAndHttpInfo(Map customHeaders) throws ApiException {
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
localVarHeaderParams.putAll(customHeaders);
return getAssetsInternal(localVarQueryParams, localVarHeaderParams);
}
// OVERLOADS END
}