export type GetApiCollectionsCollectionIdCollectedMetadataCgmIdArgs = {collection_id: string, cgm_id: string}; export type GetApiCollectionsCollectionIdCollectedMetadataCgmIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve Specific Metadata for a Collection * * GET /collections/{collection_id}/collected_metadata/{cgm_id} */ export const getApiCollectionsCollectionIdCollectedMetadataCgmId = async (args: GetApiCollectionsCollectionIdCollectedMetadataCgmIdArgs, options?: GetApiCollectionsCollectionIdCollectedMetadataCgmIdOptions) => { const {baseUrl = "https://api.test.osf.io/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "data") const url = `${baseUrl.replace(/\/+$/, '')}/collections/${encodeURIComponent(String(args.collection_id))}/collected_metadata/${encodeURIComponent(String(args.cgm_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 res.blob() };