export type UpdateQuoteLineItemModel = {quantity?: number | undefined, description?: string | undefined, taxId?: (number | null) | undefined, unitCost?: (number | null) | undefined, unitSellingPrice?: number | undefined, nominalCodeId?: (number | null) | undefined, departmentCodeId?: (number | null) | undefined}; export type PatchApiV1FinanceQuotesQuoteIdLineItemsLineItemIdArgs = {'Customer-Id': number, quoteId: number, lineItemId: number, body: UpdateQuoteLineItemModel}; export type PatchApiV1FinanceQuotesQuoteIdLineItemsLineItemIdOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a quote line item * * PATCH /v1/finance/quotes/{quoteId}/lineItems/{lineItemId} */ export const patchApiV1FinanceQuotesQuoteIdLineItemsLineItemId = async (args: PatchApiV1FinanceQuotesQuoteIdLineItemsLineItemIdArgs, options?: PatchApiV1FinanceQuotesQuoteIdLineItemsLineItemIdOptions) => { const {baseUrl = "https://api.bigchange.com", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['Customer-Id'] != null) headers.set("Customer-Id", String(args['Customer-Id'])) if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/finance/quotes/${encodeURIComponent(String(args.quoteId))}/lineItems/${encodeURIComponent(String(args.lineItemId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };