export type UpdateApiAnnouncementsIdDismissArgs = {id: number}; export type UpdateApiAnnouncementsIdDismissOptions = {baseUrl?: string | undefined, userJwtRequired?: string | undefined, fetch?: typeof fetch | undefined}; /** * Dismiss an announcement * * PUT /announcements/{id}/dismiss */ export const updateApiAnnouncementsIdDismiss = async (args: UpdateApiAnnouncementsIdDismissArgs, options?: UpdateApiAnnouncementsIdDismissOptions) => { const {baseUrl = "https://api.inaturalist.org/v2", fetch: fetchFn = fetch, userJwtRequired} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (userJwtRequired !== undefined) headers.set("Authorization", userJwtRequired) const url = `${baseUrl.replace(/\/+$/, '')}/announcements/${encodeURIComponent(String(args.id))}/dismiss${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };