export type UpdateContactV3Dto = {firstName?: string | undefined, lastName?: string | undefined, email?: string | undefined, isPrimaryContact?: boolean | undefined, isCCEmail?: boolean | undefined}; export type PatchApiV3CustomersIdContactsContactIdArgs = {id: string, contactId: string, body: UpdateContactV3Dto}; export type PatchApiV3CustomersIdContactsContactIdOptions = {baseUrl?: string | undefined, customHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update customer contact * * PATCH /v3/customers/{id}/contacts/{contactId} */ export const patchApiV3CustomersIdContactsContactId = async (args: PatchApiV3CustomersIdContactsContactIdArgs, options?: PatchApiV3CustomersIdContactsContactIdOptions) => { const {baseUrl = "https://integrators.prod.api.tabsplatform.com", fetch: fetchFn = fetch, customHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (customHeader !== undefined) headers.set("Authorization", customHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v3/customers/${encodeURIComponent(String(args.id))}/contacts/${encodeURIComponent(String(args.contactId))}${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 };