export type DeleteApiV1SubAccountsIdApiKeysKeyIdArgs = {id: string, keyId: string}; export type DeleteApiV1SubAccountsIdApiKeysKeyIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Revoke sub-account API key * * DELETE /v1/sub-accounts/{id}/api-keys/{keyId} */ export const deleteApiV1SubAccountsIdApiKeysKeyId = async (args: DeleteApiV1SubAccountsIdApiKeysKeyIdArgs, options?: DeleteApiV1SubAccountsIdApiKeysKeyIdOptions) => { const {baseUrl = "https://api.zavu.dev", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/sub-accounts/${encodeURIComponent(String(args.id))}/api-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 };