Package com.google.api.adwords.v201306.cm

Examples of com.google.api.adwords.v201306.cm.Selector


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

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

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

    // Display serviced account graph.
View Full Code Here


    // 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.
View Full Code Here

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

    // Create selector.
    Selector selector = new Selector();
    selector.setFields(new String[] {"Id", "AdGroupAdDisapprovalReasons"});
    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.
View Full Code Here

    // Create predicate and selector.
    Predicate predicate = new Predicate();
    predicate.setField("Id");
    predicate.setOperator(PredicateOperator.IN);
    predicate.setValues(conversionIds.toArray(new String[0]));
    Selector selector = new Selector();
    selector.setFields(new String[] {"Id"});
    selector.setPredicates(new Predicate[] {predicate});

    // Get all conversion trackers.
    Map<Long, AdWordsConversionTracker> conversionTrackers =
        new HashMap<Long, AdWordsConversionTracker>();
    ConversionTrackerPage page = conversionTrackerService.get(selector);
View Full Code Here

    // Get the CampaignService.
    CampaignServiceInterface campaignService =
        adWordsServices.get(session, CampaignServiceInterface.class);

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

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

    // Display campaigns.
View Full Code Here

    String formatStart = dateFormat.format(start.toDate());
    String formatEnd = dateFormat.format(end.toDate());

    builder = builder.fields("Id", "Name", "Status").forDateRange(start, end);

    Selector selector = builder.build();

    Assert.assertEquals(selector.getDateRange().getMin(), formatStart);
    Assert.assertEquals(selector.getDateRange().getMax(), formatEnd);

    String formatEndPlusOne = dateFormat.format(end.plusDays(1).toDate());

    DateRange dateRange = new DateRange();
    dateRange.setMin(formatStart);
    dateRange.setMax(formatEndPlusOne);

    selector.setDateRange(dateRange);

    Assert.assertEquals(selector.getDateRange().getMin(), formatStart);
    Assert.assertEquals(selector.getDateRange().getMax(), formatEndPlusOne);

    Selector selectorRebuilt =
        builder.fields("Id", "Name", "Status").forDateRange(start, end).build();

    Assert.assertEquals(selectorRebuilt.getDateRange().getMin(), formatStart);
    Assert.assertEquals(selectorRebuilt.getDateRange().getMax(), formatEnd);

  }
View Full Code Here

    SelectorBuilder builder = new SelectorBuilder();

    builder =
        builder.fields("Id", "Name", "Status", "StartDate", "EndDate", "ServingStatus", "Settings");

    Selector selector = builder.build();

    Assert.assertEquals(7, selector.getFields().length);

    Assert.assertEquals("Id", selector.getFields()[0]);
    Assert.assertEquals("Name", selector.getFields()[1]);
    Assert.assertEquals("Status", selector.getFields()[2]);
    Assert.assertEquals("StartDate", selector.getFields()[3]);
    Assert.assertEquals("EndDate", selector.getFields()[4]);
    Assert.assertEquals("ServingStatus", selector.getFields()[5]);
    Assert.assertEquals("Settings", selector.getFields()[6]);

    selector = builder.fields("Id",
        "Name",
        "Status",
        "StartDate",
        "EndDate",
        "ServingStatus",
        "Settings",
        "Id",
        "AverageCpc").build();

    Assert.assertEquals(8, selector.getFields().length);

    Assert.assertEquals("Id", selector.getFields()[0]);
    Assert.assertEquals("Name", selector.getFields()[1]);
    Assert.assertEquals("Status", selector.getFields()[2]);
    Assert.assertEquals("StartDate", selector.getFields()[3]);
    Assert.assertEquals("EndDate", selector.getFields()[4]);
    Assert.assertEquals("ServingStatus", selector.getFields()[5]);
    Assert.assertEquals("Settings", selector.getFields()[6]);
    Assert.assertEquals("AverageCpc", selector.getFields()[7]);

  }
View Full Code Here

    SelectorBuilder builder = new SelectorBuilder();

    builder =
        builder.fields("Id", "Name", "Status", "StartDate", "EndDate", "ServingStatus", "Settings");

    Selector selector = builder.build();

    Assert.assertEquals(7, selector.getFields().length);

    Assert.assertEquals("Id", selector.getFields()[0]);
    Assert.assertEquals("Name", selector.getFields()[1]);
    Assert.assertEquals("Status", selector.getFields()[2]);
    Assert.assertEquals("StartDate", selector.getFields()[3]);
    Assert.assertEquals("EndDate", selector.getFields()[4]);
    Assert.assertEquals("ServingStatus", selector.getFields()[5]);
    Assert.assertEquals("Settings", selector.getFields()[6]);

  }
View Full Code Here

  @Test
  public void testPredicatesBuild() {
    SelectorBuilder builder = new SelectorBuilder();

    builder = builder.byId(10L);
    Selector selector = builder.build();

    Assert.assertNotNull(selector.getPredicates());
    Assert.assertEquals(1, selector.getPredicates().length);

    Predicate predicate = selector.getPredicates()[0];
    Assert.assertEquals("Id", predicate.getField());
    Assert.assertEquals(PredicateOperator.EQUALS, predicate.getOperator());
    Assert.assertNotNull(predicate.getValues());
    Assert.assertEquals(1, predicate.getValues().length);
    Assert.assertEquals("10", predicate.getValues()[0]);
View Full Code Here

  public void testPredicatesInBuild() {
    SelectorBuilder builder = new SelectorBuilder();

    builder =
        builder.in("Status", CampaignStatus.ACTIVE.toString(), CampaignStatus.DELETED.toString());
    Selector selector = builder.build();

    Assert.assertNotNull(selector.getPredicates());
    Assert.assertEquals(1, selector.getPredicates().length);

    Predicate predicate = selector.getPredicates()[0];
    Assert.assertEquals("Status", predicate.getField());
    Assert.assertEquals(PredicateOperator.IN, predicate.getOperator());
    Assert.assertNotNull(predicate.getValues());
    Assert.assertEquals(2, predicate.getValues().length);
    Assert.assertEquals(CampaignStatus.ACTIVE.toString(), predicate.getValues()[0]);
View Full Code Here

TOP

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