export type AddressSegmentDTO = {acceptorAcceptorName?: string | undefined, acceptorId?: number | undefined, id?: number | undefined, index: number, prefix?: ('THE_BEGINNING' | 'END_OF' | 'AFTER' | 'BEFORE' | 'NEXT' | 'IN_FRONT_OF_THE' | 'EAST' | 'WEST' | 'NORTH' | 'SOUTH' | 'NORTHEAST' | 'NORTHWEST' | 'SOUTHEAST' | 'SOUTHWEST') | undefined, preflex?: ('HIGHWAY' | 'HIGHWAY2' | 'THE_NEIGHBOURHOOD' | 'ROAD' | 'THE_WAY_OUT' | 'RING_ROAD' | 'KILOMETER' | 'THE_PART' | 'VILLAGE' | 'PHASE' | 'MARKET' | 'SMALL_MARKET' | 'BOULEVARD' | 'INTERSECTION' | 'AVENUE' | 'THREE_WAYS' | 'TOWN' | 'SQUARE' | 'BRIDGE' | 'FOUR_WAYS' | 'ALLEY' | 'BLOCK' | 'TIMCHE' | 'STRAIGHT' | 'SARAY' | 'CROSSING' | 'DEADEND' | 'STREET' | 'TOWER' | 'CORRIDOR' | 'BUILDING' | 'COMPLEX' | 'ENTRANCE' | 'MALL' | 'ROW' | 'FLOOR' | 'PIEACE' | 'PLAQUE' | 'BOOTH' | 'THE_UNIT') | undefined, segment?: string | undefined}; export type UpdateApiApiAddressSegmentsArgs = {body: AddressSegmentDTO}; export type UpdateApiApiAddressSegmentsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * updateAddressSegment * * PUT /api/address-segments */ export const updateApiApiAddressSegments = async (args: UpdateApiApiAddressSegmentsArgs, options: UpdateApiApiAddressSegmentsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/address-segments${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 res.blob() };