export type Contact2EditModel = {FirstName?: string | undefined, LastName?: string | undefined, EmailAddress?: string | undefined, Description?: string | undefined, CultureName?: string | undefined, CountryCodeIso1366?: string | undefined, DefaultVehicleId?: number | undefined, UnitType?: (0 | 1 | 2) | undefined, SubscribeToNewsLetter?: boolean | undefined, MobilePhoneNumber?: string | undefined, MapType?: (0 | 1 | 2) | undefined, CheckOutDateTimeUtc?: string | undefined, CheckedInTripType?: (0 | 1 | 2 | 3) | undefined, CheckedInCustomTripTypeName?: string | undefined, CurrencyCode?: string | undefined}; export type UpdateApiV1ResourceownerContacts2ContactIdArgs = {contactId: number, body: Contact2EditModel}; export type UpdateApiV1ResourceownerContacts2ContactIdOptions = {baseUrl: string, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates the given contact id * * PUT /v1/resourceowner/contacts2/{contactId} */ export const updateApiV1ResourceownerContacts2ContactId = async (args: UpdateApiV1ResourceownerContacts2ContactIdArgs, options: UpdateApiV1ResourceownerContacts2ContactIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/resourceowner/contacts2/${encodeURIComponent(String(args.contactId))}${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 };