export type DeleteApiPublicV2SuppliersSitesArgs = {supplierId?: string | undefined, customerId?: string | undefined, ownId?: string | undefined, prewaveId?: number | undefined, source?: string | undefined}; export type DeleteApiPublicV2SuppliersSitesOptions = {baseUrl?: string | undefined, TokenAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deactivate a supplier by identifier * * DELETE /public/v2/suppliers/sites */ export const deleteApiPublicV2SuppliersSites = async (args: DeleteApiPublicV2SuppliersSitesArgs, options?: DeleteApiPublicV2SuppliersSitesOptions) => { const {baseUrl = "https://api.prewave.com", fetch: fetchFn = fetch, TokenAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.supplierId != null) query.append("supplierId", String(args.supplierId)) if (args.customerId != null) query.append("customerId", String(args.customerId)) if (args.ownId != null) query.append("ownId", String(args.ownId)) if (args.prewaveId != null) query.append("prewaveId", String(args.prewaveId)) if (args.source != null) query.append("source", String(args.source)) if (TokenAuthentication !== undefined) headers.set("X-Auth-Token", TokenAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/public/v2/suppliers/sites${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 };