UNPKG

@piiano/vault-client

Version:

Piiano Vault generated typescript client

199 lines 9.67 kB
import type { Collection } from '../models/Collection'; import type { CancelablePromise } from '../core/CancelablePromise'; import type { BaseHttpRequest } from '../core/BaseHttpRequest'; export declare class CollectionsClient { readonly httpRequest: BaseHttpRequest; constructor(httpRequest: BaseHttpRequest); /** * 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. * * See the [List collections](/guides/manage-collections-and-schemas/list-all-collections) guide for more information on using this operation. * * 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 control access to operations. * * @returns Collection The request is successful. * @throws ApiError */ listCollections({ format, customAudit, options, additionalHeaders, }?: { /** * The format of the response. Overrides any `Accept` header value provided. */ format?: 'pvschema' | 'json'; /** * Custom audit information to be included in the audit log. */ customAudit?: string; /** * Options for the operation. Options include: * - `show_builtins` – show built-in properties in the response. * */ options?: Array<'show_builtins'>; additionalHeaders?: Record<string, string>; }): CancelablePromise<Array<Collection>>; /** * 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. * ::: * * See the [Create a collection](/guides/manage-collections-and-schemas/create-a-collection) guide for more information on using this operation. * * 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 control access to operations. * @returns Collection The request is successful. * @throws ApiError */ addCollection({ requestBody, format, customAudit, options, additionalHeaders, }: { /** * Details of the collection including its properties. */ requestBody: Collection; /** * The format of the response. Overrides any `Accept` header value provided. */ format?: 'pvschema' | 'json'; /** * Custom audit information to be included in the audit log. */ customAudit?: string; /** * Options for the operation. Options include: * - `show_builtins` – show built-in properties in the response. * */ options?: Array<'show_builtins'>; additionalHeaders?: Record<string, string>; }): CancelablePromise<Collection>; /** * 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. * * See the [Retrieve a collection](/guides/manage-collections-and-schemas/retrieve-a-collection) guide for more information on using this operation. * * 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 control access to operations. * * @returns Collection The request is successful. * @throws ApiError */ getCollection({ collection, customAudit, format, options, additionalHeaders, }: { collection: string; /** * Custom audit information to be included in the audit log. */ customAudit?: string; /** * The format of the response. Overrides any `Accept` header value provided. */ format?: 'pvschema' | 'json'; /** * Options for the operation. Options include: * - `show_builtins` – show built-in properties in the response. * */ options?: Array<'show_builtins'>; additionalHeaders?: Record<string, string>; }): CancelablePromise<Collection>; /** * Update collection * Updates properties of a collection. * * The update: * - Adds any properties in the request that are not in the collection. * - Amends 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. * ::: * * See the [Update a collection](/guides/manage-collections-and-schemas/update-a-collection) guide for more information on using this operation. * * 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 control access to operations. * * @returns Collection The request is successful. * @throws ApiError */ updateCollection({ collection, requestBody, format, customAudit, options, additionalHeaders, }: { collection: string; /** * Details of the collection, including its properties. */ requestBody: Collection; /** * The format of the response. Overrides any `Accept` header value provided. */ format?: 'pvschema' | 'json'; /** * Custom audit information to be included in the audit log. */ customAudit?: string; /** * Options for the operation. Options include: * - `show_builtins` – show built-in properties in the response. * */ options?: Array<'show_builtins'>; additionalHeaders?: Record<string, string>; }): CancelablePromise<Collection>; /** * Delete collection * Deletes a collection. * * See the [Delete a collection](/guides/manage-collections-and-schemas/delete-a-collection) guide for more information on using this operation. * * 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 control access to operations. * @returns any The request is successful. * @throws ApiError */ deleteCollection({ collection, customAudit, additionalHeaders, }: { collection: string; /** * Custom audit information to be included in the audit log. */ customAudit?: string; additionalHeaders?: Record<string, string>; }): CancelablePromise<any>; } //# sourceMappingURL=CollectionsClient.d.ts.map