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

Examples of com.google.api.ads.adwords.axis.v201406.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.ENABLED.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


  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

    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

    // Get the ServicedAccountService.
    ManagedCustomerServiceInterface managedCustomerService =
        adWordsServices.get(session, ManagedCustomerServiceInterface.class);

    // Create selector.
    Selector selector = new SelectorBuilder()
        .fields("Login", "CustomerId", "Name")
        .build();

    // Get results.
    ManagedCustomerPage page = managedCustomerService.get(selector);
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

    int offset = 0;

    // Create selector.
    SelectorBuilder builder = new SelectorBuilder();
    Selector selector = builder
        .fields("Id", "Name", "Labels")
        // Labels filtering is performed by ID. You can use containsAny to select campaigns with
        // any of the label IDs, containsAll to select campaigns with all of the label IDs, or
        // containsNone to select campaigns with none of the label IDs.
        .containsAny("Labels", labelId.toString())
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())
View Full Code Here

    // Get the DataService.
    DataServiceInterface dataService =
        adWordsServices.get(session, DataServiceInterface.class);

    // Create selector.
    Selector selector = new SelectorBuilder()
        .fields(
            "AdGroupId",
            "CriterionId",
            "StartDate",
            "EndDate",
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201406.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.