UNPKG

@piiano/vault-client

Version:

Piiano Vault generated typescript client

185 lines 7.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BundlesClient = void 0; class BundlesClient { constructor(httpRequest) { this.httpRequest = httpRequest; } /** * List bundles * Lists the Vault bundles. * * The role that performs this operation must have the `CapCodeReader` capability. * See [Access control](/data-security/identity-and-access-management#access-control) for more information about how * capabilities control access to operations. * @returns Bundle The request is successful. * @throws ApiError */ listBundles({ customAudit, additionalHeaders = {}, } = {}) { return this.httpRequest.request({ method: 'GET', url: '/api/pvlt/1.0/ctl/bundles', 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 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.`, 503: `The service is unavailable.`, }, }); } /** * Add bundle * Adds a bundle. * * See [Create the bundles](/guides/create-custom-data-types/create-a-custom-data-type#create-the-bundles) in the Create a custom data type guide for more information on using this operation. * * The role performing this operation must have the `CapCodeWriter` capability. * See [Access control](/data-security/identity-and-access-management#access-control) for more information about how * capabilities control access to operations. * @returns Bundle The request is successful. * @throws ApiError */ addBundle({ requestBody, customAudit, additionalHeaders = {}, }) { return this.httpRequest.request({ method: 'POST', url: '/api/pvlt/1.0/ctl/bundles', 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: `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.`, }, }); } /** * Get bundle * Gets a bundle. * * The role that performs this operation must have the `CapCodeReader` capability. * See [Access control](/data-security/identity-and-access-management#access-control) for more information about how * capabilities control access to operations. * @returns Bundle The request is successful. * @throws ApiError */ getBundle({ bundle, customAudit, additionalHeaders = {}, }) { return this.httpRequest.request({ method: 'GET', url: '/api/pvlt/1.0/ctl/bundles/{bundle}', path: { 'bundle': bundle, }, 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 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.`, 503: `The service is unavailable.`, }, }); } /** * Update bundle * Updates a bundle. * * An update is allowed only if the prototypes of the JavaScript functions in the request are a superset of those in the * bundle. * The name of the bundle can't be updated. * * The role performing this operation must have the `CapCodeWriter` capability. * See [Access control](/data-security/identity-and-access-management#access-control) for more information about how * capabilities control access to operations. * @returns Bundle The request is successful. * @throws ApiError */ updateBundle({ bundle, requestBody, customAudit, additionalHeaders = {}, }) { return this.httpRequest.request({ method: 'PATCH', url: '/api/pvlt/1.0/ctl/bundles/{bundle}', path: { 'bundle': bundle, }, 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 bundle 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.`, }, }); } /** * Delete bundle * Deletes a bundle. * * The role that performs this operation must have the `CapCodeWriter` 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 */ deleteBundle({ bundle, customAudit, options, additionalHeaders = {}, }) { return this.httpRequest.request({ method: 'DELETE', url: '/api/pvlt/1.0/ctl/bundles/{bundle}', path: { 'bundle': bundle, }, 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 bundle 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.`, }, }); } } exports.BundlesClient = BundlesClient; //# sourceMappingURL=BundlesClient.js.map