export type UpdateWishlistRequest = {ada?: boolean | undefined, end_date?: string | undefined, is_public?: boolean | undefined, number_of_adults?: number | undefined, number_of_children?: number | undefined, pets?: boolean | undefined, start_date?: string | undefined, title?: string | undefined}; export type PatchApiWishlistsWishlistIdArgs = {body: UpdateWishlistRequest}; export type PatchApiWishlistsWishlistIdOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates the details of an existing wishlist * * PATCH /wishlists/{wishlist_id} * * Also accepts auth: API-Key */ export const patchApiWishlistsWishlistId = async (args: PatchApiWishlistsWishlistIdArgs, options: PatchApiWishlistsWishlistIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/wishlists/${encodeURIComponent(String(args.wishlist_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };