Cancel a batch of up to three orders (maximum allowed by the exchange).

@param limitOrders orders to cancel
@return (id, result) mappings
198203
public Map<LimitOrder, Boolean> cancelUpToThreeOrders(List<LimitOrder> limitOrders)
      throws IOException {
    Set<Long> ordersToCancel =
        limitOrders.stream().map(Order::getId).map(Long::parseLong).collect(Collectors.toSet());
    if (ordersToCancel.isEmpty() || ordersToCancel.size() > 3) {
      throw new UnsupportedOperationException(
          "Can only batch cancel 1 to 3 orders. " + ordersToCancel.size() + " orders provided.");
    }
    CurrencyPair currencyPair = limitOrders.get(0).getCurrencyPair();
    boolean valid =
        limitOrders.stream().allMatch(order -> order.getCurrencyPair().equals(currencyPair));
    if (!valid) {
      throw new UnsupportedOperationException(
          "Can only batch cancel orders with the same currency pair.");
    }

    OkCoinBatchTradeResult okCoinBatchTradeResult =
        cancelUpToThreeOrders(ordersToCancel, OkCoinAdapters.adaptSymbol(currencyPair));

    Map<String, Boolean> requestResults = new HashMap<>(ordersToCancel.size());
    if (okCoinBatchTradeResult.getSuccess() != null) {
      Arrays.stream(okCoinBatchTradeResult.getSuccess().split(BATCH_DELIMITER))
          .forEach(id -> requestResults.put(id, Boolean.TRUE));
    }
    if (okCoinBatchTradeResult.getError() != null) {
      Arrays.stream(okCoinBatchTradeResult.getError().split(BATCH_DELIMITER))
          .forEach(id -> requestResults.put(id, Boolean.FALSE));
    }
    Map<LimitOrder, Boolean> results = new HashMap<>(limitOrders.size());
    requestResults.forEach(
        (id, result) ->
            limitOrders.stream()
                .filter(order -> order.getId().equals(id))
                .findAny()
                .ifPresent(limitOrder -> results.put(limitOrder, requestResults.get(id))));
    return results;
  }
1192329
public void setLimits(java.util.Collection<Limit> limits) {
        if (limits == null) {
            this.limits = null;
            return;
        }

        this.limits = new com.amazonaws.internal.SdkInternalList<Limit>(limits);
    }
742622
private HistoryLimit limitOrNull(int pMaxEntries, long pMaxDuration) {
        return pMaxEntries != 0 || pMaxDuration != 0 ? new HistoryLimit(pMaxEntries, pMaxDuration) : null;
    }
730774
@Override
  public String placeMarketOrder(MarketOrder marketOrder) throws IOException {
    WexExchangeInfo wexExchangeInfo = ((WexExchange) exchange).getWexExchangeInfo();
    LimitOrder order = WexAdapters.createLimitOrder(marketOrder, wexExchangeInfo);
    return placeLimitOrder(order);
  }
1008650
private static UserTrade adaptTrade(LimitOrder order) {
    BigDecimal feeAmount =
        order
            .getCumulativeAmount()
            .multiply(order.getLimitPrice())
            .multiply(fee)
            .setScale(8, RoundingMode.DOWN);
    return new UserTrade(
        order.getType(),
        order.getCumulativeAmount(),
        order.getCurrencyPair(),
        order.getLimitPrice(),
        order.getTimestamp(),
        null, // Trade id
        order.getId(), // Original order id
        feeAmount,
        order.getCurrencyPair().counter);
  }
387426
public String placeLimitOrderUnrestricted(LimitOrder limitOrder) {
    MatchingEngine engine = exchange.getEngine(limitOrder.getCurrencyPair());
    return engine.postOrder(getApiKey(), limitOrder).getId();
  }
852452
public Query orderedBy( List<Ordering> orderings ) {
        return new Query(source, constraint, orderings, columns, getLimits(), distinct);
    }
453266
public OkCoinBatchTradeResult cancelUpToThreeOrders(Set<Long> orderIds, String symbol)
      throws IOException {
    String ids =
        orderIds.stream().map(Object::toString).collect(Collectors.joining(BATCH_DELIMITER));
    return okCoin.cancelOrders(apikey, ids, symbol, signatureCreator());
  }
751610
def fetch_open_orders(self, limit: int) -> List[Order]:
        """"""
        return self._fetch_orders_limit(self._open_orders, limit)
399929
public OkCoinOrderResult getOrder(String symbol, Integer type, String... orderIds)
      throws IOException {
    if (orderIds == null || orderIds.length > 50) {
      throw new UnsupportedOperationException(
          "Can only get 1 to 50 orders. " + orderIds.length + " orders provided.");
    }
    String ids = Arrays.stream(orderIds).collect(Collectors.joining(","));

    return super.getOrder(symbol, type, ids);
  }
1201868
def _pop_entities(self, limit=50):
        
        pop = self.data['entities'][:limit]
        del self.data['entities'][:limit]
        return pop
1280577
public function Get($OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $Offset = FALSE) {
      if (is_numeric($OrderFields)) {
         // They're using the old version that was a misnamed GetID()
         Deprecated('UserModel->Get()', 'UserModel->GetID()');
         $Result = $this->GetID($OrderFields);
      }
      else {
         $Result = parent::Get($OrderFields, $OrderDirection, $Limit, $Offset);
      }
      return $Result;  
   }
1340429
public TResult queryForChunk(String orderBy, int limit, long offset) {
		return query(null, null, null, null, orderBy, buildLimit(limit, offset));
	}
715364
@Override
	public void cacheResult(List<CommerceOrder> commerceOrders) {
		for (CommerceOrder commerceOrder : commerceOrders) {
			if (entityCache.getResult(
						CommerceOrderModelImpl.ENTITY_CACHE_ENABLED,
						CommerceOrderImpl.class, commerceOrder.getPrimaryKey()) == null) {
				cacheResult(commerceOrder);
			}
			else {
				commerceOrder.resetOriginalValues();
			}
		}
	}
354023
public boolean cancelAllOrders(String type, CurrencyPair currencyPair) throws IOException {

    GateioBaseResponse cancelAllOrdersResult =
        bter.cancelAllOrders(type, formatCurrencyPair(currencyPair), apiKey, signatureCreator);

    return handleResponse(cancelAllOrdersResult).isResult();
  }
219597
public OqlBuilder<T> orderBy(final List<Order> orders) {
    if (null != orders) {
      if (isNotEmpty(statement)) { throw new RuntimeException("cannot add order by to a exists statement."); }
      this.orders.addAll(orders);
    }
    return this;
  }
1336979
public static function cancel($order_id, $params = null, $opts = null)
    {
        $url = static::instanceUrlWithId($order_id);
        if (empty($params)) {
            $params = ['status' => 'canceled'];
        } else {
            $params = array_merge($params, ['status' => 'canceled']);
        }
        return static::_directRequest('put', $url, $params, $opts);
    }