export type GetApiOgcCollectionsCollectionIdArgs = {collectionId: string, f?: string | undefined}; export type GetApiOgcCollectionsCollectionIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * List query types supported by the collection * * GET /ogc/collections/{collectionId} */ export const getApiOgcCollectionsCollectionId = async (args: GetApiOgcCollectionsCollectionIdArgs, options: GetApiOgcCollectionsCollectionIdOptions) => { 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/collections/${encodeURIComponent(String(args.collectionId))}${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 };