export type PatchApiApiV2CustomersCustomerIdAddressesIdArgs = {customerId: string, id: 'masterdata' | 'billingaddress' | string, body: {street?: string | undefined, addressSupplement?: (string | null) | undefined, zip?: string | undefined, city?: string | undefined, country?: string | undefined, state?: (string | null) | undefined, department?: (string | null) | undefined, subDepartment?: (string | null) | undefined} | {name?: string | undefined, salutation?: ('mr' | 'mrs' | 'company' | 'other' | null) | undefined, street?: string | undefined, addressSupplement?: (string | null) | undefined, zip?: string | undefined, city?: string | undefined, country?: string | undefined, state?: (string | null) | undefined, department?: (string | null) | undefined, subDepartment?: (string | null) | undefined, contactDetails?: ({phone?: (string | null) | undefined, email?: (string | null) | undefined, gln?: (unknown | null) | undefined}) | undefined} | {name?: (string | null) | undefined, salutation?: ('mr' | 'mrs' | 'company' | 'other' | null) | undefined, street?: string | undefined, addressSupplement?: (string | null) | undefined, zip?: string | undefined, city?: string | undefined, country?: string | undefined, state?: (string | null) | undefined, department?: (string | null) | undefined, subDepartment?: (string | null) | undefined, contactDetails?: ({phone?: (string | null) | undefined, email?: (string | null) | undefined, gln?: (unknown | null) | undefined} | null) | undefined, deliveryDetails?: ({defaultDeliveryAddress?: boolean | undefined, termsOfDelivery?: (string | null) | undefined, vatId?: (string | null) | undefined, taxType?: ('domestic' | 'eu-delivery' | 'export' | 'free') | undefined, internalComment?: (string | null) | undefined, note?: (string | null) | undefined} | null) | undefined}}; export type PatchApiApiV2CustomersCustomerIdAddressesIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update address * * PATCH /api/v2/customers/{customerId}/addresses/{id} */ export const patchApiApiV2CustomersCustomerIdAddressesId = async (args: PatchApiApiV2CustomersCustomerIdAddressesIdArgs, options?: PatchApiApiV2CustomersCustomerIdAddressesIdOptions) => { const {baseUrl = "https://xentral.xentral.biz", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/customers/${encodeURIComponent(String(args.customerId))}/addresses/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };