export type AddressUpdateModel = {addressLine1?: (string | null) | undefined, addressLine2?: (string | null) | undefined, city?: (string | null) | undefined, state?: (string | null) | undefined, country?: (string | null) | undefined, postalCode?: (string | null) | undefined}; export type ContactUpdateModel = {preferredPhoneType?: (string | null) | undefined, homePhone?: (string | null) | undefined, mobilePhone?: (string | null) | undefined, businessPhone?: (string | null) | undefined, businessPhoneExt?: (string | null) | undefined, skypeUsername?: (string | null) | undefined, conferenceInfo?: (string | null) | undefined}; export type CustomFieldUpdateModel = {field1?: (string | null) | undefined, field2?: (string | null) | undefined, field3?: (string | null) | undefined, field4?: (string | null) | undefined, field5?: (string | null) | undefined, field6?: (string | null) | undefined, field7?: (string | null) | undefined, field8?: (string | null) | undefined, field9?: (string | null) | undefined, field10?: (string | null) | undefined}; export type CustomerUpdateModel = {locationId?: (string | null) | undefined, type?: (number | null) | undefined, email?: (string | null) | undefined, name?: (string | null) | undefined, lastname?: (string | null) | undefined, firstname?: (string | null) | undefined, stripeCustomerId?: (string | null) | undefined, notificationType?: (string | null) | undefined, address?: AddressUpdateModel | undefined, contact?: ContactUpdateModel | undefined, customFields?: CustomFieldUpdateModel | undefined}; export type UpdateApiConsumerV1CustomersIdArgs = {id: string, body: CustomerUpdateModel}; export type UpdateApiConsumerV1CustomersIdOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Customer * * PUT /consumer/v1/customers/{id} */ export const updateApiConsumerV1CustomersId = async (args: UpdateApiConsumerV1CustomersIdArgs, options?: UpdateApiConsumerV1CustomersIdOptions) => { const {baseUrl = "https://sandbox-api.onsched.com", 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(/\/+$/, '')}/consumer/v1/customers/${encodeURIComponent(String(args.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 undefined };