export type DeleteApiSitesSiteIdProductsIdArgs = {siteId: number, id: string, force?: boolean | undefined}; export type DeleteApiSitesSiteIdProductsIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * DeleteByExternalId Product * * DELETE /Sites/{siteId}/Products/{id} */ export const deleteApiSitesSiteIdProductsId = async (args: DeleteApiSitesSiteIdProductsIdArgs, options?: DeleteApiSitesSiteIdProductsIdOptions) => { const {baseUrl = "https://api.qpilot.cloud", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.force != null) query.append("force", String(args.force)) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/Sites/${encodeURIComponent(String(args.siteId))}/Products/${encodeURIComponent(String(args.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 };