Package com.google.api.ads.adwords.axis.utils.v201402

Examples of com.google.api.ads.adwords.axis.utils.v201402.SelectorBuilder


      throws Exception {
    // Get the LocationCriterionService.
    LocationCriterionServiceInterface locationCriterionService =
        adWordsServices.get(session, LocationCriterionServiceInterface.class);

    Selector selector = new SelectorBuilder()
        .fields(
            "Id",
            "LocationName",
            "CanonicalName",
            "DisplayType",
View Full Code Here


        adWordsServices.get(session, CampaignCriterionServiceInterface.class);

    int offset = 0;

    // Create selector.
    SelectorBuilder builder = new SelectorBuilder();
    Selector selector = builder
        .fields(
            "CampaignId",
            "Id",
            "CriteriaType",
            "PlatformName",
            "LanguageName",
            "LocationName",
            "KeywordText")
        .in("CriteriaType", "KEYWORD", "LANGUAGE", "LOCATION", "PLATFORM")
        .offset(0)
        .limit(PAGE_SIZE)
        .build();

    CampaignCriterionPage page = null;
    do {
      page = campaignCriterionService.get(selector);

      if (page.getEntries() != null) {
        // Display campaigns.
        for (CampaignCriterion campaignCriterion : page.getEntries()) {
          System.out.printf("Campaign criterion with campaign id '%s', criterion id '%s', "
              + "and type '%s' was found.\n", campaignCriterion.getCampaignId(), campaignCriterion
              .getCriterion().getId(), campaignCriterion.getCriterion().getCriterionType());
        }
        Thread.sleep(1000);
      } else {
        System.out.println("No campaign criteria were found.");
      }
      offset += PAGE_SIZE;
      selector = builder.increaseOffsetBy(PAGE_SIZE).build();
    } while (offset < page.getTotalNumEntries());
  }
View Full Code Here

    int offset = 0;
    boolean morePages = true;

    // Create selector.
    SelectorBuilder builder = new SelectorBuilder();
    Selector selector = builder
        .fields("Id", "AdGroupId", "MatchType", "KeywordText")
        .orderAscBy("AdGroupId")
        .offset(offset)
        .limit(PAGE_SIZE)
        .in("AdGroupId", adGroupId.toString())
        .equals("CriteriaType", "KEYWORD")
        .build();

    while (morePages) {
      // Get all ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.get(selector);

      // Display ad group criteria.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        // Display results.
        for (AdGroupCriterion adGroupCriterionResult : page.getEntries()) {
          System.out.println("Keyword ad group criterion with ad group id \""
              + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
              + adGroupCriterionResult.getCriterion().getId() + "\", text \""
              + ((Keyword) adGroupCriterionResult.getCriterion()).getText()
              + "\" and match type \""
              + ((Keyword) adGroupCriterionResult.getCriterion()).getMatchType() + "\" was found.");
        }
      } else {
        System.out.println("No ad group criteria were found.");
      }

      offset += PAGE_SIZE;
      selector = builder.increaseOffsetBy(PAGE_SIZE).build();
      morePages = offset < page.getTotalNumEntries();
    }
  }
View Full Code Here

  public static void runExample(AdWordsServices adWordsServices, AdWordsSession session,
      Long feedId, Map<Long, String[]> feedItemDescriptions) throws Exception {
    FeedServiceInterface feedService = adWordsServices.get(session, FeedServiceInterface.class);

    Selector selector = new SelectorBuilder()
        .fields("Id", "Attributes")
        .equalsId(feedId)
        .build();
    Feed feed = feedService.get(selector).getEntries()[0];
View Full Code Here

    FeedItemServiceInterface feedItemService =
        adWordsServices.get(session, FeedItemServiceInterface.class);

    List<String> feedItemIds = Lists.newArrayList(
        Iterables.transform(feedItemDescriptions.keySet(), Functions.toStringFunction()));
    Selector itemSelector = new SelectorBuilder()
        .fields("FeedId", "FeedItemId", "AttributeValues")
        // Limit FeedItems to the feed.
        .equalsId(feedId)
        // Limit FeedItems to the items in the feedItemDescriptions map.
        .in("FeedItemId", feedItemIds.toArray(new String[0])).build();
View Full Code Here

  private static void updateFeedMapping(AdWordsServices adWordsServices, AdWordsSession session,
      Long feedId, FeedAttribute line1FeedAttribute, FeedAttribute line2FeedAttribute)
      throws Exception {
    FeedMappingServiceInterface mappingService =
        adWordsServices.get(session, FeedMappingServiceInterface.class);
    Selector selector = new SelectorBuilder()
        .fields("FeedId", "FeedMappingId", "PlaceholderType", "AttributeFieldMappings")
        .equalsId(feedId)
        .build();

    FeedMapping feedMapping = mappingService.get(selector).getEntries()[0];
View Full Code Here

      throws Exception {
    // Get the constant data service.
    ConstantDataServiceInterface constantDataService =
        adWordsServices.get(session, ConstantDataServiceInterface.class);
   
    Selector selector = new SelectorBuilder()
      .equals("Country", "US")
      .build();
   
    ProductBiddingCategoryData[] results =
        constantDataService.getProductBiddingCategoryData(selector);
View Full Code Here

    CustomerSyncServiceInterface customerSyncService =
        adWordsServices.get(session, CustomerSyncServiceInterface.class);

    // Get a list of all campaign IDs.
    List<Long> campaignIds = new ArrayList<Long>();
    Selector selector = new SelectorBuilder()
        .fields("Id")
        .build();
    CampaignPage campaigns = campaignService.get(selector);
    if (campaigns.getEntries() != null) {
      for (Campaign campaign : campaigns.getEntries()) {
View Full Code Here

    // Get the AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create selector.
    Selector selector = new SelectorBuilder()
        .fields("Id", "AdGroupAdDisapprovalReasons")
        .orderAscBy("Id")
        .equals("AdGroupId", adGroupId.toString())
        .equals("AdGroupCreativeApprovalStatus", "DISAPPROVED")
        .build();
View Full Code Here

    int offset = 0;
    boolean morePages = true;

    // Create selector.
    SelectorBuilder builder = new SelectorBuilder();
    Selector selector = builder
        .fields("Id", "AdGroupId", "Status")
        .orderAscBy("Id")
        .offset(offset)
        .limit(PAGE_SIZE)
        .equals("AdGroupId", adGroupId.toString())
        .in("Status", "ENABLED", "PAUSED", "DISABLED")
        .equals("AdType", "TEXT_AD")
        .build();

    while (morePages) {
      // Get all 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 \""
              + adGroupAd.getAd().getAdType() + "\" was found.");
        }
      } else {
        System.out.println("No ads were found.");
      }

      offset += PAGE_SIZE;
      selector = builder.increaseOffsetBy(PAGE_SIZE).build();
      morePages = offset < page.getTotalNumEntries();
    }
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.utils.v201402.SelectorBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.