}
public static void runExample(
AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId) throws Exception {
// Get the AdGroupAdService.
AdGroupAdServiceInterface adGroupAdService =
adWordsServices.get(session, AdGroupAdServiceInterface.class);
// Create selector.
Selector selector = new Selector();
selector.setFields(new String[] {"Id", "DisapprovalReasons"});
selector.setOrdering(new OrderBy[] {new OrderBy("Id", SortOrder.ASCENDING)});
// Create predicates.
Predicate adGroupIdPredicate =
new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
Predicate approvalStatusPredicate = new Predicate(
"AdGroupCreativeApprovalStatus", PredicateOperator.IN, new String[] {"DISAPPROVED"});
selector.setPredicates(new Predicate[] {adGroupIdPredicate, approvalStatusPredicate});
// Get all disapproved ads.
AdGroupAdPage page = adGroupAdService.get(selector);
// Display ads.
if (page.getEntries() != null && page.getEntries().length > 0) {
for (AdGroupAd adGroupAd : page.getEntries()) {
System.out.println("Ad with id \"" + adGroupAd.getAd().getId() + "\"" + " and type \""