export type GetApiOgcCollectionsCollectionIdInstancesArgs = {collectionId: string, f?: string | undefined}; export type GetApiOgcCollectionsCollectionIdInstancesOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * List data instances of {collectionId} * * GET /ogc/collections/{collectionId}/instances */ export const getApiOgcCollectionsCollectionIdInstances = async (args: GetApiOgcCollectionsCollectionIdInstancesArgs, options: GetApiOgcCollectionsCollectionIdInstancesOptions) => { 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))}/instances${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 };