public static void runExample(
AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId,
Long criterionId) throws Exception {
// Get the DataService.
DataServiceInterface dataService =
adWordsServices.get(session, DataServiceInterface.class);
// Create selector.
Selector selector = new Selector();
selector.setFields(new String[] {"AdGroupId", "CriterionId", "StartDate", "EndDate", "Bid",
"LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"});
// Create predicates.
Predicate adGroupIdPredicate =
new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
Predicate criterionIdPredicate =
new Predicate("CriterionId", PredicateOperator.IN, new String[] {criterionId.toString()});
selector.setPredicates(new Predicate[] {adGroupIdPredicate, criterionIdPredicate});
// Get bid landscape for ad group criteria.
CriterionBidLandscapePage page = dataService.getCriterionBidLandscape(selector);
// Display bid landscapes.
if (page.getEntries() != null) {
for (CriterionBidLandscape criterionBidLandscape : page.getEntries()) {
System.out.println("Criterion bid landscape with ad group id \""