export type CreateApiV1AccountAccountSlugProjectProjectSlugSimulationsSimulationIdShareArgs = {accountSlug: string, projectSlug: string, simulationId: string}; export type CreateApiV1AccountAccountSlugProjectProjectSlugSimulationsSimulationIdShareOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enable simulation sharing * * POST /v1/account/{accountSlug}/project/{projectSlug}/simulations/{simulationId}/share * * Also accepts auth: BearerAuth */ export const createApiV1AccountAccountSlugProjectProjectSlugSimulationsSimulationIdShare = async (args: CreateApiV1AccountAccountSlugProjectProjectSlugSimulationsSimulationIdShareArgs, options?: CreateApiV1AccountAccountSlugProjectProjectSlugSimulationsSimulationIdShareOptions) => { const {baseUrl = "https://api.tenderly.co/api", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("X-Access-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/account/${encodeURIComponent(String(args.accountSlug))}/project/${encodeURIComponent(String(args.projectSlug))}/simulations/${encodeURIComponent(String(args.simulationId))}/share${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };