export type DeleteApiPublicV1CollectionsCollectionIdArgs = {collectionId: number}; export type DeleteApiPublicV1CollectionsCollectionIdOptions = {baseUrl?: string | undefined, TokenAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deactivate a collection * * DELETE /public/v1/collections/{collectionId} */ export const deleteApiPublicV1CollectionsCollectionId = async (args: DeleteApiPublicV1CollectionsCollectionIdArgs, options?: DeleteApiPublicV1CollectionsCollectionIdOptions) => { const {baseUrl = "https://api.prewave.com", fetch: fetchFn = fetch, TokenAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (TokenAuthentication !== undefined) headers.set("X-Auth-Token", TokenAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/collections/${encodeURIComponent(String(args.collectionId))}${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 (await res.json()) as unknown };