export type DeleteApiInvoicesIdLineItemsByGroupCodeGroupCodeIdArgs = {id: string, groupCodeId: string, kitInstanceId?: string | undefined}; export type DeleteApiInvoicesIdLineItemsByGroupCodeGroupCodeIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove the line items on the invoice that were emitted from the given group code. Pass * `kitInstanceId` to remove just one add of the kit when it was added more than once. * * DELETE /Invoices/{id}/line-items/by-group-code/{groupCodeId} */ export const deleteApiInvoicesIdLineItemsByGroupCodeGroupCodeId = async (args: DeleteApiInvoicesIdLineItemsByGroupCodeGroupCodeIdArgs, options?: DeleteApiInvoicesIdLineItemsByGroupCodeGroupCodeIdOptions) => { const {baseUrl = "https://api.clinicos.vet/backend/business", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.kitInstanceId != null) query.append("kitInstanceId", String(args.kitInstanceId)) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/Invoices/${encodeURIComponent(String(args.id))}/line-items/by-group-code/${encodeURIComponent(String(args.groupCodeId))}${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 };