export type DeleteApiV1AccountKeysKeyIdArgs = {keyId: string}; export type DeleteApiV1AccountKeysKeyIdOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Revoke an API key immediately. The key will no longer authenticate requests. This action is irreversible. * * DELETE /v1/account/keys/{keyId} * * Also accepts auth: bearerAuth */ export const deleteApiV1AccountKeysKeyId = async (args: DeleteApiV1AccountKeysKeyIdArgs, options: DeleteApiV1AccountKeysKeyIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("X-API-Key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/account/keys/${encodeURIComponent(String(args.keyId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };