export type CreateApiApiV1WarehousesWarehouseIdStorageLocationsArgs = {warehouseId: string, body: {designation?: string | undefined, address?: {id: string} | undefined, dimensions?: ({length?: number | undefined, width?: number | undefined, height?: number | undefined}) | undefined, isReplenishmentLocation?: boolean | undefined, isConsumptionLocation?: boolean | undefined, isRestrictedLocation?: boolean | undefined, isPosLocation?: boolean | undefined, allowsProductionAccess?: boolean | undefined, sort?: number | undefined, locationType?: ('pallet' | 'shelf') | undefined, abcCategory?: ('A' | 'B' | 'C' | null) | undefined}}; export type CreateApiApiV1WarehousesWarehouseIdStorageLocationsOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create storage location * * POST /api/v1/warehouses/{warehouseId}/storageLocations */ export const createApiApiV1WarehousesWarehouseIdStorageLocations = async (args: CreateApiApiV1WarehousesWarehouseIdStorageLocationsArgs, options?: CreateApiApiV1WarehousesWarehouseIdStorageLocationsOptions) => { 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") headers.set('accept', "text/html") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/warehouses/${encodeURIComponent(String(args.warehouseId))}/storageLocations${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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.text() };