Package com.google.api.adwords.v201008.cm

Examples of com.google.api.adwords.v201008.cm.CampaignCriterionReturnValue


   */
  public void testGetAllForCampaign() throws Exception {
    // Create selector.
    CampaignAdExtensionSelector selector = new CampaignAdExtensionSelector();
    DateRange range = new DateRange(TestUtils.firstDayOfMonth(), TestUtils.today());
    selector.setStatsSelector(new CampaignAdExtensionStatsSelector(range, null));
    selector.setCampaignIds(new long[] {campaignId});
    selector.setStatuses(new CampaignAdExtensionStatus[] {CampaignAdExtensionStatus.ACTIVE,
        CampaignAdExtensionStatus.DELETED});

    CampaignAdExtensionPage page = service.get(selector);
View Full Code Here


    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];

    // Exclude generated fields.
    criterion.getCriterion().setId(testCriterion.getCriterion().getId());
    criterion.getCriterion().setCriterionType(testCriterion.getCriterion().getCriterionType());
    criterion.setCampaignCriterionType(testCriterion.getCampaignCriterionType());
View Full Code Here

    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];

    assertEquals(criterion.getCriterion().getId(), testCriterion.getCriterion().getId());
  }
View Full Code Here

    budget.setAmount(new Money(null, 50000000L));
    budget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
    campaign.setBudget(budget);

    // Create operations.
    CampaignOperation operation = new CampaignOperation();
    operation.setOperand(campaign);
    operation.setOperator(Operator.ADD);

    CampaignOperation[] operations = new CampaignOperation[] {operation};

    CampaignReturnValue result = service.mutate(operations);
View Full Code Here

  public void testInvalidCreateCampaign() throws Exception {
    // Create campaign.
    Campaign campaign = new Campaign();

    // Create operations.
    CampaignOperation operation = new CampaignOperation();
    operation.setOperand(campaign);
    operation.setOperator(Operator.ADD);

    CampaignOperation[] operations = new CampaignOperation[] {operation};

    CampaignReturnValue result;
    try {
View Full Code Here

    operation.setOperand(campaign);
    operation.setOperator(Operator.ADD);

    CampaignOperation[] operations = new CampaignOperation[] {operation};

    CampaignReturnValue result = service.mutate(operations);

    assertNull(result);
  }
View Full Code Here

    operation.setOperand(campaign);
    operation.setOperator(Operator.ADD);

    CampaignOperation[] operations = new CampaignOperation[] {operation};

    CampaignReturnValue result;
    try {
      result = service.mutate(operations);
      Campaign testCampaign = result.getValue()[0];
    } catch (ApiException e) {
      // Expected API Exception.
    } catch (Exception e) {
      throw e;
    }
View Full Code Here

        // Specifying GOOGLE_SEARCH is necessary if you want to target
        // SEARCH_NETWORK.
        new NetworkTarget(null, NetworkCoverageType.GOOGLE_SEARCH),
        new NetworkTarget(null, NetworkCoverageType.SEARCH_NETWORK)});

    CampaignTargetOperation languageTargetOperation = new CampaignTargetOperation();
    languageTargetOperation.setOperand(languageTargetList);
    languageTargetOperation.setOperator(Operator.SET);

    CampaignTargetOperation geoTargetOperation = new CampaignTargetOperation();
    geoTargetOperation.setOperand(geoTargetList);
    geoTargetOperation.setOperator(Operator.SET);

    CampaignTargetOperation networkTargetOperation = new CampaignTargetOperation();
    networkTargetOperation.setOperand(networkTargetList);
    networkTargetOperation.setOperator(Operator.SET);

    CampaignTargetOperation[] operations = new CampaignTargetOperation[] {languageTargetOperation,
        geoTargetOperation, networkTargetOperation};

    // Set campaign targets.
View Full Code Here

    // Create selector.
    CampaignTargetSelector selector = new CampaignTargetSelector();
    selector.setCampaignIds(new long[] {campaignId});

    // Get all campaign targets.
    CampaignTargetPage page = service.get(selector);

    assertEquals(7, page.getEntries().length);
  }
View Full Code Here

    CampaignTargetOperation[] operations = new CampaignTargetOperation[] {languageTargetOperation,
        geoTargetOperation, networkTargetOperation};

    // Set campaign targets.
    CampaignTargetReturnValue result = service.mutate(operations);

    // Exclude generated fields and test objects.
    if (result != null && result.getValue() != null) {
      for (TargetList testList : result.getValue()) {

        if (testList.getTargetListType().equals("LanguageTargetList")) {
          languageTargetList.setTargetListType(testList.getTargetListType());
          for (LanguageTarget languageTarget : languageTargetList.getTargets()) {
            languageTarget.setTargetType(((LanguageTarget) ((LanguageTargetList) testList)
View Full Code Here

TOP

Related Classes of com.google.api.adwords.v201008.cm.CampaignCriterionReturnValue

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.