/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as Vectara from "../../../index"; export declare namespace ApiKeys { interface Options { environment?: core.Supplier; token?: core.Supplier; /** Override the x-api-key header */ apiKey?: core.Supplier; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the x-api-key header */ apiKey?: string | undefined; /** Additional headers to include in the request. */ headers?: Record; } } /** * Manage API keys for the account */ export declare class ApiKeys { protected readonly _options: ApiKeys.Options; constructor(_options?: ApiKeys.Options); /** * @param {Vectara.ApiKeysListRequest} request * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.BadRequestError} * @throws {@link Vectara.ForbiddenError} * * @example * await client.apiKeys.list({ * corpusKey: "my-corpus" * }) */ list(request?: Vectara.ApiKeysListRequest, requestOptions?: ApiKeys.RequestOptions): Promise>; /** * An API key is to authenticate when calling Vectara APIs. * * @param {Vectara.CreateApiKeyRequest} request * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.BadRequestError} * @throws {@link Vectara.ForbiddenError} * * @example * await client.apiKeys.create({ * name: "name", * apiKeyRole: "serving" * }) */ create(request: Vectara.CreateApiKeyRequest, requestOptions?: ApiKeys.RequestOptions): Promise; /** * @param {string} apiKeyId - The ID of the API key. * @param {Vectara.ApiKeysGetRequest} request * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.ForbiddenError} * * @example * await client.apiKeys.get("api_key_id") */ get(apiKeyId: string, request?: Vectara.ApiKeysGetRequest, requestOptions?: ApiKeys.RequestOptions): Promise; /** * Delete API keys to help you manage the security and lifecycle of API keys in your application. * * @param {string} apiKeyId - The ID of the API key. * @param {Vectara.ApiKeysDeleteRequest} request * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.ForbiddenError} * * @example * await client.apiKeys.delete("api_key_id") */ delete(apiKeyId: string, request?: Vectara.ApiKeysDeleteRequest, requestOptions?: ApiKeys.RequestOptions): Promise; /** * Update an API key such as the roles attached to the key. * * @param {string} apiKeyId - The ID of the API key. * @param {Vectara.UpdateApiKeyRequest} request * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vectara.ForbiddenError} * * @example * await client.apiKeys.update("api_key_id") */ update(apiKeyId: string, request?: Vectara.UpdateApiKeyRequest, requestOptions?: ApiKeys.RequestOptions): Promise; protected _getAuthorizationHeader(): Promise; }