export type PatchApiApiV1CustomersCustomerIdContactPersonContactPersonIdArgs = {customerId: string, contactPersonId: number, body: {type?: ('company' | 'mr' | 'mrs' | 'other') | undefined, name?: string | undefined, title?: (string | null) | undefined, birthday?: (string | null) | undefined, birthdayShowInCalendar?: boolean | undefined, sendBirthdayCard?: boolean | undefined, marketingBan?: boolean | undefined, department?: (string | null) | undefined, subDepartment?: (string | null) | undefined, position?: (string | null) | undefined, language?: (string | null) | undefined, address?: ({street?: (string | null) | undefined, additionalStreet?: (string | null) | undefined, zip?: (string | null) | undefined, city?: (string | null) | undefined, state?: (string | null) | undefined, country?: (string | null) | undefined}) | undefined, contact?: ({phone?: (string | null) | undefined, fax?: (string | null) | undefined, mobile?: (string | null) | undefined, salutation?: (string | null) | undefined, email?: (string | null) | undefined}) | undefined, groups?: Array | undefined, comment?: (string | null) | undefined, others?: (string | null) | undefined}}; export type PatchApiApiV1CustomersCustomerIdContactPersonContactPersonIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update contact person * * PATCH /api/v1/customers/{customerId}/contactPerson/{contactPersonId} */ export const patchApiApiV1CustomersCustomerIdContactPersonContactPersonId = async (args: PatchApiApiV1CustomersCustomerIdContactPersonContactPersonIdArgs, options?: PatchApiApiV1CustomersCustomerIdContactPersonContactPersonIdOptions) => { const {baseUrl = "https://xentral.xentral.biz", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/customers/${encodeURIComponent(String(args.customerId))}/contactPerson/${encodeURIComponent(String(args.contactPersonId))}${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 };