export type CreateApiV3LogsIdEnableArgs = {id: string}; export type CreateApiV3LogsIdEnableOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enable a log by its ID. * * POST /v3/logs/{id}/_enable */ export const createApiV3LogsIdEnable = async (args: CreateApiV3LogsIdEnableArgs, options: CreateApiV3LogsIdEnableOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) query.set("api_key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v3/logs/${encodeURIComponent(String(args.id))}/_enable${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 };