UNPKG

@piiano/vault-client

Version:

Piiano Vault generated typescript client

214 lines 9.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CollectionPropertiesClient = void 0; class CollectionPropertiesClient { constructor(httpRequest) { this.httpRequest = httpRequest; } /** * List collection properties * Lists the properties of a collection. * * 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 Property The request is successful. * @throws ApiError */ listCollectionProperties({ collection, customAudit, options, additionalHeaders = {}, }) { return this.httpRequest.request({ method: 'GET', url: '/api/pvlt/1.0/ctl/collections/{collection}/properties', path: { 'collection': collection, }, headers: additionalHeaders, query: { 'custom_audit': customAudit, 'options': options, }, errors: { 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.`, }, }); } /** * Add collection property * Adds a property to a collection. * * The property name in the `property` parameter and request body must match. Only nullable properties can be added to the collection when the collection contains objects. * * :::note * The combined length of the collection name and the longest property name can not exceed 40 characters. * ::: * * See the [Add a property](/guides/manage-collections-and-schemas/update-a-collection#add-a-property) in the Update 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 Property The request is successful. * @throws ApiError */ addCollectionProperty({ collection, property, requestBody, customAudit, additionalHeaders = {}, }) { return this.httpRequest.request({ method: 'POST', url: '/api/pvlt/1.0/ctl/collections/{collection}/properties/{property}', path: { 'collection': collection, 'property': property, }, headers: additionalHeaders, query: { 'custom_audit': customAudit, }, body: requestBody, mediaType: 'application/json', errors: { 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.`, }, }); } /** * Get collection property * Gets a property of a collection. * * See the [Get a property](/guides/manage-collections-and-schemas/update-a-collection#get-a-property) in the Update 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 Property The request is successful. * @throws ApiError */ getCollectionProperty({ collection, property, customAudit, additionalHeaders = {}, }) { return this.httpRequest.request({ method: 'GET', url: '/api/pvlt/1.0/ctl/collections/{collection}/properties/{property}', path: { 'collection': collection, 'property': property, }, headers: additionalHeaders, query: { 'custom_audit': customAudit, }, errors: { 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 property 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.`, }, }); } /** * Update collection property * Updates the attributes of a collection property. Can update these property attributes: * * `description` * * `is_index` * * `is_substring_index` (only from `true` to `false`) * * `is_nullable` (only from `false` to `true`) * * `is_unique` (only from `true` to `false`) * * :::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 property](/guides/manage-collections-and-schemas/update-a-collection#update-a-property) in the 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 Property The request is successful. * @throws ApiError */ updateCollectionProperty({ collection, property, requestBody, customAudit, additionalHeaders = {}, }) { return this.httpRequest.request({ method: 'PATCH', url: '/api/pvlt/1.0/ctl/collections/{collection}/properties/{property}', path: { 'collection': collection, 'property': property, }, headers: additionalHeaders, query: { 'custom_audit': customAudit, }, body: requestBody, mediaType: 'application/json', errors: { 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 property wasn't 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.`, }, }); } /** * Delete collection property * Deletes a property from a collection. * * Any values stored against the property in objects are also deleted. This operation is irreversible. * * See the [Delete a property](/guides/manage-collections-and-schemas/update-a-collection#delete-a-property) in the 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 any The request is successful. * @throws ApiError */ deleteCollectionProperty({ collection, property, customAudit, additionalHeaders = {}, }) { return this.httpRequest.request({ method: 'DELETE', url: '/api/pvlt/1.0/ctl/collections/{collection}/properties/{property}', path: { 'collection': collection, 'property': property, }, headers: additionalHeaders, query: { 'custom_audit': customAudit, }, errors: { 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 property wasn't 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.`, }, }); } } exports.CollectionPropertiesClient = CollectionPropertiesClient; //# sourceMappingURL=CollectionPropertiesClient.js.map