com.dominodatalab.api.rest.DatasetRwApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of domino-java-client Show documentation
Show all versions of domino-java-client Show documentation
Domino Data Lab API Client to connect to Domino web services using Java HTTP Client.
/*
* Domino Data Lab API v4
* This API provides access to select Domino functions available in Domino's non-public API. To authenticate your requests, include your API Key (which you can find on your account page) with the header X-Domino-Api-Key.
*
* The version of the OpenAPI document: 4.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.dominodatalab.api.rest;
import com.dominodatalab.api.invoker.ApiClient;
import com.dominodatalab.api.invoker.ApiException;
import com.dominodatalab.api.invoker.ApiResponse;
import com.dominodatalab.api.invoker.Pair;
import com.dominodatalab.api.model.DominoDatasetrwApiDatasetRwDto;
import com.dominodatalab.api.model.DominoDatasetrwApiDatasetRwGrant;
import com.dominodatalab.api.model.DominoDatasetrwApiDatasetRwGrantDetails;
import com.dominodatalab.api.model.DominoDatasetrwApiDatasetRwInfoDto;
import com.dominodatalab.api.model.DominoDatasetrwApiDatasetRwProjectMountDto;
import com.dominodatalab.api.model.DominoDatasetrwApiDatasetRwSnapshotDto;
import com.dominodatalab.api.model.DominoDatasetrwApiDatasetRwSnapshotFilesViewDto;
import com.dominodatalab.api.model.DominoDatasetrwApiDatasetRwSnapshotSummaryDto;
import com.dominodatalab.api.model.DominoDatasetrwApiDatasetRwViewDto;
import com.dominodatalab.api.model.DominoDatasetrwApiSharedDatasetRwEntryDto;
import com.dominodatalab.api.model.DominoDatasetrwWebCreateDatasetRequest;
import com.dominodatalab.api.model.DominoDatasetrwWebUpdateDatasetGrantsRequest;
import com.dominodatalab.api.model.DominoDatasetrwWebUpdateSnapshotStatusRequest;
import com.dominodatalab.api.model.Error;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.InputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.http.HttpRequest;
import java.nio.channels.Channels;
import java.nio.channels.Pipe;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.util.ArrayList;
import java.util.StringJoiner;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-04T16:37:26.309454-04:00[America/New_York]", comments = "Generator version: 7.8.0")
public class DatasetRwApi {
protected final HttpClient memberVarHttpClient;
protected final ObjectMapper memberVarObjectMapper;
protected final String memberVarBaseUri;
protected final Consumer memberVarInterceptor;
protected final Duration memberVarReadTimeout;
protected final Consumer> memberVarResponseInterceptor;
protected final Consumer> memberVarAsyncResponseInterceptor;
public DatasetRwApi() {
this(new ApiClient());
}
public DatasetRwApi(ApiClient apiClient) {
memberVarHttpClient = apiClient.getHttpClient();
memberVarObjectMapper = apiClient.getObjectMapper();
memberVarBaseUri = apiClient.getBaseUri();
memberVarInterceptor = apiClient.getRequestInterceptor();
memberVarReadTimeout = apiClient.getReadTimeout();
memberVarResponseInterceptor = apiClient.getResponseInterceptor();
memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor();
}
protected ApiException getApiException(String operationId, HttpResponse response) throws IOException {
String body = response.body() == null ? null : new String(response.body().readAllBytes());
String message = formatExceptionMessage(operationId, response.statusCode(), body);
return new ApiException(response.statusCode(), message, response.headers(), body);
}
protected String formatExceptionMessage(String operationId, int statusCode, String body) {
if (body == null || body.isEmpty()) {
body = "[no body]";
}
return operationId + " call failed with: " + statusCode + " - " + body;
}
/**
* Add shared dataset to project
*
* @param projectId Project ID (required)
* @param datasetId Dataset ID (required)
* @return DominoDatasetrwApiSharedDatasetRwEntryDto
* @throws ApiException if fails to make API call
*/
public DominoDatasetrwApiSharedDatasetRwEntryDto addSharedDatasetRwEntry(String projectId, String datasetId) throws ApiException {
ApiResponse localVarResponse = addSharedDatasetRwEntryWithHttpInfo(projectId, datasetId);
return localVarResponse.getData();
}
/**
* Add shared dataset to project
*
* @param projectId Project ID (required)
* @param datasetId Dataset ID (required)
* @return ApiResponse<DominoDatasetrwApiSharedDatasetRwEntryDto>
* @throws ApiException if fails to make API call
*/
public ApiResponse addSharedDatasetRwEntryWithHttpInfo(String projectId, String datasetId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = addSharedDatasetRwEntryRequestBuilder(projectId, datasetId);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("addSharedDatasetRwEntry", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder addSharedDatasetRwEntryRequestBuilder(String projectId, String datasetId) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling addSharedDatasetRwEntry");
}
// verify the required parameter 'datasetId' is set
if (datasetId == null) {
throw new ApiException(400, "Missing the required parameter 'datasetId' when calling addSharedDatasetRwEntry");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/{projectId}/shared/{datasetId}"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
.replace("{datasetId}", ApiClient.urlEncode(datasetId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Deprecated - Use the /layout/complete endpoint with the workFlowID \"CreateDataset\" or use the public create endpoint. Create dataset
*
* @param dominoDatasetrwWebCreateDatasetRequest dataset spec to persist (required)
* @return DominoDatasetrwApiDatasetRwViewDto
* @throws ApiException if fails to make API call
*/
public DominoDatasetrwApiDatasetRwViewDto createDataset(DominoDatasetrwWebCreateDatasetRequest dominoDatasetrwWebCreateDatasetRequest) throws ApiException {
ApiResponse localVarResponse = createDatasetWithHttpInfo(dominoDatasetrwWebCreateDatasetRequest);
return localVarResponse.getData();
}
/**
* Deprecated - Use the /layout/complete endpoint with the workFlowID \"CreateDataset\" or use the public create endpoint. Create dataset
*
* @param dominoDatasetrwWebCreateDatasetRequest dataset spec to persist (required)
* @return ApiResponse<DominoDatasetrwApiDatasetRwViewDto>
* @throws ApiException if fails to make API call
*/
public ApiResponse createDatasetWithHttpInfo(DominoDatasetrwWebCreateDatasetRequest dominoDatasetrwWebCreateDatasetRequest) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = createDatasetRequestBuilder(dominoDatasetrwWebCreateDatasetRequest);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("createDataset", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder createDatasetRequestBuilder(DominoDatasetrwWebCreateDatasetRequest dominoDatasetrwWebCreateDatasetRequest) throws ApiException {
// verify the required parameter 'dominoDatasetrwWebCreateDatasetRequest' is set
if (dominoDatasetrwWebCreateDatasetRequest == null) {
throw new ApiException(400, "Missing the required parameter 'dominoDatasetrwWebCreateDatasetRequest' when calling createDataset");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw";
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoDatasetrwWebCreateDatasetRequest);
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
} catch (IOException e) {
throw new ApiException(e);
}
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Delete Snapshot
*
* @param snapshotId Snapshot ID (required)
* @return DominoDatasetrwApiDatasetRwSnapshotDto
* @throws ApiException if fails to make API call
*/
public DominoDatasetrwApiDatasetRwSnapshotDto deleteDatasetSnapshot(String snapshotId) throws ApiException {
ApiResponse localVarResponse = deleteDatasetSnapshotWithHttpInfo(snapshotId);
return localVarResponse.getData();
}
/**
* Delete Snapshot
*
* @param snapshotId Snapshot ID (required)
* @return ApiResponse<DominoDatasetrwApiDatasetRwSnapshotDto>
* @throws ApiException if fails to make API call
*/
public ApiResponse deleteDatasetSnapshotWithHttpInfo(String snapshotId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = deleteDatasetSnapshotRequestBuilder(snapshotId);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("deleteDatasetSnapshot", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder deleteDatasetSnapshotRequestBuilder(String snapshotId) throws ApiException {
// verify the required parameter 'snapshotId' is set
if (snapshotId == null) {
throw new ApiException(400, "Missing the required parameter 'snapshotId' when calling deleteDatasetSnapshot");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/snapshot/{snapshotId}"
.replace("{snapshotId}", ApiClient.urlEncode(snapshotId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Download archive file from Domino to local
*
* @param snapshotId Id of the dataset snapshot where files are downloaded from (required)
* @param taskKey Key of the download task to be polled (required)
* @return java.io.InputStream
* @throws ApiException if fails to make API call
*/
public java.io.InputStream downloadArchiveToLocal(String snapshotId, String taskKey) throws ApiException {
ApiResponse localVarResponse = downloadArchiveToLocalWithHttpInfo(snapshotId, taskKey);
return localVarResponse.getData();
}
/**
* Download archive file from Domino to local
*
* @param snapshotId Id of the dataset snapshot where files are downloaded from (required)
* @param taskKey Key of the download task to be polled (required)
* @return ApiResponse<java.io.InputStream>
* @throws ApiException if fails to make API call
*/
public ApiResponse downloadArchiveToLocalWithHttpInfo(String snapshotId, String taskKey) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = downloadArchiveToLocalRequestBuilder(snapshotId, taskKey);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("downloadArchiveToLocal", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder downloadArchiveToLocalRequestBuilder(String snapshotId, String taskKey) throws ApiException {
// verify the required parameter 'snapshotId' is set
if (snapshotId == null) {
throw new ApiException(400, "Missing the required parameter 'snapshotId' when calling downloadArchiveToLocal");
}
// verify the required parameter 'taskKey' is set
if (taskKey == null) {
throw new ApiException(400, "Missing the required parameter 'taskKey' when calling downloadArchiveToLocal");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/snapshot/{snapshotId}/download-local/{taskKey}"
.replace("{snapshotId}", ApiClient.urlEncode(snapshotId.toString()))
.replace("{taskKey}", ApiClient.urlEncode(taskKey.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Lookup dataset by id
*
* @param datasetId Dataset ID (required)
* @return DominoDatasetrwApiDatasetRwDto
* @throws ApiException if fails to make API call
*/
public DominoDatasetrwApiDatasetRwDto getDataset(String datasetId) throws ApiException {
ApiResponse localVarResponse = getDatasetWithHttpInfo(datasetId);
return localVarResponse.getData();
}
/**
* Lookup dataset by id
*
* @param datasetId Dataset ID (required)
* @return ApiResponse<DominoDatasetrwApiDatasetRwDto>
* @throws ApiException if fails to make API call
*/
public ApiResponse getDatasetWithHttpInfo(String datasetId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getDatasetRequestBuilder(datasetId);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getDataset", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder getDatasetRequestBuilder(String datasetId) throws ApiException {
// verify the required parameter 'datasetId' is set
if (datasetId == null) {
throw new ApiException(400, "Missing the required parameter 'datasetId' when calling getDataset");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/datasets/{datasetId}"
.replace("{datasetId}", ApiClient.urlEncode(datasetId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* gets dataset's current dataset's grants details
*
* @param datasetId Dataset ID (required)
* @return List<DominoDatasetrwApiDatasetRwGrantDetails>
* @throws ApiException if fails to make API call
*/
public List getDatasetGrants(String datasetId) throws ApiException {
ApiResponse> localVarResponse = getDatasetGrantsWithHttpInfo(datasetId);
return localVarResponse.getData();
}
/**
* gets dataset's current dataset's grants details
*
* @param datasetId Dataset ID (required)
* @return ApiResponse<List<DominoDatasetrwApiDatasetRwGrantDetails>>
* @throws ApiException if fails to make API call
*/
public ApiResponse> getDatasetGrantsWithHttpInfo(String datasetId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getDatasetGrantsRequestBuilder(datasetId);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getDatasetGrants", localVarResponse);
}
return new ApiResponse>(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder getDatasetGrantsRequestBuilder(String datasetId) throws ApiException {
// verify the required parameter 'datasetId' is set
if (datasetId == null) {
throw new ApiException(400, "Missing the required parameter 'datasetId' when calling getDatasetGrants");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/dataset/{datasetId}/grants"
.replace("{datasetId}", ApiClient.urlEncode(datasetId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Get Datasets
*
* @param includeProjectInfo boolean to request project level info (optional)
* @param includeHasProjectAccess boolean to request whether principal has access within a project (optional)
* @param minimumPermission minimum dataset rw permission to check for (optional)
* @param projectIdsToExclude project IDs to exclude datasets from (optional
* @param projectIdsToInclude project IDs to search datasets from (optional
* @return List<DominoDatasetrwApiDatasetRwInfoDto>
* @throws ApiException if fails to make API call
*/
public List getDatasetsV2(Boolean includeProjectInfo, Boolean includeHasProjectAccess, String minimumPermission, List projectIdsToExclude, List projectIdsToInclude) throws ApiException {
ApiResponse> localVarResponse = getDatasetsV2WithHttpInfo(includeProjectInfo, includeHasProjectAccess, minimumPermission, projectIdsToExclude, projectIdsToInclude);
return localVarResponse.getData();
}
/**
* Get Datasets
*
* @param includeProjectInfo boolean to request project level info (optional)
* @param includeHasProjectAccess boolean to request whether principal has access within a project (optional)
* @param minimumPermission minimum dataset rw permission to check for (optional)
* @param projectIdsToExclude project IDs to exclude datasets from (optional
* @param projectIdsToInclude project IDs to search datasets from (optional
* @return ApiResponse<List<DominoDatasetrwApiDatasetRwInfoDto>>
* @throws ApiException if fails to make API call
*/
public ApiResponse> getDatasetsV2WithHttpInfo(Boolean includeProjectInfo, Boolean includeHasProjectAccess, String minimumPermission, List projectIdsToExclude, List projectIdsToInclude) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getDatasetsV2RequestBuilder(includeProjectInfo, includeHasProjectAccess, minimumPermission, projectIdsToExclude, projectIdsToInclude);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getDatasetsV2", localVarResponse);
}
return new ApiResponse>(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder getDatasetsV2RequestBuilder(Boolean includeProjectInfo, Boolean includeHasProjectAccess, String minimumPermission, List projectIdsToExclude, List projectIdsToInclude) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/datasets-v2";
List localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "includeProjectInfo";
localVarQueryParams.addAll(ApiClient.parameterToPairs("includeProjectInfo", includeProjectInfo));
localVarQueryParameterBaseName = "includeHasProjectAccess";
localVarQueryParams.addAll(ApiClient.parameterToPairs("includeHasProjectAccess", includeHasProjectAccess));
localVarQueryParameterBaseName = "minimumPermission";
localVarQueryParams.addAll(ApiClient.parameterToPairs("minimumPermission", minimumPermission));
localVarQueryParameterBaseName = "projectIdsToExclude";
localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "projectIdsToExclude", projectIdsToExclude));
localVarQueryParameterBaseName = "projectIdsToInclude";
localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "projectIdsToInclude", projectIdsToInclude));
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
StringJoiner queryJoiner = new StringJoiner("&");
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
if (localVarQueryStringJoiner.length() != 0) {
queryJoiner.add(localVarQueryStringJoiner.toString());
}
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
} else {
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
}
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Get snapshot file raw content at specified path
*
* @param snapshotId snapshot ID (required)
* @param path path of file to get raw content for (required)
* @param download whether endpoint is used for download (optional)
* @return java.io.InputStream
* @throws ApiException if fails to make API call
*/
public java.io.InputStream getFileRaw(String snapshotId, String path, Boolean download) throws ApiException {
ApiResponse localVarResponse = getFileRawWithHttpInfo(snapshotId, path, download);
return localVarResponse.getData();
}
/**
* Get snapshot file raw content at specified path
*
* @param snapshotId snapshot ID (required)
* @param path path of file to get raw content for (required)
* @param download whether endpoint is used for download (optional)
* @return ApiResponse<java.io.InputStream>
* @throws ApiException if fails to make API call
*/
public ApiResponse getFileRawWithHttpInfo(String snapshotId, String path, Boolean download) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getFileRawRequestBuilder(snapshotId, path, download);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getFileRaw", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder getFileRawRequestBuilder(String snapshotId, String path, Boolean download) throws ApiException {
// verify the required parameter 'snapshotId' is set
if (snapshotId == null) {
throw new ApiException(400, "Missing the required parameter 'snapshotId' when calling getFileRaw");
}
// verify the required parameter 'path' is set
if (path == null) {
throw new ApiException(400, "Missing the required parameter 'path' when calling getFileRaw");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/snapshot/{snapshotId}/file/raw"
.replace("{snapshotId}", ApiClient.urlEncode(snapshotId.toString()));
List localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "path";
localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path));
localVarQueryParameterBaseName = "download";
localVarQueryParams.addAll(ApiClient.parameterToPairs("download", download));
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
StringJoiner queryJoiner = new StringJoiner("&");
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
if (localVarQueryStringJoiner.length() != 0) {
queryJoiner.add(localVarQueryStringJoiner.toString());
}
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
} else {
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
}
localVarRequestBuilder.header("Accept", "application/octet-stream, application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Get snapshot files at specified path
*
* @param snapshotId snapshot ID (required)
* @param path subPath to get files at (required)
* @return DominoDatasetrwApiDatasetRwSnapshotFilesViewDto
* @throws ApiException if fails to make API call
*/
public DominoDatasetrwApiDatasetRwSnapshotFilesViewDto getFilesInSnapshot(String snapshotId, String path) throws ApiException {
ApiResponse localVarResponse = getFilesInSnapshotWithHttpInfo(snapshotId, path);
return localVarResponse.getData();
}
/**
* Get snapshot files at specified path
*
* @param snapshotId snapshot ID (required)
* @param path subPath to get files at (required)
* @return ApiResponse<DominoDatasetrwApiDatasetRwSnapshotFilesViewDto>
* @throws ApiException if fails to make API call
*/
public ApiResponse getFilesInSnapshotWithHttpInfo(String snapshotId, String path) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getFilesInSnapshotRequestBuilder(snapshotId, path);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getFilesInSnapshot", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder getFilesInSnapshotRequestBuilder(String snapshotId, String path) throws ApiException {
// verify the required parameter 'snapshotId' is set
if (snapshotId == null) {
throw new ApiException(400, "Missing the required parameter 'snapshotId' when calling getFilesInSnapshot");
}
// verify the required parameter 'path' is set
if (path == null) {
throw new ApiException(400, "Missing the required parameter 'path' when calling getFilesInSnapshot");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/files/{snapshotId}"
.replace("{snapshotId}", ApiClient.urlEncode(snapshotId.toString()));
List localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "path";
localVarQueryParams.addAll(ApiClient.parameterToPairs("path", path));
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
StringJoiner queryJoiner = new StringJoiner("&");
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
if (localVarQueryStringJoiner.length() != 0) {
queryJoiner.add(localVarQueryStringJoiner.toString());
}
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
} else {
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
}
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Get shared mounts in a project
*
* @param projectId Project ID (required)
* @param minimumPermission minimum dataset rw permission to check for (optional)
* @return List<DominoDatasetrwApiDatasetRwProjectMountDto>
* @throws ApiException if fails to make API call
*/
public List getSharedDatasetProjectMountsV2(String projectId, String minimumPermission) throws ApiException {
ApiResponse> localVarResponse = getSharedDatasetProjectMountsV2WithHttpInfo(projectId, minimumPermission);
return localVarResponse.getData();
}
/**
* Get shared mounts in a project
*
* @param projectId Project ID (required)
* @param minimumPermission minimum dataset rw permission to check for (optional)
* @return ApiResponse<List<DominoDatasetrwApiDatasetRwProjectMountDto>>
* @throws ApiException if fails to make API call
*/
public ApiResponse> getSharedDatasetProjectMountsV2WithHttpInfo(String projectId, String minimumPermission) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getSharedDatasetProjectMountsV2RequestBuilder(projectId, minimumPermission);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getSharedDatasetProjectMountsV2", localVarResponse);
}
return new ApiResponse>(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder getSharedDatasetProjectMountsV2RequestBuilder(String projectId, String minimumPermission) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling getSharedDatasetProjectMountsV2");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/mounts-v2/{projectId}/shared"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()));
List localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "minimumPermission";
localVarQueryParams.addAll(ApiClient.parameterToPairs("minimumPermission", minimumPermission));
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
StringJoiner queryJoiner = new StringJoiner("&");
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
if (localVarQueryStringJoiner.length() != 0) {
queryJoiner.add(localVarQueryStringJoiner.toString());
}
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
} else {
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
}
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Retrieves the specified snapshot
*
* @param snapshotId Id of the snapshot (required)
* @return DominoDatasetrwApiDatasetRwSnapshotSummaryDto
* @throws ApiException if fails to make API call
*/
public DominoDatasetrwApiDatasetRwSnapshotSummaryDto getSnapshot(String snapshotId) throws ApiException {
ApiResponse localVarResponse = getSnapshotWithHttpInfo(snapshotId);
return localVarResponse.getData();
}
/**
* Retrieves the specified snapshot
*
* @param snapshotId Id of the snapshot (required)
* @return ApiResponse<DominoDatasetrwApiDatasetRwSnapshotSummaryDto>
* @throws ApiException if fails to make API call
*/
public ApiResponse getSnapshotWithHttpInfo(String snapshotId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getSnapshotRequestBuilder(snapshotId);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getSnapshot", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder getSnapshotRequestBuilder(String snapshotId) throws ApiException {
// verify the required parameter 'snapshotId' is set
if (snapshotId == null) {
throw new ApiException(400, "Missing the required parameter 'snapshotId' when calling getSnapshot");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/snapshot/{snapshotId}"
.replace("{snapshotId}", ApiClient.urlEncode(snapshotId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Get snapshots in dataset
*
* @param datasetId Dataset ID (required)
* @return List<DominoDatasetrwApiDatasetRwSnapshotDto>
* @throws ApiException if fails to make API call
*/
public List getSnapshots(String datasetId) throws ApiException {
ApiResponse> localVarResponse = getSnapshotsWithHttpInfo(datasetId);
return localVarResponse.getData();
}
/**
* Get snapshots in dataset
*
* @param datasetId Dataset ID (required)
* @return ApiResponse<List<DominoDatasetrwApiDatasetRwSnapshotDto>>
* @throws ApiException if fails to make API call
*/
public ApiResponse> getSnapshotsWithHttpInfo(String datasetId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getSnapshotsRequestBuilder(datasetId);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getSnapshots", localVarResponse);
}
return new ApiResponse>(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder getSnapshotsRequestBuilder(String datasetId) throws ApiException {
// verify the required parameter 'datasetId' is set
if (datasetId == null) {
throw new ApiException(400, "Missing the required parameter 'datasetId' when calling getSnapshots");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/snapshots/{datasetId}"
.replace("{datasetId}", ApiClient.urlEncode(datasetId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Removes shared dataset from project
*
* @param projectId Project ID (required)
* @param datasetId Dataset ID (required)
* @return DominoDatasetrwApiSharedDatasetRwEntryDto
* @throws ApiException if fails to make API call
*/
public DominoDatasetrwApiSharedDatasetRwEntryDto removeSharedDatasetRwEntry(String projectId, String datasetId) throws ApiException {
ApiResponse localVarResponse = removeSharedDatasetRwEntryWithHttpInfo(projectId, datasetId);
return localVarResponse.getData();
}
/**
* Removes shared dataset from project
*
* @param projectId Project ID (required)
* @param datasetId Dataset ID (required)
* @return ApiResponse<DominoDatasetrwApiSharedDatasetRwEntryDto>
* @throws ApiException if fails to make API call
*/
public ApiResponse removeSharedDatasetRwEntryWithHttpInfo(String projectId, String datasetId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = removeSharedDatasetRwEntryRequestBuilder(projectId, datasetId);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("removeSharedDatasetRwEntry", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder removeSharedDatasetRwEntryRequestBuilder(String projectId, String datasetId) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling removeSharedDatasetRwEntry");
}
// verify the required parameter 'datasetId' is set
if (datasetId == null) {
throw new ApiException(400, "Missing the required parameter 'datasetId' when calling removeSharedDatasetRwEntry");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/{projectId}/shared/{datasetId}"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
.replace("{datasetId}", ApiClient.urlEncode(datasetId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* updates a dataset's rwGrants
*
* @param datasetId Dataset ID (required)
* @param dominoDatasetrwWebUpdateDatasetGrantsRequest Request body with updated set of RwGrants (required)
* @return List<DominoDatasetrwApiDatasetRwGrant>
* @throws ApiException if fails to make API call
*/
public List updateDatasetGrants(String datasetId, DominoDatasetrwWebUpdateDatasetGrantsRequest dominoDatasetrwWebUpdateDatasetGrantsRequest) throws ApiException {
ApiResponse> localVarResponse = updateDatasetGrantsWithHttpInfo(datasetId, dominoDatasetrwWebUpdateDatasetGrantsRequest);
return localVarResponse.getData();
}
/**
* updates a dataset's rwGrants
*
* @param datasetId Dataset ID (required)
* @param dominoDatasetrwWebUpdateDatasetGrantsRequest Request body with updated set of RwGrants (required)
* @return ApiResponse<List<DominoDatasetrwApiDatasetRwGrant>>
* @throws ApiException if fails to make API call
*/
public ApiResponse> updateDatasetGrantsWithHttpInfo(String datasetId, DominoDatasetrwWebUpdateDatasetGrantsRequest dominoDatasetrwWebUpdateDatasetGrantsRequest) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = updateDatasetGrantsRequestBuilder(datasetId, dominoDatasetrwWebUpdateDatasetGrantsRequest);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("updateDatasetGrants", localVarResponse);
}
return new ApiResponse>(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder updateDatasetGrantsRequestBuilder(String datasetId, DominoDatasetrwWebUpdateDatasetGrantsRequest dominoDatasetrwWebUpdateDatasetGrantsRequest) throws ApiException {
// verify the required parameter 'datasetId' is set
if (datasetId == null) {
throw new ApiException(400, "Missing the required parameter 'datasetId' when calling updateDatasetGrants");
}
// verify the required parameter 'dominoDatasetrwWebUpdateDatasetGrantsRequest' is set
if (dominoDatasetrwWebUpdateDatasetGrantsRequest == null) {
throw new ApiException(400, "Missing the required parameter 'dominoDatasetrwWebUpdateDatasetGrantsRequest' when calling updateDatasetGrants");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/dataset/{datasetId}/grants"
.replace("{datasetId}", ApiClient.urlEncode(datasetId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoDatasetrwWebUpdateDatasetGrantsRequest);
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
} catch (IOException e) {
throw new ApiException(e);
}
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Update a dataset snapshot's status
*
* @param snapshotId Id of the dataset snapshot to be updated (required)
* @param dominoDatasetrwWebUpdateSnapshotStatusRequest JSON object with information describing the new status (required)
* @return DominoDatasetrwApiDatasetRwSnapshotDto
* @throws ApiException if fails to make API call
*/
public DominoDatasetrwApiDatasetRwSnapshotDto updateDatasetSnapshotStatus(String snapshotId, DominoDatasetrwWebUpdateSnapshotStatusRequest dominoDatasetrwWebUpdateSnapshotStatusRequest) throws ApiException {
ApiResponse localVarResponse = updateDatasetSnapshotStatusWithHttpInfo(snapshotId, dominoDatasetrwWebUpdateSnapshotStatusRequest);
return localVarResponse.getData();
}
/**
* Update a dataset snapshot's status
*
* @param snapshotId Id of the dataset snapshot to be updated (required)
* @param dominoDatasetrwWebUpdateSnapshotStatusRequest JSON object with information describing the new status (required)
* @return ApiResponse<DominoDatasetrwApiDatasetRwSnapshotDto>
* @throws ApiException if fails to make API call
*/
public ApiResponse updateDatasetSnapshotStatusWithHttpInfo(String snapshotId, DominoDatasetrwWebUpdateSnapshotStatusRequest dominoDatasetrwWebUpdateSnapshotStatusRequest) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = updateDatasetSnapshotStatusRequestBuilder(snapshotId, dominoDatasetrwWebUpdateSnapshotStatusRequest);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("updateDatasetSnapshotStatus", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
protected HttpRequest.Builder updateDatasetSnapshotStatusRequestBuilder(String snapshotId, DominoDatasetrwWebUpdateSnapshotStatusRequest dominoDatasetrwWebUpdateSnapshotStatusRequest) throws ApiException {
// verify the required parameter 'snapshotId' is set
if (snapshotId == null) {
throw new ApiException(400, "Missing the required parameter 'snapshotId' when calling updateDatasetSnapshotStatus");
}
// verify the required parameter 'dominoDatasetrwWebUpdateSnapshotStatusRequest' is set
if (dominoDatasetrwWebUpdateSnapshotStatusRequest == null) {
throw new ApiException(400, "Missing the required parameter 'dominoDatasetrwWebUpdateSnapshotStatusRequest' when calling updateDatasetSnapshotStatus");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/datasetrw/snapshot/{snapshotId}"
.replace("{snapshotId}", ApiClient.urlEncode(snapshotId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoDatasetrwWebUpdateSnapshotStatusRequest);
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
} catch (IOException e) {
throw new ApiException(e);
}
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy