export type CustomerAddressUpdateDto = {name?: (string | null) | undefined, address1: string, address2?: (string | null) | undefined, address3?: (string | null) | undefined, city: string, stateProvince?: (string | null) | undefined, postalCode: string, country?: (string | null) | undefined, shippingLeadTime?: (number | null) | undefined, primaryBilling?: boolean | undefined, primaryShipping?: boolean | undefined, email?: (string | null) | undefined, phone?: (string | null) | undefined, fax?: (string | null) | undefined, notes?: (string | null) | undefined}; export type UpdateApiApiCustomersCustomerIdAddressesCustomerAddressIdArgs = {customerId: string, customerAddressId: string, body: CustomerAddressUpdateDto}; export type UpdateApiApiCustomersCustomerIdAddressesCustomerAddressIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a specific customer address * * PUT /api/customers/{customerId}/addresses/{customerAddressId} */ export const updateApiApiCustomersCustomerIdAddressesCustomerAddressId = async (args: UpdateApiApiCustomersCustomerIdAddressesCustomerAddressIdArgs, options?: UpdateApiApiCustomersCustomerIdAddressesCustomerAddressIdOptions) => { const {baseUrl = "https://api.fulcrumpro.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/customers/${encodeURIComponent(String(args.customerId))}/addresses/${encodeURIComponent(String(args.customerAddressId))}${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 };