export type UpdateApiContactsContactIdArgs = {contact_id: number, force?: boolean | undefined, body: {prefix?: string | undefined, firstname?: string | undefined, middle?: string | undefined, lastname?: string | undefined, suffix?: string | undefined, email?: string | undefined, role?: string | undefined, name?: string | undefined, owner?: number | undefined, picture?: string | undefined, account?: number | undefined, birth_date?: string | undefined, 'opt-out'?: boolean | undefined, 'opt-out_date'?: string | undefined, 'opt-out_campaign'?: string | undefined, bounced?: boolean | undefined, bounced_date?: string | undefined, files?: Array> | undefined, tags?: Array | undefined, address?: ({id?: number | undefined, city?: string | undefined, country?: string | undefined, region?: string | undefined, state_region?: string | undefined, street?: string | undefined, type?: string | undefined, zip?: string | undefined, archived?: boolean | undefined, _dirty?: boolean | undefined}) | undefined, addresses?: (Array<{id?: number | undefined, city?: string | undefined, country?: string | undefined, region?: string | undefined, state_region?: string | undefined, street?: string | undefined, type?: string | undefined, zip?: string | undefined, archived?: boolean | undefined, _dirty?: boolean | undefined}>) | undefined, phone_number?: string | undefined, mobile_phone_number?: string | undefined, home_phone_number?: string | undefined, fax_number?: string | undefined, phone_numbers?: (Array<{id?: number | undefined, number?: string | undefined, type?: string | undefined, archived?: boolean | undefined, _dirty?: boolean | undefined}>) | undefined, position?: ({id?: number | undefined, organisation?: string | undefined, role?: string | undefined, archived?: boolean | undefined, _dirty?: boolean | undefined}) | undefined, positions?: (Array<{id?: number | undefined, organisation?: string | undefined, role?: string | undefined, archived?: boolean | undefined, _dirty?: boolean | undefined}>) | undefined, social_profiles?: Array | undefined, custom?: Record | undefined, _dirty?: boolean | undefined, archived?: boolean | undefined}}; export type UpdateApiContactsContactIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a contact * * PUT /contacts/{contact_id} */ export const updateApiContactsContactId = async (args: UpdateApiContactsContactIdArgs, options?: UpdateApiContactsContactIdOptions) => { const {baseUrl = "https://api.salesflare.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (args.force != null) query.append("force", String(args.force)) const url = `${baseUrl.replace(/\/+$/, '')}/contacts/${encodeURIComponent(String(args.contact_id))}${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 res.blob() };