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

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


  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


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

    // Add campaign and return campaign ID
    return campaignService.mutate(operations).getValue()[0].getId();
View Full Code Here

    Campaign campaign = new Campaign();
    campaign.setId(campaignId);
    campaign.setStatus(CampaignStatus.DELETED);

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

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

    // Delete campaign.
    CampaignReturnValue result = campaignService.mutate(operations);
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};

    // Add campaign.
    CampaignReturnValue result = campaignService.mutate(operations);
View Full Code Here

    budget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
    campaign1.setBudget(budget);
    campaign2.setBudget(budget);

    // Create operations.
    CampaignOperation operation1 = new CampaignOperation();
    operation1.setOperand(campaign1);
    operation1.setOperator(Operator.ADD);
    CampaignOperation operation2 = new CampaignOperation();
    operation2.setOperand(campaign2);
    operation2.setOperator(Operator.ADD);

    CampaignOperation[] operations = new CampaignOperation[] {operation1, operation2};

    // Add campaigns.
    CampaignReturnValue result = campaignService.mutate(operations);
View Full Code Here

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

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

    CampaignOperation[] operations = new CampaignOperation[] {operation};
    CampaignReturnValue result = campaignService.mutate(operations);
    Campaign testCampaign = result.getValue()[0];
View Full Code Here

    budget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
    campaign1.setBudget(budget);
    campaign2.setBudget(budget);

    // Create operations.
    CampaignOperation operation1 = new CampaignOperation();
    operation1.setOperand(campaign1);
    operation1.setOperator(Operator.SET);

    CampaignOperation operation2 = new CampaignOperation();
    operation2.setOperand(campaign2);
    operation2.setOperator(Operator.SET);

    CampaignOperation[] operations = new CampaignOperation[] {operation1, operation2};
    CampaignReturnValue result = campaignService.mutate(operations);
    Campaign testCampaign1 = result.getValue()[0];
    Campaign testCampaign2 = result.getValue()[1];
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

   * Test getting all campaign ad extension for a campaign.
   */
  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});

View Full Code Here

TOP

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

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.