export type DeleteApiSpecialEventsEventIdArgs = {eventId: string}; export type DeleteApiSpecialEventsEventIdOptions = {baseUrl?: string | undefined, MuseumPlaceholderAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete special event * * DELETE /special-events/{eventId} */ export const deleteApiSpecialEventsEventId = async (args: DeleteApiSpecialEventsEventIdArgs, options?: DeleteApiSpecialEventsEventIdOptions) => { const {baseUrl = "https://api.fake-museum-example.com/v1", fetch: fetchFn = fetch, MuseumPlaceholderAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (MuseumPlaceholderAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${MuseumPlaceholderAuth.username}:${MuseumPlaceholderAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/special-events/${encodeURIComponent(String(args.eventId))}${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 };