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

Examples of com.google.api.ads.adwords.axis.v201402.cm.Selector


    int offset = 0;

    // To get all express businesses owned by the current customer,
    // simply skip the call to SelectorBuilder.equals below
    Selector selector = new SelectorBuilder()
        .fields("Id", "Name", "Website", "Address", "GeoPoint", "Status")
        .equals("Status", ExpressBusinessStatus.ACTIVE.getValue())
        .offset(offset)
        .limit(PAGE_SIZE)
        .build();

    List<ExpressBusiness> businesses = Lists.newArrayList();
    ExpressBusinessPage page;
    do {
      // Get all businesses.
      page = businessService.get(selector);

      // Display businesses.
      if (page.getTotalNumEntries() > 0) {
        for (ExpressBusiness business : page.getEntries()) {
          System.out.printf("Express business found with name '%s' id %d website: %s "
              + "address: %s geo point: %s status: %s%n",
              business.getName(),
              business.getId(),
              business.getWebsite(),
              toString(business.getAddress()),
              toString(business.getGeoPoint()),
              business.getStatus().getValue());
          businesses.add(business);
        }
      } else {
        System.out.println("No express businesses were found.");
      }

      offset += PAGE_SIZE;
      selector.getPaging().setStartIndex(offset);
    } while (offset < page.getTotalNumEntries());

    System.out.printf("Found %d express businesses in total%n", businesses.size());

    return businesses;
View Full Code Here


    ExpressBusinessServiceInterface businessService =
        adWordsServices.get(session, ExpressBusinessServiceInterface.class);

    // Get the business for the businessId. We will need its geo point to create
    // a Proximity criterion for the new Promotion.
    Selector businessSelector = new SelectorBuilder()
        .fields("Id", "GeoPoint")
        .equals("Id", String.valueOf(businessId))
        .build();

    ExpressBusiness business = businessService.get(businessSelector).getEntries(0);
View Full Code Here

      AdWordsSession session, String productServiceSuggestion, String localeText) throws Exception {
    ProductServiceServiceInterface service =
        adWordsServices.get(session, ProductServiceServiceInterface.class);

    int offset = 0;
    Selector selector = new SelectorBuilder()
        .fields("ProductServiceText")
        .equals("ProductServiceText", productServiceSuggestion)
        .equals("Locale", localeText)
        .offset(offset)
        .limit(PAGE_SIZE)
        .build();

    ProductServicePage page;
    List<ProductService> productServices = Lists.newArrayList();
    do {
      page = service.get(selector);

      if (page.getTotalNumEntries() > 0) {
        for (ProductService productService : page.getEntries()) {
          System.out.printf("Product/service with text '%s' found%n", productService.getText());
          productServices.add(productService);
        }
      } else {
        System.out.println("No products/services found");
      }

      offset += PAGE_SIZE;
      selector.getPaging().setStartIndex(offset);
    } while (offset < page.getTotalNumEntries());

    System.out.printf(
        "Found %d products/services for product/service suggestion '%s' and locale '%s'%n",
        productServices.size(), productServiceSuggestion, localeText);
View Full Code Here

          user.getService(AdWordsService.V201306.ADGROUP_CRITERION_SERVICE);

      Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Id", "AdGroupId", "Status"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Id", SortOrder.ASCENDING)});

      // Create predicates.
      Predicate statusPredicate =
          new Predicate("Status", PredicateOperator.IN, new String[] {"ACTIVE"});
      Predicate adGroupIdPredicate =
          new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
      selector.setPredicates(new Predicate[] {statusPredicate, adGroupIdPredicate});

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

      // Display ad group criteria.
View Full Code Here

          user.getService(AdWordsService.V201306.DATA_SERVICE);

      Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"AdGroupId", "LandscapeType", "LandscapeCurrent",
          "StartDate", "EndDate", "Bid", "LocalClicks", "LocalCost", "MarginalCpc",
          "LocalImpressions"});

      // Create predicates.
      Predicate adGroupIdPredicate =
          new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
      selector.setPredicates(new Predicate[] {adGroupIdPredicate});

      // Get bid landscape for ad group criteria.
      AdGroupBidLandscapePage page = dataService.getAdGroupBidLandscape(selector);

      // Display bid landscapes.
View Full Code Here

      // Get the MediaService.
      MediaServiceInterface mediaService =
          user.getService(AdWordsService.V201306.MEDIA_SERVICE);

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"MediaId", "Name"});
      selector.setOrdering(new OrderBy[] {new OrderBy("MediaId", SortOrder.ASCENDING)});

      // Create predicates.
      Predicate typePredicate =
          new Predicate("Type", PredicateOperator.IN, new String[] {"VIDEO"});
      selector.setPredicates(new Predicate[] {typePredicate});

      // Get all videos.
      MediaPage page = mediaService.get(selector);

      // Display videos.
View Full Code Here

      // Get the ServicedAccountService.
      ManagedCustomerServiceInterface managedCustomerService =
          user.getService(AdWordsService.V201306.MANAGED_CUSTOMER_SERVICE);

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Login", "CustomerId"});

      // Get results.
      ManagedCustomerPage page = managedCustomerService.get(selector);

      if (page.getEntries() != null) {
View Full Code Here

          user.getService(AdWordsService.V201306.ADGROUP_AD_SERVICE);

      Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Id", "AdGroupId", "Status"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Id", SortOrder.ASCENDING)});

      // Create predicates.
      Predicate adGroupIdPredicate =
          new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
      // By default disabled ads aren't returned by the selector. To return them
      // include the DISABLED status in a predicate.
      Predicate statusPredicate =
          new Predicate("Status", PredicateOperator.IN, new String[] {"ENABLED", "PAUSED",
              "DISABLED"});
      selector.setPredicates(new Predicate[] {adGroupIdPredicate, statusPredicate});

      // Get all ads.
      AdGroupAdPage page = adGroupAdService.get(selector);

      // Display ads.
View Full Code Here

          user.getService(AdWordsService.V201306.CAMPAIGN_SERVICE);

      Long campaignId = Long.parseLong("INSERT_CAMPAIGN_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Id", "Name", "Eligible", "RejectionReasons"});

      // Create predicates.
      Predicate campaignIdPredicate =
          new Predicate("CampaignId", PredicateOperator.IN, new String[] {campaignId.toString()});
      selector.setPredicates(new Predicate[] {campaignIdPredicate});

      // Get campaigns.
      CampaignPage page = campaignService.get(selector);

      // Display campaigns.
View Full Code Here

          user.getService(AdWordsService.V201306.CAMPAIGN_CRITERION_SERVICE);

      Long campaignId = Long.parseLong("INSERT_CAMPAIGN_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"CampaignId"});
      // Create predicates.
      Predicate campaignIdPredicate =
          new Predicate("CampaignId", PredicateOperator.IN, new String[] {campaignId.toString()});
      selector.setPredicates(new Predicate[] {campaignIdPredicate});

      // Get all campaign targets.
      CampaignCriterionPage page = campaignCriterionService.get(selector);

      // Display campaign targets.
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201402.cm.Selector

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.