export type GetApiOgcGroupsIdArgs = {id: string, f?: string | undefined}; export type GetApiOgcGroupsIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * List of links to information available in the group * * GET /ogc/groups/{id} */ export const getApiOgcGroupsId = async (args: GetApiOgcGroupsIdArgs, options: GetApiOgcGroupsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.f != null) query.append("f", String(args.f)) const url = `${baseUrl.replace(/\/+$/, '')}/ogc/groups/${encodeURIComponent(String(args.id))}${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 };