import { APIResource } from "../../core/resource.mjs"; import { APIPromise } from "../../core/api-promise.mjs"; import { RequestOptions } from "../../internal/request-options.mjs"; export declare class APIKeys extends APIResource { /** * Create sub-account API key. Requires a parent project API key; sub-account API * keys receive HTTP 403. * * @example * ```ts * const apiKey = await client.subAccounts.apiKeys.create( * 'id', * { name: 'Production Key', environment: 'live' }, * ); * ``` */ create(id: string, body: APIKeyCreateParams, options?: RequestOptions): APIPromise; /** * List sub-account API keys. Requires a parent project API key; sub-account API * keys receive HTTP 403. * * @example * ```ts * const apiKeys = await client.subAccounts.apiKeys.list('id'); * ``` */ list(id: string, options?: RequestOptions): APIPromise; /** * Revoke sub-account API key. Requires a parent project API key; sub-account API * keys receive HTTP 403. * * @example * ```ts * await client.subAccounts.apiKeys.revoke('keyId', { * id: 'id', * }); * ``` */ revoke(keyID: string, params: APIKeyRevokeParams, options?: RequestOptions): APIPromise; } export interface APIKeyCreateResponse { apiKey: APIKeyCreateResponse.APIKey; } export declare namespace APIKeyCreateResponse { interface APIKey { id: string; environment: 'live' | 'test'; key: string; name: string; } } export interface APIKeyListResponse { items: Array; } export declare namespace APIKeyListResponse { interface Item { id: string; createdAt: number; environment: 'live' | 'test'; /** * First characters of the key for identification. */ keyPrefix: string; name: string; /** * Full API key. Only returned on creation. */ key?: string; lastUsedAt?: number | null; permissions?: Array; revokedAt?: number | null; } } export interface APIKeyCreateParams { name: string; environment?: 'live' | 'test'; permissions?: Array; } export interface APIKeyRevokeParams { /** * Sub-account ID. */ id: string; } export declare namespace APIKeys { export { type APIKeyCreateResponse as APIKeyCreateResponse, type APIKeyListResponse as APIKeyListResponse, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyRevokeParams as APIKeyRevokeParams, }; } //# sourceMappingURL=api-keys.d.mts.map