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

com.piiano.vault.client.openapi.CollectionsApi Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
/*
 * 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.Collection;
import com.piiano.vault.client.openapi.model.RestHTTPError;
import java.util.Set;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;

public class CollectionsApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

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

    public CollectionsApi(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 addCollectionCall(Collection collection, String format, String customAudit, Set options, 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 = collection;

        // create path and map variables
        String localVarPath = "/api/pvlt/1.0/ctl/collections";

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

        if (format != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("format", format));
        }

        if (customAudit != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit));
        }

        if (options != null) {
            localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "options", options));
        }

        final String[] localVarAccepts = {
            "application/json",
            "application/pvschema"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json",
            "application/pvschema"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] { "bearerAuth" };
        return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call addCollectionValidateBeforeCall(Collection collection, String format, String customAudit, Set options, 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 addCollection(Async)");
        }

        return addCollectionCall(collection, format, customAudit, options, _callback);

    }


    private ApiResponse addCollectionWithHttpInfo(Collection collection, String format, String customAudit, Set options) throws ApiException {
        okhttp3.Call localVarCall = addCollectionValidateBeforeCall(collection, format, customAudit, options, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call addCollectionAsync(Collection collection, String format, String customAudit, Set options, final ApiCallback _callback) throws ApiException {

        okhttp3.Call localVarCall = addCollectionValidateBeforeCall(collection, format, customAudit, options, _callback);
        Type localVarReturnType = new TypeToken(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public class APIaddCollectionRequest {
        private final Collection collection;
        private String format;
        private String customAudit;
        private Set options;

        private APIaddCollectionRequest(Collection collection) {
            this.collection = collection;
        }

        /**
         * Set format
         * @param format The format of the response. Overrides any `Accept` header value provided. (optional, default to json)
         * @return APIaddCollectionRequest
         */
        public APIaddCollectionRequest format(String format) {
            this.format = format;
            return this;
        }

        /**
         * Set customAudit
         * @param customAudit Custom audit information to be included in the audit log. (optional)
         * @return APIaddCollectionRequest
         */
        public APIaddCollectionRequest customAudit(String customAudit) {
            this.customAudit = customAudit;
            return this;
        }

        /**
         * Set options
         * @param options Options for the operation. Options include: - `show_builtins` – show built-in properties in the response.  (optional)
         * @return APIaddCollectionRequest
         */
        public APIaddCollectionRequest options(Set options) {
            this.options = options;
            return this;
        }

        /**
         * Build call for addCollection
         * @param _callback ApiCallback API callback
         * @return Call to execute
         * @throws ApiException If fail to serialize the request body object
         * @http.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 Reserved for future use. -
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. -
503 The service is unavailable. -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return addCollectionCall(collection, format, customAudit, options, _callback); } /** * Execute addCollection request * @return Collection * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.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 Reserved for future use. -
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. -
503 The service is unavailable. -
*/ public Collection execute() throws ApiException { ApiResponse localVarResp = addCollectionWithHttpInfo(collection, format, customAudit, options); return localVarResp.getData(); } /** * Execute addCollection request with HTTP info returned * @return ApiResponse<Collection> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.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 Reserved for future use. -
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. -
503 The service is unavailable. -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return addCollectionWithHttpInfo(collection, format, customAudit, options); } /** * Execute addCollection 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
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 Reserved for future use. -
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. -
503 The service is unavailable. -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return addCollectionAsync(collection, format, customAudit, options, _callback); } } /** * Add collection * Adds a collection. The collection request can be provided in JSON or PVSchema format by setting the `Content-Type` header to `application/json` or `application/pvschema`, respectively. The collection can be returned in JSON or PVSchema format using the `format` query parameter or by setting the `Accept` header to `application/json` or `application/pvschema`, respectively. The default is to return JSON. See [PVSchema](/guides/reference/pvschema) for more details on the structure and content of PVSchema. Invalid optional `properties` attributes in a JSON request are ignored. :::note The combined length of the collection name and the longest property name can not exceed 40 characters. ::: The role performing this operation must have the `CapCollectionsWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations. * @param collection Details of the collection including its properties. (required) * @return APIaddCollectionRequest * @http.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 Reserved for future use. -
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. -
503 The service is unavailable. -
*/ public APIaddCollectionRequest addCollection(Collection collection) { return new APIaddCollectionRequest(collection); } private okhttp3.Call deleteCollectionCall(String collection, String customAudit, 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/ctl/collections/{collection}" .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 (customAudit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit)); } 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteCollectionValidateBeforeCall(String collection, String customAudit, 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 deleteCollection(Async)"); } return deleteCollectionCall(collection, customAudit, _callback); } private ApiResponse deleteCollectionWithHttpInfo(String collection, String customAudit) throws ApiException { okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collection, customAudit, null); return localVarApiClient.execute(localVarCall); } private okhttp3.Call deleteCollectionAsync(String collection, String customAudit, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteCollectionValidateBeforeCall(collection, customAudit, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } public class APIdeleteCollectionRequest { private final String collection; private String customAudit; private APIdeleteCollectionRequest(String collection) { this.collection = collection; } /** * Set customAudit * @param customAudit Custom audit information to be included in the audit log. (optional) * @return APIdeleteCollectionRequest */ public APIdeleteCollectionRequest customAudit(String customAudit) { this.customAudit = customAudit; return this; } /** * Build call for deleteCollection * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.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 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. -
503 The service is unavailable. -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return deleteCollectionCall(collection, customAudit, _callback); } /** * Execute deleteCollection request * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.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 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. -
503 The service is unavailable. -
*/ public void execute() throws ApiException { deleteCollectionWithHttpInfo(collection, customAudit); } /** * Execute deleteCollection 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
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 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. -
503 The service is unavailable. -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return deleteCollectionWithHttpInfo(collection, customAudit); } /** * Execute deleteCollection 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
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 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. -
503 The service is unavailable. -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return deleteCollectionAsync(collection, customAudit, _callback); } } /** * Delete collection * Deletes a collection. The role that performs this operation must have the `CapCollectionsWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations. * @param collection (required) * @return APIdeleteCollectionRequest * @http.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 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. -
503 The service is unavailable. -
*/ public APIdeleteCollectionRequest deleteCollection(String collection) { return new APIdeleteCollectionRequest(collection); } private okhttp3.Call getCollectionCall(String collection, String customAudit, String format, Set options, 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/ctl/collections/{collection}" .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 (customAudit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit)); } if (format != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("format", format)); } if (options != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "options", options)); } final String[] localVarAccepts = { "application/json", "application/pvschema" }; 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 getCollectionValidateBeforeCall(String collection, String customAudit, String format, Set options, 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 getCollection(Async)"); } return getCollectionCall(collection, customAudit, format, options, _callback); } private ApiResponse getCollectionWithHttpInfo(String collection, String customAudit, String format, Set options) throws ApiException { okhttp3.Call localVarCall = getCollectionValidateBeforeCall(collection, customAudit, format, options, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getCollectionAsync(String collection, String customAudit, String format, Set options, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getCollectionValidateBeforeCall(collection, customAudit, format, options, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIgetCollectionRequest { private final String collection; private String customAudit; private String format; private Set options; private APIgetCollectionRequest(String collection) { this.collection = collection; } /** * Set customAudit * @param customAudit Custom audit information to be included in the audit log. (optional) * @return APIgetCollectionRequest */ public APIgetCollectionRequest customAudit(String customAudit) { this.customAudit = customAudit; return this; } /** * Set format * @param format The format of the response. Overrides any `Accept` header value provided. (optional, default to json) * @return APIgetCollectionRequest */ public APIgetCollectionRequest format(String format) { this.format = format; return this; } /** * Set options * @param options Options for the operation. Options include: - `show_builtins` – show built-in properties in the response. (optional) * @return APIgetCollectionRequest */ public APIgetCollectionRequest options(Set options) { this.options = options; return this; } /** * Build call for getCollection * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.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 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. -
503 The service is unavailable. -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return getCollectionCall(collection, customAudit, format, options, _callback); } /** * Execute getCollection request * @return Collection * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.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 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. -
503 The service is unavailable. -
*/ public Collection execute() throws ApiException { ApiResponse localVarResp = getCollectionWithHttpInfo(collection, customAudit, format, options); return localVarResp.getData(); } /** * Execute getCollection request with HTTP info returned * @return ApiResponse<Collection> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.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 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. -
503 The service is unavailable. -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return getCollectionWithHttpInfo(collection, customAudit, format, options); } /** * Execute getCollection 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
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 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. -
503 The service is unavailable. -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return getCollectionAsync(collection, customAudit, format, options, _callback); } } /** * Get collection * Gets a collection and its properties. The collection details can be returned in JSON or PVSchema format using the `format` query parameter or by setting the `Accept` header to `application/json` or `application/pvschema`, respectively. The default is to return JSON. See [PVSchema](/guides/reference/pvschema) for more details on the structure and content of PVSchema. The role that performs this operation must have the `CapCollectionsReader` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations. * @param collection (required) * @return APIgetCollectionRequest * @http.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 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. -
503 The service is unavailable. -
*/ public APIgetCollectionRequest getCollection(String collection) { return new APIgetCollectionRequest(collection); } private okhttp3.Call listCollectionsCall(String format, String customAudit, Set options, 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/ctl/collections"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (format != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("format", format)); } if (customAudit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit)); } if (options != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "options", options)); } final String[] localVarAccepts = { "application/json", "application/pvschema" }; 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 listCollectionsValidateBeforeCall(String format, String customAudit, Set options, final ApiCallback _callback) throws ApiException { return listCollectionsCall(format, customAudit, options, _callback); } private ApiResponse> listCollectionsWithHttpInfo(String format, String customAudit, Set options) throws ApiException { okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(format, customAudit, options, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call listCollectionsAsync(String format, String customAudit, Set options, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = listCollectionsValidateBeforeCall(format, customAudit, options, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIlistCollectionsRequest { private String format; private String customAudit; private Set options; private APIlistCollectionsRequest() { } /** * Set format * @param format The format of the response. Overrides any `Accept` header value provided. (optional, default to json) * @return APIlistCollectionsRequest */ public APIlistCollectionsRequest format(String format) { this.format = format; return this; } /** * Set customAudit * @param customAudit Custom audit information to be included in the audit log. (optional) * @return APIlistCollectionsRequest */ public APIlistCollectionsRequest customAudit(String customAudit) { this.customAudit = customAudit; return this; } /** * Set options * @param options Options for the operation. Options include: - `show_builtins` – show built-in properties in the response. (optional) * @return APIlistCollectionsRequest */ public APIlistCollectionsRequest options(Set options) { this.options = options; return this; } /** * Build call for listCollections * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.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 Reserved for future use. -
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. -
503 The service is unavailable. -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return listCollectionsCall(format, customAudit, options, _callback); } /** * Execute listCollections request * @return List<Collection> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.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 Reserved for future use. -
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. -
503 The service is unavailable. -
*/ public List execute() throws ApiException { ApiResponse> localVarResp = listCollectionsWithHttpInfo(format, customAudit, options); return localVarResp.getData(); } /** * Execute listCollections request with HTTP info returned * @return ApiResponse<List<Collection>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.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 Reserved for future use. -
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. -
503 The service is unavailable. -
*/ public ApiResponse> executeWithHttpInfo() throws ApiException { return listCollectionsWithHttpInfo(format, customAudit, options); } /** * Execute listCollections 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
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 Reserved for future use. -
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. -
503 The service is unavailable. -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { return listCollectionsAsync(format, customAudit, options, _callback); } } /** * List collections * Lists all collections. The collections can be returned in JSON or PVSchema format using the `format` query parameter or by setting the `Accept` header to `application/json` or `application/pvschema`, respectively. The default is to return JSON. See [PVSchema](/guides/reference/pvschema) for more details on the structure and content of PVSchema. The PVSchema format for multiple collections is the PVSchema for each collection string concatenated with a newline. The role that performs this operation must have the `CapCollectionsReader` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations. * @return APIlistCollectionsRequest * @http.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 Reserved for future use. -
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. -
503 The service is unavailable. -
*/ public APIlistCollectionsRequest listCollections() { return new APIlistCollectionsRequest(); } private okhttp3.Call updateCollectionCall(String collection, Collection collection2, String format, String customAudit, Set options, 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 = collection2; // create path and map variables String localVarPath = "/api/pvlt/1.0/ctl/collections/{collection}" .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 (format != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("format", format)); } if (customAudit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("custom_audit", customAudit)); } if (options != null) { localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "options", options)); } final String[] localVarAccepts = { "application/json", "application/pvschema" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json", "application/pvschema" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "bearerAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateCollectionValidateBeforeCall(String collection, Collection collection2, String format, String customAudit, Set options, 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 updateCollection(Async)"); } // verify the required parameter 'collection2' is set if (collection2 == null) { throw new ApiException("Missing the required parameter 'collection2' when calling updateCollection(Async)"); } return updateCollectionCall(collection, collection2, format, customAudit, options, _callback); } private ApiResponse updateCollectionWithHttpInfo(String collection, Collection collection2, String format, String customAudit, Set options) throws ApiException { okhttp3.Call localVarCall = updateCollectionValidateBeforeCall(collection, collection2, format, customAudit, options, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call updateCollectionAsync(String collection, Collection collection2, String format, String customAudit, Set options, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateCollectionValidateBeforeCall(collection, collection2, format, customAudit, options, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIupdateCollectionRequest { private final String collection; private final Collection collection2; private String format; private String customAudit; private Set options; private APIupdateCollectionRequest(String collection, Collection collection2) { this.collection = collection; this.collection2 = collection2; } /** * Set format * @param format The format of the response. Overrides any `Accept` header value provided. (optional, default to json) * @return APIupdateCollectionRequest */ public APIupdateCollectionRequest format(String format) { this.format = format; return this; } /** * Set customAudit * @param customAudit Custom audit information to be included in the audit log. (optional) * @return APIupdateCollectionRequest */ public APIupdateCollectionRequest customAudit(String customAudit) { this.customAudit = customAudit; return this; } /** * Set options * @param options Options for the operation. Options include: - `show_builtins` – show built-in properties in the response. (optional) * @return APIupdateCollectionRequest */ public APIupdateCollectionRequest options(Set options) { this.options = options; return this; } /** * Build call for updateCollection * @param _callback ApiCallback API callback * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.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 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 updateCollectionCall(collection, collection2, format, customAudit, options, _callback); } /** * Execute updateCollection request * @return Collection * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.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 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 Collection execute() throws ApiException { ApiResponse localVarResp = updateCollectionWithHttpInfo(collection, collection2, format, customAudit, options); return localVarResp.getData(); } /** * Execute updateCollection request with HTTP info returned * @return ApiResponse<Collection> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.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 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 updateCollectionWithHttpInfo(collection, collection2, format, customAudit, options); } /** * Execute updateCollection 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
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 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 updateCollectionAsync(collection, collection2, format, customAudit, options, _callback); } } /** * Update collection * Updates properties of a collection. The update includes: - Adding any properties in the request that are not in the collection. - Amending the `description`, `is_unique`, `is_index`, `is_substring_index`, and `is_nullable` attributes, where they have changed, for any properties in the request that are in the collection. - `is_nullable` can only be changed from `false` to `true`. - `is_unique` can only be changed from `true` to `false`. - `is_substring_index` can only be changed from `true` to `false`. - All other property attributes are ignored. :::note The combined length of the collection name and the longest property name can not exceed 40 characters. ::: The collection request can be provided in JSON or PVSchema format by setting the `Content-Type` header to `application/json` or `application/pvschema`, respectively. The collection can be returned in JSON or PVSchema format using the `format` query parameter or by setting the `Accept` header to `application/json` or `application/pvschema`, respectively. The default is to return JSON. See [PVSchema](/guides/reference/pvschema) for more details on the structure and content of PVSchema. The collection name provided in the path parameter must match the collection name in the JSON or PVSchema. The response contains the collection with all the properties. :::info This command may take a while to complete (e.g. when adding an index) and is excluded from Vault's standard call timeout. ::: The role that performs this operation must have the `CapCollectionsWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations. * @param collection (required) * @param collection2 Details of the collection, including its properties. (required) * @return APIupdateCollectionRequest * @http.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 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 APIupdateCollectionRequest updateCollection(String collection, Collection collection2) { return new APIupdateCollectionRequest(collection, collection2); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy