export type DeleteApiPublicV1CollectionsCollectionIdTargetsTargetIdArgs = {collectionId: number, targetId: number}; export type DeleteApiPublicV1CollectionsCollectionIdTargetsTargetIdOptions = {baseUrl?: string | undefined, TokenAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove target from collection * * DELETE /public/v1/collections/{collectionId}/targets/{targetId} */ export const deleteApiPublicV1CollectionsCollectionIdTargetsTargetId = async (args: DeleteApiPublicV1CollectionsCollectionIdTargetsTargetIdArgs, options?: DeleteApiPublicV1CollectionsCollectionIdTargetsTargetIdOptions) => { const {baseUrl = "https://api.prewave.com", fetch: fetchFn = fetch, TokenAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (TokenAuthentication !== undefined) headers.set("X-Auth-Token", TokenAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/collections/${encodeURIComponent(String(args.collectionId))}/targets/${encodeURIComponent(String(args.targetId))}${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 };