export type DeleteApiServiceAccountsServiceAccountIdArgs = {service_account_id: string}; export type DeleteApiServiceAccountsServiceAccountIdOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Revoke Service Account * * DELETE /service-accounts/{service_account_id} */ export const deleteApiServiceAccountsServiceAccountId = async (args: DeleteApiServiceAccountsServiceAccountIdArgs, options: DeleteApiServiceAccountsServiceAccountIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/service-accounts/${encodeURIComponent(String(args.service_account_id))}${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 };