export type GetApiV1ParentArgs = {parent: string, answersPerQuestion?: number | undefined, filter?: string | undefined, orderBy?: string | undefined, pageSize?: number | undefined, pageToken?: string | undefined}; export type GetApiV1ParentOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns the paginated list of questions and some of its answers for a specified location. This operation is only valid if the specified location is verified. * * GET /v1/{+parent} */ export const getApiV1Parent = async (args: GetApiV1ParentArgs, options?: GetApiV1ParentOptions) => { const {baseUrl = "https://mybusinessqanda.googleapis.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.answersPerQuestion != null) query.append("answersPerQuestion", String(args.answersPerQuestion)) if (args.filter != null) query.append("filter", String(args.filter)) if (args.orderBy != null) query.append("orderBy", String(args.orderBy)) if (args.pageSize != null) query.append("pageSize", String(args.pageSize)) if (args.pageToken != null) query.append("pageToken", String(args.pageToken)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/${encodeURIComponent(String(args['+parent']))}${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 res.blob() };