export type UpdateQuoteSentModel = {sentAt?: (string | null) | undefined}; export type UpdateApiV1FinanceQuotesQuoteIdSentArgs = {'Customer-Id': number, quoteId: number, body: UpdateQuoteSentModel}; export type UpdateApiV1FinanceQuotesQuoteIdSentOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Mark a quote as sent * * PUT /v1/finance/quotes/{quoteId}/sent */ export const updateApiV1FinanceQuotesQuoteIdSent = async (args: UpdateApiV1FinanceQuotesQuoteIdSentArgs, options?: UpdateApiV1FinanceQuotesQuoteIdSentOptions) => { 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))}/sent${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };