export type DeleteApiApiAccountsAccountIdArgs = {account_id: string, 'X-Workspace-Id'?: (string | null) | undefined}; export type DeleteApiApiAccountsAccountIdOptions = {baseUrl: string, OAuth2PasswordBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Account * * DELETE /api/accounts/{account_id} */ export const deleteApiApiAccountsAccountId = async (args: DeleteApiApiAccountsAccountIdArgs, options: DeleteApiApiAccountsAccountIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2PasswordBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Workspace-Id'] != null) headers.set("X-Workspace-Id", String(args['X-Workspace-Id'])) if (OAuth2PasswordBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2PasswordBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/accounts/${encodeURIComponent(String(args.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 };