export type DeleteApiCollectionsCollectionIdCollectedMetadataCgmIdArgs = {collection_id: string, cgm_id: string}; export type DeleteApiCollectionsCollectionIdCollectedMetadataCgmIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Collection Metadata from entitiy * * DELETE /collections/{collection_id}/collected_metadata/{cgm_id} */ export const deleteApiCollectionsCollectionIdCollectedMetadataCgmId = async (args: DeleteApiCollectionsCollectionIdCollectedMetadataCgmIdArgs, options?: DeleteApiCollectionsCollectionIdCollectedMetadataCgmIdOptions) => { const {baseUrl = "https://api.test.osf.io/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() 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: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };