export type UpdateApiV2InventoryWarehousesInventoryWarehouseIdArgs = {inventory_warehouse_id: string, body: {name?: string | undefined}}; export type UpdateApiV2InventoryWarehousesInventoryWarehouseIdOptions = {baseUrl?: string | undefined, apiKeys?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an inventory warehouse name * * PUT /v2/inventory_warehouses/{inventory_warehouse_id} */ export const updateApiV2InventoryWarehousesInventoryWarehouseId = async (args: UpdateApiV2InventoryWarehousesInventoryWarehouseIdArgs, options?: UpdateApiV2InventoryWarehousesInventoryWarehouseIdOptions) => { const {baseUrl = "https://api.shipstation.com", fetch: fetchFn = fetch, apiKeys} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKeys !== undefined) headers.set("api-key", apiKeys) const url = `${baseUrl.replace(/\/+$/, '')}/v2/inventory_warehouses/${encodeURIComponent(String(args.inventory_warehouse_id))}${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 undefined };