export type UpdateApiApiOrgIdSyntheticsIdEnableArgs = {org_id: string, id: string, body: Record}; export type UpdateApiApiOrgIdSyntheticsIdEnableOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enable or pause a synthetic * * PUT /api/{org_id}/synthetics/{id}/enable */ export const updateApiApiOrgIdSyntheticsIdEnable = async (args: UpdateApiApiOrgIdSyntheticsIdEnableArgs, options: UpdateApiApiOrgIdSyntheticsIdEnableOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.org_id))}/synthetics/${encodeURIComponent(String(args.id))}/enable${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };