export type CreateApiV3MessagesLogIdIdFixArgs = {id: string, logId: string, markAllAsFixed?: boolean | undefined}; export type CreateApiV3MessagesLogIdIdFixOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Fix a message by its ID. * * POST /v3/messages/{logId}/{id}/_fix */ export const createApiV3MessagesLogIdIdFix = async (args: CreateApiV3MessagesLogIdIdFixArgs, options: CreateApiV3MessagesLogIdIdFixOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.markAllAsFixed != null) query.append("markAllAsFixed", String(args.markAllAsFixed)) if (apiKey !== undefined) query.set("api_key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v3/messages/${encodeURIComponent(String(args.logId))}/${encodeURIComponent(String(args.id))}/_fix${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 };