export type PropertyActivityAPIV1PortfolioDetails = {PropertyIds: Array, GnafIds?: Array | undefined} | {PropertyIds?: Array | undefined, GnafIds: Array}; export type CreateApiV1PropertyradarPortfolioPortfolioIdArgs = {PortfolioId: string, body: PropertyActivityAPIV1PortfolioDetails}; export type CreateApiV1PropertyradarPortfolioPortfolioIdOptions = {baseUrl?: string | undefined, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add Properties to Portfolio * * POST /v1/propertyradar/portfolio/{PortfolioId} * * Also accepts auth: oauth2 */ export const createApiV1PropertyradarPortfolioPortfolioId = async (args: CreateApiV1PropertyradarPortfolioPortfolioIdArgs, options?: CreateApiV1PropertyradarPortfolioPortfolioIdOptions) => { const {baseUrl = "https://api.domain.com.au", fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apikey !== undefined) headers.set("x-api-key", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/propertyradar/portfolio/${encodeURIComponent(String(args.PortfolioId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };