Please wait. This can take some minutes ...
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.
com.piiano.vault.client.openapi.ObjectsApi Maven / Gradle / Ivy
/*
* Piiano Vault REST API
* --- sidebar_position: 1 sidebar_label: Overview description: The Piiano Vault REST API enables you to access and manage collections, objects, tokens, users, policies, and other resources within Piiano Vault. slug: / --- # Introduction The Piiano Vault REST API enables you to access and manage collections, objects, tokens, users, policies, and other resources within Piiano Vault in a simple, programmatic way using conventional HTTP requests and standard HTTP response codes. The API follows RESTful conventions when possible, with most operations performed by `GET`, `POST`, `PUT`, `PATCH`, and `DELETE` requests. Request and response bodies are [JSON-encoded](https://www.json.org/json-en.html). However, for collection operations, an SQL-like [PVSchema](/guides/reference/pvschema) encoding is available. This API reference provides details for each operation available in the API. When you install a local copy of Vault, you can try each operation using **Send API request**. An OpenAPI specification is available in [YAML](@site/static/assets/openapi.yaml) and [JSON](@site/static/assets/openapi.json) formats and can be used to generate client code for the API.
*
* The version of the OpenAPI document: 1.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.piiano.vault.client.openapi;
import com.piiano.vault.client.openapi.ApiCallback;
import com.piiano.vault.client.openapi.ApiClient;
import com.piiano.vault.client.openapi.ApiException;
import com.piiano.vault.client.openapi.ApiResponse;
import com.piiano.vault.client.openapi.Configuration;
import com.piiano.vault.client.openapi.Pair;
import com.piiano.vault.client.openapi.ProgressRequestBody;
import com.piiano.vault.client.openapi.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.piiano.vault.client.openapi.model.BulkObjectResponse;
import com.piiano.vault.client.openapi.model.Count;
import java.io.File;
import com.piiano.vault.client.openapi.model.ObjectFieldsPage;
import com.piiano.vault.client.openapi.model.ObjectID;
import com.piiano.vault.client.openapi.model.Query;
import com.piiano.vault.client.openapi.model.RestHTTPError;
import java.util.Set;
import java.util.UUID;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ObjectsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public ObjectsApi() {
this(Configuration.getDefaultApiClient());
}
public ObjectsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
private okhttp3.Call addObjectCall(String collection, Map requestBody, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, String expirationSecs, Boolean _import, String exportKey, String prop, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = requestBody;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/data/collections/{collection}/objects"
.replace("{" + "collection" + "}", localVarApiClient.escapeString(collection.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (adhocReason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("adhoc_reason", adhocReason));
}
if (reason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason));
}
if (customAudit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit));
}
if (reloadCache != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reload_cache", reloadCache));
}
if (expirationSecs != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiration_secs", expirationSecs));
}
if (_import != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("import", _import));
}
if (exportKey != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("export_key", exportKey));
}
if (prop != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("prop", prop));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json",
"application/octet-stream"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (xTenantId != null) {
localVarHeaderParams.put("X-Tenant-Id", localVarApiClient.parameterToString(xTenantId));
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call addObjectValidateBeforeCall(String collection, Map requestBody, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, String expirationSecs, Boolean _import, String exportKey, String prop, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'collection' is set
if (collection == null) {
throw new ApiException("Missing the required parameter 'collection' when calling addObject(Async)");
}
// verify the required parameter 'requestBody' is set
if (requestBody == null) {
throw new ApiException("Missing the required parameter 'requestBody' when calling addObject(Async)");
}
return addObjectCall(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop, _callback);
}
private ApiResponse addObjectWithHttpInfo(String collection, Map requestBody, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, String expirationSecs, Boolean _import, String exportKey, String prop) throws ApiException {
okhttp3.Call localVarCall = addObjectValidateBeforeCall(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call addObjectAsync(String collection, Map requestBody, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, String expirationSecs, Boolean _import, String exportKey, String prop, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = addObjectValidateBeforeCall(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIaddObjectRequest {
private final String collection;
private final Map requestBody;
private String adhocReason;
private String reason;
private String customAudit;
private Boolean reloadCache;
private List xTenantId;
private String expirationSecs;
private Boolean _import;
private String exportKey;
private String prop;
private APIaddObjectRequest(String collection, Map requestBody) {
this.collection = collection;
this.requestBody = requestBody;
}
/**
* Set adhocReason
* @param adhocReason An ad-hoc reason for accessing the Vault data. Required when `reason` is set to `Other`. (optional)
* @return APIaddObjectRequest
*/
public APIaddObjectRequest adhocReason(String adhocReason) {
this.adhocReason = adhocReason;
return this;
}
/**
* Set reason
* @param reason Details of the reason for requesting the property. The default is set when no access reason is provided and PVAULT_SERVICE_FORCE_ACCESS_REASON is false. (optional)
* @return APIaddObjectRequest
*/
public APIaddObjectRequest reason(String reason) {
this.reason = reason;
return this;
}
/**
* Set customAudit
* @param customAudit Custom audit information to be included in the audit log. (optional)
* @return APIaddObjectRequest
*/
public APIaddObjectRequest customAudit(String customAudit) {
this.customAudit = customAudit;
return this;
}
/**
* Set reloadCache
* @param reloadCache Reloads the cache before the action. (optional)
* @return APIaddObjectRequest
*/
public APIaddObjectRequest reloadCache(Boolean reloadCache) {
this.reloadCache = reloadCache;
return this;
}
/**
* Set xTenantId
* @param xTenantId List of tenant IDs to enforce on the request. (optional)
* @return APIaddObjectRequest
*/
public APIaddObjectRequest xTenantId(List xTenantId) {
this.xTenantId = xTenantId;
return this;
}
/**
* Set expirationSecs
* @param expirationSecs Object expiration time in seconds, cannot be set to 0. If not set, the default value is used. See the `PVAULT_EXPIRATION_ASSOCIATED_OBJECTS` and `PVAULT_EXPIRATION_UNASSOCIATED_OBJECTS` environment variables. If set to an empty value, the token will be marked to not expire. (optional)
* @return APIaddObjectRequest
*/
public APIaddObjectRequest expirationSecs(String expirationSecs) {
this.expirationSecs = expirationSecs;
return this;
}
/**
* Set _import
* @param _import Whether to write built-in property values. (optional, default to false)
* @return APIaddObjectRequest
*/
public APIaddObjectRequest _import(Boolean _import) {
this._import = _import;
return this;
}
/**
* Set exportKey
* @param exportKey The encrypted copy of the key used to encrypt exported data. The key is encrypted using the export KMS key defined by the [`PVAULT_KMS_EXPORT_URI` or `PVAULT_KMS_EXPORT_SEED` environment variables](/guides/configure/environment-variables#key-management-service). When importing data, the key is decrypted by the KMS, then used to decrypt the data. This parameter is not intended to be used manually, but through the CLI command `pvault import`. (optional)
* @return APIaddObjectRequest
*/
public APIaddObjectRequest exportKey(String exportKey) {
this.exportKey = exportKey;
return this;
}
/**
* Set prop
* @param prop (optional)
* @return APIaddObjectRequest
*/
public APIaddObjectRequest prop(String prop) {
this.prop = prop;
return this;
}
/**
* Build call for addObject
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return addObjectCall(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop, _callback);
}
/**
* Execute addObject request
* @return ObjectID
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public ObjectID execute() throws ApiException {
ApiResponse localVarResp = addObjectWithHttpInfo(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop);
return localVarResp.getData();
}
/**
* Execute addObject request with HTTP info returned
* @return ApiResponse<ObjectID>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return addObjectWithHttpInfo(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop);
}
/**
* Execute addObject request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return addObjectAsync(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop, _callback);
}
}
/**
* Add object
* Adds an object to a collection. The request must include all the non-nullable properties, as defined by the [collection schema](/api/operations/list-collection-properties). By default, accepts the object fields in JSON format. To pass a raw, unformatted value for a single property, set the `Content-Type` header to `application/octet-stream` and the property name in the `prop` query parameter. When adding an object from an external system that uses UUID IDs, you can include the object ID in the request to set the ID in Vault. For example, `\"id\",\"463a83d0-a816-4902-abba-2486e0c0a0bb\"`. Vault normalizes the ID to lowercase. If the object to add is exported from an external system or Vault: - set `import` to `true` to import values for the built-in properties `_creation_time`, `_modification_time`, and `_expiration_time`. - if the data is encrypted, to decrypt the data provide the encryption key in `export_key`. The role performing this operation must have both of the following: - The `CapDataWriter` or the `CapDataCreator` capability. - At least one allowing policy and no denying policies for the `write` operation for each of the collection properties provided in the call. See [identity and access management](/data-security/identity-and-access-management) for more information about how capabilities are used to control access to operations and policies are used to control access to data.
* @param collection (required)
* @param requestBody The object details. (required)
* @return APIaddObjectRequest
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public APIaddObjectRequest addObject(String collection, Map requestBody) {
return new APIaddObjectRequest(collection, requestBody);
}
private okhttp3.Call addObjectsCall(String collection, List> requestBody, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, String expirationSecs, Boolean _import, String exportKey, String prop, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = requestBody;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/data/collections/{collection}/bulk/objects"
.replace("{" + "collection" + "}", localVarApiClient.escapeString(collection.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (adhocReason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("adhoc_reason", adhocReason));
}
if (reason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason));
}
if (customAudit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit));
}
if (reloadCache != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reload_cache", reloadCache));
}
if (expirationSecs != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiration_secs", expirationSecs));
}
if (_import != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("import", _import));
}
if (exportKey != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("export_key", exportKey));
}
if (prop != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("prop", prop));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (xTenantId != null) {
localVarHeaderParams.put("X-Tenant-Id", localVarApiClient.parameterToString(xTenantId));
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call addObjectsValidateBeforeCall(String collection, List> requestBody, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, String expirationSecs, Boolean _import, String exportKey, String prop, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'collection' is set
if (collection == null) {
throw new ApiException("Missing the required parameter 'collection' when calling addObjects(Async)");
}
// verify the required parameter 'requestBody' is set
if (requestBody == null) {
throw new ApiException("Missing the required parameter 'requestBody' when calling addObjects(Async)");
}
return addObjectsCall(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop, _callback);
}
private ApiResponse addObjectsWithHttpInfo(String collection, List> requestBody, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, String expirationSecs, Boolean _import, String exportKey, String prop) throws ApiException {
okhttp3.Call localVarCall = addObjectsValidateBeforeCall(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call addObjectsAsync(String collection, List> requestBody, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, String expirationSecs, Boolean _import, String exportKey, String prop, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = addObjectsValidateBeforeCall(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIaddObjectsRequest {
private final String collection;
private final List> requestBody;
private String adhocReason;
private String reason;
private String customAudit;
private Boolean reloadCache;
private List xTenantId;
private String expirationSecs;
private Boolean _import;
private String exportKey;
private String prop;
private APIaddObjectsRequest(String collection, List> requestBody) {
this.collection = collection;
this.requestBody = requestBody;
}
/**
* Set adhocReason
* @param adhocReason An ad-hoc reason for accessing the Vault data. Required when `reason` is set to `Other`. (optional)
* @return APIaddObjectsRequest
*/
public APIaddObjectsRequest adhocReason(String adhocReason) {
this.adhocReason = adhocReason;
return this;
}
/**
* Set reason
* @param reason Details of the reason for requesting the property. The default is set when no access reason is provided and PVAULT_SERVICE_FORCE_ACCESS_REASON is false. (optional)
* @return APIaddObjectsRequest
*/
public APIaddObjectsRequest reason(String reason) {
this.reason = reason;
return this;
}
/**
* Set customAudit
* @param customAudit Custom audit information to be included in the audit log. (optional)
* @return APIaddObjectsRequest
*/
public APIaddObjectsRequest customAudit(String customAudit) {
this.customAudit = customAudit;
return this;
}
/**
* Set reloadCache
* @param reloadCache Reloads the cache before the action. (optional)
* @return APIaddObjectsRequest
*/
public APIaddObjectsRequest reloadCache(Boolean reloadCache) {
this.reloadCache = reloadCache;
return this;
}
/**
* Set xTenantId
* @param xTenantId List of tenant IDs to enforce on the request. (optional)
* @return APIaddObjectsRequest
*/
public APIaddObjectsRequest xTenantId(List xTenantId) {
this.xTenantId = xTenantId;
return this;
}
/**
* Set expirationSecs
* @param expirationSecs Object expiration time in seconds, cannot be set to 0. If not set, the default value is used. See the `PVAULT_EXPIRATION_ASSOCIATED_OBJECTS` and `PVAULT_EXPIRATION_UNASSOCIATED_OBJECTS` environment variables. If set to an empty value, the objects will be marked to not expire. (optional)
* @return APIaddObjectsRequest
*/
public APIaddObjectsRequest expirationSecs(String expirationSecs) {
this.expirationSecs = expirationSecs;
return this;
}
/**
* Set _import
* @param _import Whether to write built-in property values. (optional, default to false)
* @return APIaddObjectsRequest
*/
public APIaddObjectsRequest _import(Boolean _import) {
this._import = _import;
return this;
}
/**
* Set exportKey
* @param exportKey The encrypted copy of the key used to encrypt exported data. The key is encrypted using the export KMS key defined by the [`PVAULT_KMS_EXPORT_URI` or `PVAULT_KMS_EXPORT_SEED` environment variables](/guides/configure/environment-variables#key-management-service). When importing data, the key is decrypted by the KMS, then used to decrypt the data. This parameter is not intended to be used manually, but through the CLI command `pvault import`. (optional)
* @return APIaddObjectsRequest
*/
public APIaddObjectsRequest exportKey(String exportKey) {
this.exportKey = exportKey;
return this;
}
/**
* Set prop
* @param prop (optional)
* @return APIaddObjectsRequest
*/
public APIaddObjectsRequest prop(String prop) {
this.prop = prop;
return this;
}
/**
* Build call for addObjects
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return addObjectsCall(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop, _callback);
}
/**
* Execute addObjects request
* @return BulkObjectResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public BulkObjectResponse execute() throws ApiException {
ApiResponse localVarResp = addObjectsWithHttpInfo(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop);
return localVarResp.getData();
}
/**
* Execute addObjects request with HTTP info returned
* @return ApiResponse<BulkObjectResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return addObjectsWithHttpInfo(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop);
}
/**
* Execute addObjects request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return addObjectsAsync(collection, requestBody, adhocReason, reason, customAudit, reloadCache, xTenantId, expirationSecs, _import, exportKey, prop, _callback);
}
}
/**
* Add objects (bulk)
* Adds objects to a collection. The request must include all the non-nullable properties for each object, as defined by the collection schema. Use the [list collection properties](/api/operations/list-collection-properties) operation to check the collection schema. By default, accepts the object fields in JSON format. To pass a raw, unformatted value for a single property, set the `Content-Type` header to `application/octet-stream` and the property name in the `prop` query parameter. When adding objects from an external system that uses UUID IDs, you can include the object IDs in the request to set the IDs in Vault. For example, `\"id\",\"463a83d0-a816-4902-abba-2486e0c0a0bb\"`. Vault normalizes the IDs to lowercase. If the objects to add are exported from an external system or Vault: - set `import` to `true` to import values for the built-in properties `_creation_time`, `_modification_time`, and `_expiration_time`. - if the data is encrypted, to decrypt the data provide the encryption key in `export_key`. If any object add fails, the operation fails and no objects are added. The maximum number of objects that can be added in one operation is determined by the [`PVAULT_SERVICE_MAX_PAGE_SIZE` environment variable](/guides/configure/environment-variables#pvault_service_max_page_size). See the [add object](/api/operations/add-object) operation to add an object to a collection. The role performing this operation must have both of the following: - The `CapDataWriter` or the `CapDataCreator` capability. - For each object in the request, at least one allowing policy and no denying policies for the `write` operation for each object property. See [identity and access management](/data-security/identity-and-access-management) for more information about how capabilities are used to control access to operations and policies are used to control access to data.
* @param collection (required)
* @param requestBody List of objects to add. The order of the objects in this array is preserved in the response. (required)
* @return APIaddObjectsRequest
* @http.response.details
Response Details
Status Code Description Response Headers
200 The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public APIaddObjectsRequest addObjects(String collection, List> requestBody) {
return new APIaddObjectsRequest(collection, requestBody);
}
private okhttp3.Call deleteObjectByIdCall(String collection, UUID id, Set options, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/data/collections/{collection}/objects/{id}"
.replace("{" + "collection" + "}", localVarApiClient.escapeString(collection.toString()))
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (options != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "options", options));
}
if (adhocReason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("adhoc_reason", adhocReason));
}
if (reason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason));
}
if (customAudit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit));
}
if (reloadCache != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reload_cache", reloadCache));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (xTenantId != null) {
localVarHeaderParams.put("X-Tenant-Id", localVarApiClient.parameterToString(xTenantId));
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteObjectByIdValidateBeforeCall(String collection, UUID id, Set options, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'collection' is set
if (collection == null) {
throw new ApiException("Missing the required parameter 'collection' when calling deleteObjectById(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteObjectById(Async)");
}
return deleteObjectByIdCall(collection, id, options, adhocReason, reason, customAudit, reloadCache, xTenantId, _callback);
}
private ApiResponse deleteObjectByIdWithHttpInfo(String collection, UUID id, Set options, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId) throws ApiException {
okhttp3.Call localVarCall = deleteObjectByIdValidateBeforeCall(collection, id, options, adhocReason, reason, customAudit, reloadCache, xTenantId, null);
return localVarApiClient.execute(localVarCall);
}
private okhttp3.Call deleteObjectByIdAsync(String collection, UUID id, Set options, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteObjectByIdValidateBeforeCall(collection, id, options, adhocReason, reason, customAudit, reloadCache, xTenantId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
public class APIdeleteObjectByIdRequest {
private final String collection;
private final UUID id;
private Set options;
private String adhocReason;
private String reason;
private String customAudit;
private Boolean reloadCache;
private List xTenantId;
private APIdeleteObjectByIdRequest(String collection, UUID id) {
this.collection = collection;
this.id = id;
}
/**
* Set options
* @param options Options for the operation. Options include: - `archived` – whether to delete only archived objects. If not specified, delete only active objects. (optional)
* @return APIdeleteObjectByIdRequest
*/
public APIdeleteObjectByIdRequest options(Set options) {
this.options = options;
return this;
}
/**
* Set adhocReason
* @param adhocReason An ad-hoc reason for accessing the Vault data. Required when `reason` is set to `Other`. (optional)
* @return APIdeleteObjectByIdRequest
*/
public APIdeleteObjectByIdRequest adhocReason(String adhocReason) {
this.adhocReason = adhocReason;
return this;
}
/**
* Set reason
* @param reason Details of the reason for requesting the property. The default is set when no access reason is provided and PVAULT_SERVICE_FORCE_ACCESS_REASON is false. (optional)
* @return APIdeleteObjectByIdRequest
*/
public APIdeleteObjectByIdRequest reason(String reason) {
this.reason = reason;
return this;
}
/**
* Set customAudit
* @param customAudit Custom audit information to be included in the audit log. (optional)
* @return APIdeleteObjectByIdRequest
*/
public APIdeleteObjectByIdRequest customAudit(String customAudit) {
this.customAudit = customAudit;
return this;
}
/**
* Set reloadCache
* @param reloadCache Reloads the cache before the action. (optional)
* @return APIdeleteObjectByIdRequest
*/
public APIdeleteObjectByIdRequest reloadCache(Boolean reloadCache) {
this.reloadCache = reloadCache;
return this;
}
/**
* Set xTenantId
* @param xTenantId List of tenant IDs to enforce on the request. (optional)
* @return APIdeleteObjectByIdRequest
*/
public APIdeleteObjectByIdRequest xTenantId(List xTenantId) {
this.xTenantId = xTenantId;
return this;
}
/**
* Build call for deleteObjectById
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return deleteObjectByIdCall(collection, id, options, adhocReason, reason, customAudit, reloadCache, xTenantId, _callback);
}
/**
* Execute deleteObjectById request
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public void execute() throws ApiException {
deleteObjectByIdWithHttpInfo(collection, id, options, adhocReason, reason, customAudit, reloadCache, xTenantId);
}
/**
* Execute deleteObjectById request with HTTP info returned
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return deleteObjectByIdWithHttpInfo(collection, id, options, adhocReason, reason, customAudit, reloadCache, xTenantId);
}
/**
* Execute deleteObjectById request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return deleteObjectByIdAsync(collection, id, options, adhocReason, reason, customAudit, reloadCache, xTenantId, _callback);
}
}
/**
* Delete object
* Deletes an object from a collection. This operation is irreversible. The role performing this operation must have both of the following: - The `CapDataWriter` or the `CapDataDeleter` capability. - At least one allowing policy and no denying policies for the `delete` operation for each of the properties defined for the collection specified in the call. See [identity and access management](/data-security/identity-and-access-management) for more information about how capabilities are used to control access to operations and policies are used to control access to data.
* @param collection (required)
* @param id The ID of the object. (required)
* @return APIdeleteObjectByIdRequest
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public APIdeleteObjectByIdRequest deleteObjectById(String collection, UUID id) {
return new APIdeleteObjectByIdRequest(collection, id);
}
private okhttp3.Call deleteObjectsCall(String collection, Set options, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, List objectID, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = objectID;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/data/collections/{collection}/bulk/objects"
.replace("{" + "collection" + "}", localVarApiClient.escapeString(collection.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (options != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "options", options));
}
if (adhocReason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("adhoc_reason", adhocReason));
}
if (reason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason));
}
if (customAudit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit));
}
if (reloadCache != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reload_cache", reloadCache));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (xTenantId != null) {
localVarHeaderParams.put("X-Tenant-Id", localVarApiClient.parameterToString(xTenantId));
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteObjectsValidateBeforeCall(String collection, Set options, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, List objectID, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'collection' is set
if (collection == null) {
throw new ApiException("Missing the required parameter 'collection' when calling deleteObjects(Async)");
}
return deleteObjectsCall(collection, options, adhocReason, reason, customAudit, reloadCache, xTenantId, objectID, _callback);
}
private ApiResponse deleteObjectsWithHttpInfo(String collection, Set options, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, List objectID) throws ApiException {
okhttp3.Call localVarCall = deleteObjectsValidateBeforeCall(collection, options, adhocReason, reason, customAudit, reloadCache, xTenantId, objectID, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call deleteObjectsAsync(String collection, Set options, String adhocReason, String reason, String customAudit, Boolean reloadCache, List xTenantId, List objectID, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteObjectsValidateBeforeCall(collection, options, adhocReason, reason, customAudit, reloadCache, xTenantId, objectID, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIdeleteObjectsRequest {
private final String collection;
private Set options;
private String adhocReason;
private String reason;
private String customAudit;
private Boolean reloadCache;
private List xTenantId;
private List objectID;
private APIdeleteObjectsRequest(String collection) {
this.collection = collection;
}
/**
* Set options
* @param options Options for the operation. Options include: - `archived` – whether to delete only archived objects. If not specified, deletes only active objects. (optional)
* @return APIdeleteObjectsRequest
*/
public APIdeleteObjectsRequest options(Set options) {
this.options = options;
return this;
}
/**
* Set adhocReason
* @param adhocReason An ad-hoc reason for accessing the Vault data. Required when `reason` is set to `Other`. (optional)
* @return APIdeleteObjectsRequest
*/
public APIdeleteObjectsRequest adhocReason(String adhocReason) {
this.adhocReason = adhocReason;
return this;
}
/**
* Set reason
* @param reason Details of the reason for requesting the property. The default is set when no access reason is provided and PVAULT_SERVICE_FORCE_ACCESS_REASON is false. (optional)
* @return APIdeleteObjectsRequest
*/
public APIdeleteObjectsRequest reason(String reason) {
this.reason = reason;
return this;
}
/**
* Set customAudit
* @param customAudit Custom audit information to be included in the audit log. (optional)
* @return APIdeleteObjectsRequest
*/
public APIdeleteObjectsRequest customAudit(String customAudit) {
this.customAudit = customAudit;
return this;
}
/**
* Set reloadCache
* @param reloadCache Reloads the cache before the action. (optional)
* @return APIdeleteObjectsRequest
*/
public APIdeleteObjectsRequest reloadCache(Boolean reloadCache) {
this.reloadCache = reloadCache;
return this;
}
/**
* Set xTenantId
* @param xTenantId List of tenant IDs to enforce on the request. (optional)
* @return APIdeleteObjectsRequest
*/
public APIdeleteObjectsRequest xTenantId(List xTenantId) {
this.xTenantId = xTenantId;
return this;
}
/**
* Set objectID
* @param objectID List of objects to delete. The order of the objects in the array is preserved in the response. (optional)
* @return APIdeleteObjectsRequest
*/
public APIdeleteObjectsRequest objectID(List objectID) {
this.objectID = objectID;
return this;
}
/**
* Build call for deleteObjects
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return deleteObjectsCall(collection, options, adhocReason, reason, customAudit, reloadCache, xTenantId, objectID, _callback);
}
/**
* Execute deleteObjects request
* @return BulkObjectResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public BulkObjectResponse execute() throws ApiException {
ApiResponse localVarResp = deleteObjectsWithHttpInfo(collection, options, adhocReason, reason, customAudit, reloadCache, xTenantId, objectID);
return localVarResp.getData();
}
/**
* Execute deleteObjects request with HTTP info returned
* @return ApiResponse<BulkObjectResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return deleteObjectsWithHttpInfo(collection, options, adhocReason, reason, customAudit, reloadCache, xTenantId, objectID);
}
/**
* Execute deleteObjects request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return deleteObjectsAsync(collection, options, adhocReason, reason, customAudit, reloadCache, xTenantId, objectID, _callback);
}
}
/**
* Delete objects (bulk)
* Deletes objects from a collection. This operation is irreversible. If any object delete fails, the operation fails and no objects are deleted. The maximum number of objects that can be deleted in one operation is determined by the [`PVAULT_SERVICE_MAX_PAGE_SIZE` environment variable](/guides/configure/environment-variables#pvault_service_max_page_size). The role performing this operation must have both of the following: - The `CapDataWriter` or the `CapDataDeleter` capability. - At least one allowing policy and no denying policies for the `delete` operation for each of the properties defined for the collection specified in the call. See [identity and access management](/data-security/identity-and-access-management) for more information about how capabilities are used to control access to operations and policies are used to control access to data.
* @param collection (required)
* @return APIdeleteObjectsRequest
* @http.response.details
Response Details
Status Code Description Response Headers
200 The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public APIdeleteObjectsRequest deleteObjects(String collection) {
return new APIdeleteObjectsRequest(collection);
}
private okhttp3.Call getObjectByIdCall(String collection, UUID id, String adhocReason, String reason, String customAudit, Boolean reloadCache, String xTransParam, List xTenantId, Set options, List props, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/data/collections/{collection}/objects/{id}"
.replace("{" + "collection" + "}", localVarApiClient.escapeString(collection.toString()))
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (adhocReason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("adhoc_reason", adhocReason));
}
if (reason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason));
}
if (customAudit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit));
}
if (reloadCache != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reload_cache", reloadCache));
}
if (options != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "options", options));
}
if (props != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "props", props));
}
final String[] localVarAccepts = {
"application/json",
"application/octet-stream"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (xTransParam != null) {
localVarHeaderParams.put("X-Trans-Param", localVarApiClient.parameterToString(xTransParam));
}
if (xTenantId != null) {
localVarHeaderParams.put("X-Tenant-Id", localVarApiClient.parameterToString(xTenantId));
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getObjectByIdValidateBeforeCall(String collection, UUID id, String adhocReason, String reason, String customAudit, Boolean reloadCache, String xTransParam, List xTenantId, Set options, List props, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'collection' is set
if (collection == null) {
throw new ApiException("Missing the required parameter 'collection' when calling getObjectById(Async)");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getObjectById(Async)");
}
return getObjectByIdCall(collection, id, adhocReason, reason, customAudit, reloadCache, xTransParam, xTenantId, options, props, _callback);
}
private ApiResponse> getObjectByIdWithHttpInfo(String collection, UUID id, String adhocReason, String reason, String customAudit, Boolean reloadCache, String xTransParam, List xTenantId, Set options, List props) throws ApiException {
okhttp3.Call localVarCall = getObjectByIdValidateBeforeCall(collection, id, adhocReason, reason, customAudit, reloadCache, xTransParam, xTenantId, options, props, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getObjectByIdAsync(String collection, UUID id, String adhocReason, String reason, String customAudit, Boolean reloadCache, String xTransParam, List xTenantId, Set options, List props, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = getObjectByIdValidateBeforeCall(collection, id, adhocReason, reason, customAudit, reloadCache, xTransParam, xTenantId, options, props, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIgetObjectByIdRequest {
private final String collection;
private final UUID id;
private String adhocReason;
private String reason;
private String customAudit;
private Boolean reloadCache;
private String xTransParam;
private List xTenantId;
private Set options;
private List props;
private APIgetObjectByIdRequest(String collection, UUID id) {
this.collection = collection;
this.id = id;
}
/**
* Set adhocReason
* @param adhocReason An ad-hoc reason for accessing the Vault data. Required when `reason` is set to `Other`. (optional)
* @return APIgetObjectByIdRequest
*/
public APIgetObjectByIdRequest adhocReason(String adhocReason) {
this.adhocReason = adhocReason;
return this;
}
/**
* Set reason
* @param reason Details of the reason for requesting the property. The default is set when no access reason is provided and PVAULT_SERVICE_FORCE_ACCESS_REASON is false. (optional)
* @return APIgetObjectByIdRequest
*/
public APIgetObjectByIdRequest reason(String reason) {
this.reason = reason;
return this;
}
/**
* Set customAudit
* @param customAudit Custom audit information to be included in the audit log. (optional)
* @return APIgetObjectByIdRequest
*/
public APIgetObjectByIdRequest customAudit(String customAudit) {
this.customAudit = customAudit;
return this;
}
/**
* Set reloadCache
* @param reloadCache Reloads the cache before the action. (optional)
* @return APIgetObjectByIdRequest
*/
public APIgetObjectByIdRequest reloadCache(Boolean reloadCache) {
this.reloadCache = reloadCache;
return this;
}
/**
* Set xTransParam
* @param xTransParam Extra parameter to pass on to the transformers. (optional)
* @return APIgetObjectByIdRequest
*/
public APIgetObjectByIdRequest xTransParam(String xTransParam) {
this.xTransParam = xTransParam;
return this;
}
/**
* Set xTenantId
* @param xTenantId List of tenant IDs to enforce on the request. (optional)
* @return APIgetObjectByIdRequest
*/
public APIgetObjectByIdRequest xTenantId(List xTenantId) {
this.xTenantId = xTenantId;
return this;
}
/**
* Set options
* @param options Options for the operation. Options include: - `archived` – whether to list only archived objects. If not specified, list only active objects. - `show_builtins` – show built-in properties, can only be specified with `unsafe`. - `unsafe` – fetch all the properties, cannot be specified with `props`. (optional)
* @return APIgetObjectByIdRequest
*/
public APIgetObjectByIdRequest options(Set options) {
this.options = options;
return this;
}
/**
* Set props
* @param props The list of property names and transformations. To include multiple names and transformations, provide a comma-separated list. For example, `props=first_name,last_name,email.mask`. (optional)
* @return APIgetObjectByIdRequest
*/
public APIgetObjectByIdRequest props(List props) {
this.props = props;
return this;
}
/**
* Build call for getObjectById
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection, properties, or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return getObjectByIdCall(collection, id, adhocReason, reason, customAudit, reloadCache, xTransParam, xTenantId, options, props, _callback);
}
/**
* Execute getObjectById request
* @return Map<String, Object>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection, properties, or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public Map execute() throws ApiException {
ApiResponse> localVarResp = getObjectByIdWithHttpInfo(collection, id, adhocReason, reason, customAudit, reloadCache, xTransParam, xTenantId, options, props);
return localVarResp.getData();
}
/**
* Execute getObjectById request with HTTP info returned
* @return ApiResponse<Map<String, Object>>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection, properties, or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public ApiResponse> executeWithHttpInfo() throws ApiException {
return getObjectByIdWithHttpInfo(collection, id, adhocReason, reason, customAudit, reloadCache, xTransParam, xTenantId, options, props);
}
/**
* Execute getObjectById request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection, properties, or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return getObjectByIdAsync(collection, id, adhocReason, reason, customAudit, reloadCache, xTransParam, xTenantId, options, props, _callback);
}
}
/**
* Get object
* Returns an object from a collection with all or a subset of object property values. By default, returns the properties in JSON format. To get a single property's value without formatting, specify the property name in the `prop` query parameter, and set the `Accept` header to `application/octet-stream`. The role performing this operation must have both of the following: - The `CapDataReader` capability. - At least one allowing policy and no denying policies for the `read` operation for each of the properties and the collection requested in the call. See [identity and access management](/data-security/identity-and-access-management) for more information about how capabilities are used to control access to operations and policies are used to control access to data. **Warning**: Use of the `unsafe` option, to include all object property values, may expose more private information than is required, use with caution.
* @param collection (required)
* @param id The ID of the object. (required)
* @return APIgetObjectByIdRequest
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection, properties, or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public APIgetObjectByIdRequest getObjectById(String collection, UUID id) {
return new APIgetObjectByIdRequest(collection, id);
}
private okhttp3.Call getObjectsCountCall(String collection, String adhocReason, String reason, String customAudit, Boolean reloadCache, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/data/collections/{collection}/count/objects"
.replace("{" + "collection" + "}", localVarApiClient.escapeString(collection.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (adhocReason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("adhoc_reason", adhocReason));
}
if (reason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason));
}
if (customAudit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit));
}
if (reloadCache != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reload_cache", reloadCache));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getObjectsCountValidateBeforeCall(String collection, String adhocReason, String reason, String customAudit, Boolean reloadCache, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'collection' is set
if (collection == null) {
throw new ApiException("Missing the required parameter 'collection' when calling getObjectsCount(Async)");
}
return getObjectsCountCall(collection, adhocReason, reason, customAudit, reloadCache, _callback);
}
private ApiResponse getObjectsCountWithHttpInfo(String collection, String adhocReason, String reason, String customAudit, Boolean reloadCache) throws ApiException {
okhttp3.Call localVarCall = getObjectsCountValidateBeforeCall(collection, adhocReason, reason, customAudit, reloadCache, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getObjectsCountAsync(String collection, String adhocReason, String reason, String customAudit, Boolean reloadCache, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getObjectsCountValidateBeforeCall(collection, adhocReason, reason, customAudit, reloadCache, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIgetObjectsCountRequest {
private final String collection;
private String adhocReason;
private String reason;
private String customAudit;
private Boolean reloadCache;
private APIgetObjectsCountRequest(String collection) {
this.collection = collection;
}
/**
* Set adhocReason
* @param adhocReason An ad-hoc reason for accessing the Vault data. Required when `reason` is set to `Other`. (optional)
* @return APIgetObjectsCountRequest
*/
public APIgetObjectsCountRequest adhocReason(String adhocReason) {
this.adhocReason = adhocReason;
return this;
}
/**
* Set reason
* @param reason Details of the reason for requesting the property. The default is set when no access reason is provided and PVAULT_SERVICE_FORCE_ACCESS_REASON is false. (optional)
* @return APIgetObjectsCountRequest
*/
public APIgetObjectsCountRequest reason(String reason) {
this.reason = reason;
return this;
}
/**
* Set customAudit
* @param customAudit Custom audit information to be included in the audit log. (optional)
* @return APIgetObjectsCountRequest
*/
public APIgetObjectsCountRequest customAudit(String customAudit) {
this.customAudit = customAudit;
return this;
}
/**
* Set reloadCache
* @param reloadCache Reloads the cache before the action. (optional)
* @return APIgetObjectsCountRequest
*/
public APIgetObjectsCountRequest reloadCache(Boolean reloadCache) {
this.reloadCache = reloadCache;
return this;
}
/**
* Build call for getObjectsCount
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The requested resource is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return getObjectsCountCall(collection, adhocReason, reason, customAudit, reloadCache, _callback);
}
/**
* Execute getObjectsCount request
* @return Count
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The requested resource is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public Count execute() throws ApiException {
ApiResponse localVarResp = getObjectsCountWithHttpInfo(collection, adhocReason, reason, customAudit, reloadCache);
return localVarResp.getData();
}
/**
* Execute getObjectsCount request with HTTP info returned
* @return ApiResponse<Count>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The requested resource is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return getObjectsCountWithHttpInfo(collection, adhocReason, reason, customAudit, reloadCache);
}
/**
* Execute getObjectsCount request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The requested resource is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getObjectsCountAsync(collection, adhocReason, reason, customAudit, reloadCache, _callback);
}
}
/**
* Get object count
* Gets the number of objects in a collection. The role performing this operation must have at least one allowing policy and no denying policies for the `stats` operation. See [identity and access management](/data-security/identity-and-access-management) for more information about how Vault uses policies to control access to data.
* @param collection The name of the collection containing the objects. (required)
* @return APIgetObjectsCountRequest
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The requested resource is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public APIgetObjectsCountRequest getObjectsCount(String collection) {
return new APIgetObjectsCountRequest(collection);
}
private okhttp3.Call listObjectsCall(String collection, String adhocReason, String reason, String customAudit, Boolean reloadCache, Integer pageSize, String cursor, Boolean export, String xTransParam, List xTenantId, List ids, Set options, List props, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/data/collections/{collection}/objects"
.replace("{" + "collection" + "}", localVarApiClient.escapeString(collection.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (adhocReason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("adhoc_reason", adhocReason));
}
if (reason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason));
}
if (customAudit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit));
}
if (reloadCache != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reload_cache", reloadCache));
}
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
}
if (cursor != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor));
}
if (export != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("export", export));
}
if (ids != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "ids", ids));
}
if (options != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "options", options));
}
if (props != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "props", props));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (xTransParam != null) {
localVarHeaderParams.put("X-Trans-Param", localVarApiClient.parameterToString(xTransParam));
}
if (xTenantId != null) {
localVarHeaderParams.put("X-Tenant-Id", localVarApiClient.parameterToString(xTenantId));
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listObjectsValidateBeforeCall(String collection, String adhocReason, String reason, String customAudit, Boolean reloadCache, Integer pageSize, String cursor, Boolean export, String xTransParam, List xTenantId, List ids, Set options, List props, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'collection' is set
if (collection == null) {
throw new ApiException("Missing the required parameter 'collection' when calling listObjects(Async)");
}
return listObjectsCall(collection, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, export, xTransParam, xTenantId, ids, options, props, _callback);
}
private ApiResponse listObjectsWithHttpInfo(String collection, String adhocReason, String reason, String customAudit, Boolean reloadCache, Integer pageSize, String cursor, Boolean export, String xTransParam, List xTenantId, List ids, Set options, List props) throws ApiException {
okhttp3.Call localVarCall = listObjectsValidateBeforeCall(collection, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, export, xTransParam, xTenantId, ids, options, props, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call listObjectsAsync(String collection, String adhocReason, String reason, String customAudit, Boolean reloadCache, Integer pageSize, String cursor, Boolean export, String xTransParam, List xTenantId, List ids, Set options, List props, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = listObjectsValidateBeforeCall(collection, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, export, xTransParam, xTenantId, ids, options, props, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIlistObjectsRequest {
private final String collection;
private String adhocReason;
private String reason;
private String customAudit;
private Boolean reloadCache;
private Integer pageSize;
private String cursor;
private Boolean export;
private String xTransParam;
private List xTenantId;
private List ids;
private Set options;
private List props;
private APIlistObjectsRequest(String collection) {
this.collection = collection;
}
/**
* Set adhocReason
* @param adhocReason An ad-hoc reason for accessing the Vault data. Required when `reason` is set to `Other`. (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest adhocReason(String adhocReason) {
this.adhocReason = adhocReason;
return this;
}
/**
* Set reason
* @param reason Details of the reason for requesting the property. The default is set when no access reason is provided and PVAULT_SERVICE_FORCE_ACCESS_REASON is false. (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest reason(String reason) {
this.reason = reason;
return this;
}
/**
* Set customAudit
* @param customAudit Custom audit information to be included in the audit log. (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest customAudit(String customAudit) {
this.customAudit = customAudit;
return this;
}
/**
* Set reloadCache
* @param reloadCache Reloads the cache before the action. (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest reloadCache(Boolean reloadCache) {
this.reloadCache = reloadCache;
return this;
}
/**
* Set pageSize
* @param pageSize The maximum number of items to return in this request. If not specified, the default value is used. The default value is specified in the [`PVAULT_SERVICE_DEFAULT_PAGE_SIZE` environment variable](/guides/configure/environment-variables#service-and-features). Must not exceed the value specified in the [`PVAULT_SERVICE_MAX_PAGE_SIZE` environment variable](/guides/configure/environment-variables#service-and-features). (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set cursor
* @param cursor The cursor represents the state of consecutive queries for the same request parameters. In the first call, the cursor may be omitted or specified as an empty string. In consecutive calls, it should be set to the value of the cursor field of the objectFieldsPage returned by the previous call. Note: when the `id` is specified, paging is not supported. In this case, if the number of `id` values specified exceeds the maximum page size, the method returns 400 (BAD REQUEST). (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest cursor(String cursor) {
this.cursor = cursor;
return this;
}
/**
* Set export
* @param export Whether to encrypt the property values for export. (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest export(Boolean export) {
this.export = export;
return this;
}
/**
* Set xTransParam
* @param xTransParam Extra parameter to pass on to the transformers. (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest xTransParam(String xTransParam) {
this.xTransParam = xTransParam;
return this;
}
/**
* Set xTenantId
* @param xTenantId List of tenant IDs to enforce on the request. (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest xTenantId(List xTenantId) {
this.xTenantId = xTenantId;
return this;
}
/**
* Set ids
* @param ids A comma-separated list of object IDs (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest ids(List ids) {
this.ids = ids;
return this;
}
/**
* Set options
* @param options Options for the operation. Options include: - `archived` – whether to list only archived objects. If not specified, list only active objects. - `show_builtins` – show built-in properties, can only be specified with `unsafe`. - `unsafe` – fetch all the properties, cannot be specified with `props`. (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest options(Set options) {
this.options = options;
return this;
}
/**
* Set props
* @param props The list of property names and transformations. To include multiple names and transformations, provide a comma-separated list. For example, `props=first_name,last_name,email.mask`. (optional)
* @return APIlistObjectsRequest
*/
public APIlistObjectsRequest props(List props) {
this.props = props;
return this;
}
/**
* Build call for listObjects
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection, properties, or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return listObjectsCall(collection, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, export, xTransParam, xTenantId, ids, options, props, _callback);
}
/**
* Execute listObjects request
* @return ObjectFieldsPage
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection, properties, or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public ObjectFieldsPage execute() throws ApiException {
ApiResponse localVarResp = listObjectsWithHttpInfo(collection, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, export, xTransParam, xTenantId, ids, options, props);
return localVarResp.getData();
}
/**
* Execute listObjects request with HTTP info returned
* @return ApiResponse<ObjectFieldsPage>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection, properties, or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return listObjectsWithHttpInfo(collection, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, export, xTransParam, xTenantId, ids, options, props);
}
/**
* Execute listObjects request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection, properties, or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return listObjectsAsync(collection, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, export, xTransParam, xTenantId, ids, options, props, _callback);
}
}
/**
* List objects
* Returns a [paginated list](/api/api-pagination) of objects from a collection with all or a subset of object property values. To encrypt object property values, set export to true. Values are encrypted using the key specified in the [PVAULT_KMS_EXPORT_URI or PVAULT_KMS_EXPORT_SEED environment variables](/guides/configure/environment-variables#key-management-service). The role performing this operation must have both of the following: - The `CapDataReader` capability. - At least one allowing policy and no denying policies for the `read` operation for each of the properties and the collection requested in the call. See [identity and access management](/data-security/identity-and-access-management) for more information about how capabilities are used to control access to operations and policies are used to control access to data. **Warning**: Use of the `unsafe` option, to include all object property values, may expose more private information than is required, use with caution.
* @param collection (required)
* @return APIlistObjectsRequest
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection, properties, or object is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public APIlistObjectsRequest listObjects(String collection) {
return new APIlistObjectsRequest(collection);
}
private okhttp3.Call searchObjectsCall(String collection, Query query, String adhocReason, String reason, String customAudit, Boolean reloadCache, Integer pageSize, String cursor, String xTransParam, List xTenantId, Set options, List props, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = query;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/data/collections/{collection}/query/objects"
.replace("{" + "collection" + "}", localVarApiClient.escapeString(collection.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (adhocReason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("adhoc_reason", adhocReason));
}
if (reason != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reason", reason));
}
if (customAudit != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit));
}
if (reloadCache != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("reload_cache", reloadCache));
}
if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("page_size", pageSize));
}
if (cursor != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor));
}
if (options != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "options", options));
}
if (props != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "props", props));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (xTransParam != null) {
localVarHeaderParams.put("X-Trans-Param", localVarApiClient.parameterToString(xTransParam));
}
if (xTenantId != null) {
localVarHeaderParams.put("X-Tenant-Id", localVarApiClient.parameterToString(xTenantId));
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call searchObjectsValidateBeforeCall(String collection, Query query, String adhocReason, String reason, String customAudit, Boolean reloadCache, Integer pageSize, String cursor, String xTransParam, List xTenantId, Set options, List props, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'collection' is set
if (collection == null) {
throw new ApiException("Missing the required parameter 'collection' when calling searchObjects(Async)");
}
// verify the required parameter 'query' is set
if (query == null) {
throw new ApiException("Missing the required parameter 'query' when calling searchObjects(Async)");
}
return searchObjectsCall(collection, query, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, xTransParam, xTenantId, options, props, _callback);
}
private ApiResponse searchObjectsWithHttpInfo(String collection, Query query, String adhocReason, String reason, String customAudit, Boolean reloadCache, Integer pageSize, String cursor, String xTransParam, List xTenantId, Set options, List props) throws ApiException {
okhttp3.Call localVarCall = searchObjectsValidateBeforeCall(collection, query, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, xTransParam, xTenantId, options, props, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call searchObjectsAsync(String collection, Query query, String adhocReason, String reason, String customAudit, Boolean reloadCache, Integer pageSize, String cursor, String xTransParam, List xTenantId, Set options, List props, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = searchObjectsValidateBeforeCall(collection, query, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, xTransParam, xTenantId, options, props, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIsearchObjectsRequest {
private final String collection;
private final Query query;
private String adhocReason;
private String reason;
private String customAudit;
private Boolean reloadCache;
private Integer pageSize;
private String cursor;
private String xTransParam;
private List xTenantId;
private Set options;
private List props;
private APIsearchObjectsRequest(String collection, Query query) {
this.collection = collection;
this.query = query;
}
/**
* Set adhocReason
* @param adhocReason An ad-hoc reason for accessing the Vault data. Required when `reason` is set to `Other`. (optional)
* @return APIsearchObjectsRequest
*/
public APIsearchObjectsRequest adhocReason(String adhocReason) {
this.adhocReason = adhocReason;
return this;
}
/**
* Set reason
* @param reason Details of the reason for requesting the property. The default is set when no access reason is provided and PVAULT_SERVICE_FORCE_ACCESS_REASON is false. (optional)
* @return APIsearchObjectsRequest
*/
public APIsearchObjectsRequest reason(String reason) {
this.reason = reason;
return this;
}
/**
* Set customAudit
* @param customAudit Custom audit information to be included in the audit log. (optional)
* @return APIsearchObjectsRequest
*/
public APIsearchObjectsRequest customAudit(String customAudit) {
this.customAudit = customAudit;
return this;
}
/**
* Set reloadCache
* @param reloadCache Reloads the cache before the action. (optional)
* @return APIsearchObjectsRequest
*/
public APIsearchObjectsRequest reloadCache(Boolean reloadCache) {
this.reloadCache = reloadCache;
return this;
}
/**
* Set pageSize
* @param pageSize The maximum number of items to return in this request. If not specified, the default value is used. The default value is specified in the [`PVAULT_SERVICE_DEFAULT_PAGE_SIZE` environment variable](/guides/configure/environment-variables#service-and-features). Must not exceed the value specified in the [`PVAULT_SERVICE_MAX_PAGE_SIZE` environment variable](/guides/configure/environment-variables#service-and-features). (optional)
* @return APIsearchObjectsRequest
*/
public APIsearchObjectsRequest pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set cursor
* @param cursor The cursor represents the state of consecutive queries for the same request parameters. In the first call, the cursor may be omitted or specified as an empty string. In consecutive calls, it should be set to the value of the cursor field of the objectFieldsPage returned by the previous call. Note: when the `id` is specified, paging is not supported. In this case, if the number of `id` values specified exceeds the maximum page size, the method returns 400 (BAD REQUEST). (optional)
* @return APIsearchObjectsRequest
*/
public APIsearchObjectsRequest cursor(String cursor) {
this.cursor = cursor;
return this;
}
/**
* Set xTransParam
* @param xTransParam Extra parameter to pass on to the transformers. (optional)
* @return APIsearchObjectsRequest
*/
public APIsearchObjectsRequest xTransParam(String xTransParam) {
this.xTransParam = xTransParam;
return this;
}
/**
* Set xTenantId
* @param xTenantId List of tenant IDs to enforce on the request. (optional)
* @return APIsearchObjectsRequest
*/
public APIsearchObjectsRequest xTenantId(List xTenantId) {
this.xTenantId = xTenantId;
return this;
}
/**
* Set options
* @param options Options for the operation. Options include: - `archived` – whether to search only archived objects. If not specified, search only active objects. - `show_builtins` – show built-in properties, can only be specified with `unsafe`. - `unsafe` – fetch all the properties, cannot be specified with `props`. (optional)
* @return APIsearchObjectsRequest
*/
public APIsearchObjectsRequest options(Set options) {
this.options = options;
return this;
}
/**
* Set props
* @param props The list of property names and transformations. To include multiple names and transformations, provide a comma-separated list. For example, `props=first_name,last_name,email.mask`. (optional)
* @return APIsearchObjectsRequest
*/
public APIsearchObjectsRequest props(List props) {
this.props = props;
return this;
}
/**
* Build call for searchObjects
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return searchObjectsCall(collection, query, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, xTransParam, xTenantId, options, props, _callback);
}
/**
* Execute searchObjects request
* @return ObjectFieldsPage
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Response Details
Status Code Description Response Headers
200 The request is successful. -
400 The request is invalid. -
401 Authentication credentials are incorrect or missing. -
403 The caller doesn't have the required access rights. -
404 The collection or properties is not found. -
405 The operation is not allowed. -
409 A conflict occurs. -
410 Access to a resource that is no longer available occurs. -
500 An error occurs on the server. -
501 Not implemented. -
503 The service is unavailable. -
*/
public ObjectFieldsPage execute() throws ApiException {
ApiResponse localVarResp = searchObjectsWithHttpInfo(collection, query, adhocReason, reason, customAudit, reloadCache, pageSize, cursor, xTransParam, xTenantId, options, props);
return localVarResp.getData();
}
/**
* Execute searchObjects request with HTTP info returned
* @return ApiResponse<ObjectFieldsPage>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details