in bulkimport/src/main/java/com/microsoft/azure/documentdb/bulkimport/Main.java [54:64]
private static int getOfferThroughput(DocumentClient client, DocumentCollection collection) {
FeedResponse<Offer> offers = client.queryOffers(String.format("SELECT * FROM c where c.offerResourceId = '%s'", collection.getResourceId()), null);
List<Offer> offerAsList = offers.getQueryIterable().toList();
if (offerAsList.isEmpty()) {
throw new IllegalStateException("Cannot find Collection's corresponding offer");
}
Offer offer = offerAsList.get(0);
return offer.getContent().getInt("offerThroughput");
}