export type GetApiV1DisclaimersProductProductArgs = {product: 'PropertyData' | 'AURIN' | 'HomePriceGuide'}; export type GetApiV1DisclaimersProductProductOptions = {baseUrl?: string | undefined, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disclaimers by Product * * GET /v1/disclaimers/product/{product} * * Also accepts auth: oauth2 */ export const getApiV1DisclaimersProductProduct = async (args: GetApiV1DisclaimersProductProductArgs, options?: GetApiV1DisclaimersProductProductOptions) => { const {baseUrl = "https://api.domain.com.au", fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apikey !== undefined) headers.set("x-api-key", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/disclaimers/product/${encodeURIComponent(String(args.product))}${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 };