export type Address = {address1?: string | undefined, address2?: string | undefined, address3?: string | undefined, address4?: string | undefined, address5?: string | undefined, address6?: string | undefined, address7?: string | undefined, zip?: string | undefined, city?: string | undefined, country_code?: string | undefined}; export type AdditionalAddress = {additional_address_id?: string | undefined, address_type: string, address: Address}; export type UpdateApiCustomersCustomerIdAddressesAdditionalCustomerAddressIdPathArgs = {'Accept-Language'?: string | undefined, customer_id: string, additional_customer_address_id_path: string, body: {additional_address: AdditionalAddress}}; export type UpdateApiCustomersCustomerIdAddressesAdditionalCustomerAddressIdPathOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an additional customer address * * PUT /customers/{customer_id}/addresses/{additional_customer_address_id_path} * * Also accepts auth: basicAuth */ export const updateApiCustomersCustomerIdAddressesAdditionalCustomerAddressIdPath = async (args: UpdateApiCustomersCustomerIdAddressesAdditionalCustomerAddressIdPathArgs, options?: UpdateApiCustomersCustomerIdAddressesAdditionalCustomerAddressIdPathOptions) => { const {baseUrl = "https://sandbox.crmcarecloud.com/webservice/rest-api/enterprise-interface/v1.0", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['Accept-Language'] != null) headers.set("Accept-Language", String(args['Accept-Language'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/customers/${encodeURIComponent(String(args.customer_id))}/addresses/${encodeURIComponent(String(args.additional_customer_address_id_path))}${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 };