export type DeleteApiInventoryVariantIdProductArgs = {variant_id: string}; export type DeleteApiInventoryVariantIdProductOptions = {baseUrl: string, OAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete product knowledge * * DELETE /inventory/{variant_id}/product */ export const deleteApiInventoryVariantIdProduct = async (args: DeleteApiInventoryVariantIdProductArgs, options: DeleteApiInventoryVariantIdProductOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth !== undefined) headers.set('authorization', `Bearer ${OAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/inventory/${encodeURIComponent(String(args.variant_id))}/product${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 };