export type GetApiAccountHotlistIdKeyArgs = {id: number, key: string, generateAIOverview?: boolean | undefined, isViewPage?: boolean | undefined}; export type GetApiAccountHotlistIdKeyOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieves a hotlist * * GET /account/hotlist/{id}/{key} */ export const getApiAccountHotlistIdKey = async (args: GetApiAccountHotlistIdKeyArgs, options?: GetApiAccountHotlistIdKeyOptions) => { const {baseUrl = "https://api.travelify.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.generateAIOverview != null) query.append("generateAIOverview", String(args.generateAIOverview)) if (args.isViewPage != null) query.append("isViewPage", String(args.isViewPage)) const url = `${baseUrl.replace(/\/+$/, '')}/account/hotlist/${encodeURIComponent(String(args.id))}/${encodeURIComponent(String(args.key))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };