export type DeleteApiIndexUuidTargetPortfolioTargetPortfolioUuidOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes an existing target portfolio * * DELETE /index/{uuid}/target_portfolio/{target_portfolio_uuid} */ export const deleteApiIndexUuidTargetPortfolioTargetPortfolioUuid = async (options?: DeleteApiIndexUuidTargetPortfolioTargetPortfolioUuidOptions) => { const {baseUrl = "https://api.merqube.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/index/${encodeURIComponent(String(args.uuid))}/target_portfolio/${encodeURIComponent(String(args.target_portfolio_uuid))}${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 };