export type DeleteApiV3MessagesLogIdIdArgs = {id: string, logId: string}; export type DeleteApiV3MessagesLogIdIdOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a message by its ID. * * DELETE /v3/messages/{logId}/{id} */ export const deleteApiV3MessagesLogIdId = async (args: DeleteApiV3MessagesLogIdIdArgs, options: DeleteApiV3MessagesLogIdIdOptions) => { 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))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };