export type PatchApiApiV1WarehousesWarehouseIdStorageLocationsStorageLocationIdArgs = {warehouseId: string, storageLocationId: string, body: {designation?: string | undefined, address?: ({id?: string | undefined} | null) | undefined, isReplenishmentLocation?: boolean | undefined, isConsumptionLocation?: boolean | undefined, isRestrictedLocation?: boolean | undefined, allowsProductionAccess?: boolean | undefined, isPosLocation?: boolean | undefined, dimensions?: ({length?: number | undefined, width?: number | undefined, height?: number | undefined} | null) | undefined, locationType?: ('pallet' | 'shelf' | null) | undefined, abcCategory?: ('A' | 'B' | 'C' | null) | undefined, sort?: number | undefined}}; export type PatchApiApiV1WarehousesWarehouseIdStorageLocationsStorageLocationIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update storage location * * PATCH /api/v1/warehouses/{warehouseId}/storageLocations/{storageLocationId} */ export const patchApiApiV1WarehousesWarehouseIdStorageLocationsStorageLocationId = async (args: PatchApiApiV1WarehousesWarehouseIdStorageLocationsStorageLocationIdArgs, options?: PatchApiApiV1WarehousesWarehouseIdStorageLocationsStorageLocationIdOptions) => { 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/v1/warehouses/${encodeURIComponent(String(args.warehouseId))}/storageLocations/${encodeURIComponent(String(args.storageLocationId))}${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 };