Package com.google.api.ads.adwords.jaxws.v201309.cm

Examples of com.google.api.ads.adwords.jaxws.v201309.cm.CampaignCriterionOperation


   * Tests that the built selectors don't share internal Paging state.
   */
  @Test
  public void testUniqueInternalPagingState() {
    SelectorBuilder builder = new SelectorBuilder();
    Selector selectorOne = builder.fields("Id").offset(10).build();
    Selector selectorTwo = builder.fields("Status").offset(345).build();

    Assert.assertEquals(10, selectorOne.getPaging().getStartIndex().intValue());
    Assert.assertEquals(345, selectorTwo.getPaging().getStartIndex().intValue());
  }
View Full Code Here


   * Tests that the built selectors don't share internal OrderBy state.
   */
  @Test
  public void testUniqueInternalOrderByState() {
    SelectorBuilder builder = new SelectorBuilder();
    Selector selectorOne = builder.orderAscBy("Id").build();
    Selector selectorTwo = builder.build();

    OrderBy orderTwo = selectorTwo.getOrdering().get(0);
    orderTwo.setField("Status");

    Assert.assertEquals("Id", selectorOne.getOrdering().get(0).getField());
    Assert.assertEquals("Status", selectorTwo.getOrdering().get(0).getField());
  }
View Full Code Here

   * Tests that the built selectors don't share internal Predicate state.
   */
  @Test
  public void testUniqueInternalPredicateState() {
    SelectorBuilder builder = new SelectorBuilder();
    Selector selectorOne = builder.by("Id", "test").build();
    Selector selectorTwo = builder.build();

    Predicate predicateTwo = selectorTwo.getPredicates().get(0);
    predicateTwo.setField("Status");

    Assert.assertEquals("Id", selectorOne.getPredicates().get(0).getField());
    Assert.assertEquals("Status", selectorTwo.getPredicates().get(0).getField());
  }
View Full Code Here

    DateTime startOne = new DateTime(2013, 1, 1, 0, 0, 0, 0);
    DateTime endOne = new DateTime(2013, 1, 31, 0, 0, 0, 0);
    DateTime startTwo = new DateTime(2013, 2, 1, 0, 0, 0, 0);
    DateTime endTwo = new DateTime(2013, 2, 28, 0, 0, 0, 0);

    Selector selectorOne = builder.forDateRange(startOne, endOne).build();
    Selector selectorTwo = builder.forDateRange(startTwo, endTwo).build();

    Assert.assertEquals(dateFormat.format(startOne.toDate()), selectorOne.getDateRange().getMin());
    Assert.assertEquals(dateFormat.format(endOne.toDate()), selectorOne.getDateRange().getMax());
    Assert.assertEquals(dateFormat.format(startTwo.toDate()), selectorTwo.getDateRange().getMin());
    Assert.assertEquals(dateFormat.format(endTwo.toDate()), selectorTwo.getDateRange().getMax());
  }
View Full Code Here

      NegativeCampaignCriterion negativeCampaignCriterion = new NegativeCampaignCriterion();
      negativeCampaignCriterion.setCampaignId(campaign.getId());
      negativeCampaignCriterion.setCriterion(new Placement(null, null, "http://example.com/"));

      CampaignCriterionOperation operation = new CampaignCriterionOperation();
      operation.setOperator(Operator.ADD);
      operation.setOperand(negativeCampaignCriterion);

      campaignCriterionService.mutate(new CampaignCriterionOperation[] {operation});

      int numAdGrp = generator.nextInt(6) + 1;
      for (int j = 0; j < numAdGrp; j++) {
View Full Code Here

    NegativeCampaignCriterion negativeCampaignCriterion = new NegativeCampaignCriterion();
    negativeCampaignCriterion.setCampaignId(campaignId);
    negativeCampaignCriterion.setCriterion(keyword);

    // Create operations.
    CampaignCriterionOperation operation = new CampaignCriterionOperation();
    operation.setOperand(negativeCampaignCriterion);
    operation.setOperator(Operator.ADD);

    // Add campaign criteria and return Criterion ID
    return campaignCriterionService.mutate(new CampaignCriterionOperation[] {operation})
      .getValue()[0].getCriterion().getId();
  }
View Full Code Here

    NegativeCampaignCriterion criterion = new NegativeCampaignCriterion();
    criterion.setCampaignId(campaignId);
    criterion.setCriterion(keyword);

    // Create operations.
    CampaignCriterionOperation operation = new CampaignCriterionOperation();
    operation.setOperand(criterion);
    operation.setOperator(Operator.ADD);

    // Add campaign criteria.
    CampaignCriterionReturnValue result = service
        .mutate(new CampaignCriterionOperation[] {operation});
    NegativeCampaignCriterion testCriterion = (NegativeCampaignCriterion) result.getValue()[0];
View Full Code Here

    CampaignCriterion criterion = new CampaignCriterion();
    criterion.setCampaignId(campaignId);
    criterion.setCriterion(new Criterion(criterionId, null));

    // Create operation
    CampaignCriterionOperation operation = new CampaignCriterionOperation();
    operation.setOperand(criterion);
    operation.setOperator(Operator.REMOVE);

    // Remove campaign criteria
    CampaignCriterionReturnValue result = service
        .mutate(new CampaignCriterionOperation[] {operation});
    CampaignCriterion testCriterion = (CampaignCriterion) result.getValue()[0];
View Full Code Here

    // Create mobile platform. The ID can be found in the documentation.
    // https://developers.google.com/adwords/api/docs/appendix/platforms
    Platform mobile = new Platform();
    mobile.setId(30001L);

    CampaignCriterionOperation operation = new CampaignCriterionOperation();
    CampaignCriterion campaignCriterion = new CampaignCriterion();
    campaignCriterion.setCampaignId(campaignId);
    campaignCriterion.setCriterion(mobile);
    campaignCriterion.setBidModifier(1.5);
    operation.setOperand(campaignCriterion);
    operation.setOperator(Operator.SET);

    CampaignCriterionReturnValue result =
        campaignCriterionService.mutate(new CampaignCriterionOperation[] {operation});

    // Display campaign criteria.
View Full Code Here

      NegativeCampaignCriterion negativeCampaignCriterion = new NegativeCampaignCriterion();
      negativeCampaignCriterion.setCampaignId(campaignId);
      negativeCampaignCriterion.setCriterion(keyword);

      // Create operations.
      CampaignCriterionOperation operation = new CampaignCriterionOperation();
      operation.setOperand(negativeCampaignCriterion);
      operation.setOperator(Operator.ADD);

      // Add campaign criteria.
      CampaignCriterionReturnValue result =
          campaignCriterionService.mutate(new CampaignCriterionOperation[] {operation});
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.jaxws.v201309.cm.CampaignCriterionOperation

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.