export type CreateApiV3MessagesLogIdIdHideArgs = {id: string, logId: string}; export type CreateApiV3MessagesLogIdIdHideOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Hide a message by its ID. * * POST /v3/messages/{logId}/{id}/_hide */ export const createApiV3MessagesLogIdIdHide = async (args: CreateApiV3MessagesLogIdIdHideArgs, options: CreateApiV3MessagesLogIdIdHideOptions) => { 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/messages/${encodeURIComponent(String(args.logId))}/${encodeURIComponent(String(args.id))}/_hide${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 };