export type GetApiApiLogisticsPvtInventoryReservationsWarehouseIdSkuIdArgs = {'Content-Type': string, Accept: string, warehouseId: string, skuId: string}; export type GetApiApiLogisticsPvtInventoryReservationsWarehouseIdSkuIdOptions = {baseUrl?: string | undefined, appKey?: string | undefined, appToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * List reservation by warehouse and SKU * * GET /api/logistics/pvt/inventory/reservations/{warehouseId}/{skuId} * * Also accepts auth: VtexIdclientAutCookie */ export const getApiApiLogisticsPvtInventoryReservationsWarehouseIdSkuId = async (args: GetApiApiLogisticsPvtInventoryReservationsWarehouseIdSkuIdArgs, options?: GetApiApiLogisticsPvtInventoryReservationsWarehouseIdSkuIdOptions) => { const {baseUrl = "https://apiexamples.vtexcommercestable.com.br", fetch: fetchFn = fetch, appKey, appToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (appKey !== undefined) headers.set("X-VTEX-API-AppKey", appKey) if (appToken !== undefined) headers.set("X-VTEX-API-AppToken", appToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/logistics/pvt/inventory/reservations/${encodeURIComponent(String(args.warehouseId))}/${encodeURIComponent(String(args.skuId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };