Note: {@link ManagedCustomerOperation}only supports {@code ADD} operator.
operations
7879808182838485868788
operation.setOperator(Operator.SET); AdGroupOperation[] operations = new AdGroupOperation[] {operation}; // Delete ad group. AdGroupReturnValue result = adGroupService.mutate(operations); // Display ad groups. for (AdGroup adGroupResult : result.getValue()) { System.out.println("Ad group with name \"" + adGroupResult.getName() + "\" and id \"" + adGroupResult.getId() + "\" was deleted.");
138139140141142143144145146147148
adGroupOperation.setOperand(adGroup); adGroupOperation.setOperator(Operator.ADD); // Make the mutate request. AdGroupReturnValue adGroupAddResult = adGroupService.mutate(new AdGroupOperation[] {adGroupOperation}); // Display result. adGroup = adGroupAddResult.getValue(0); System.out.printf("Ad group with name '%s' and ID %d was added.%n", adGroup.getName(), adGroup.getId());
operation.setOperator(Operator.SET); AdGroupOperation[] operations = new AdGroupOperation[] {operation}; // Update ad group. AdGroupReturnValue result = adGroupService.mutate(operations); // Display ad groups. for (AdGroup adGroupResult : result.getValue()) { System.out.println("Ad group with name \"" + adGroupResult.getName() + "\", id \"" + adGroupResult.getId() + "\", and status \"" + adGroupResult.getStatus()
145146147148149150151152153154155
AdGroupOperation adGroupOperation = new AdGroupOperation(); adGroupOperation.setOperand(adGroup); adGroupOperation.setOperator(Operator.SET); // Update ad group. adGroup = adGroupService.mutate(new AdGroupOperation[] {adGroupOperation}).getValue()[0]; System.out.println("Ad group with name \"" + adGroup.getName() + "\" and id \"" + adGroup.getId() + "\" was updated for the experiment."); // Set ad group criterion for the experiment.
9293949596979899100101102
adParamOperation2.setOperator(Operator.SET); AdParamOperation[] operations = new AdParamOperation[] {adParamOperation1, adParamOperation2}; // Set ad parameters. AdParam[] adParams = adParamService.mutate(operations); // Display ad parameters. for (AdParam adParam : adParams) { System.out.println("Ad parameter with ad group id \"" + adParam.getAdGroupId() + "\", criterion id \"" + adParam.getCriterionId() + "\", insertion text \""
120121122123124125126127128129130
BiddingStrategyOperation operation = new BiddingStrategyOperation(); operation.setOperand(sharedBiddingStrategy); operation.setOperator(Operator.ADD); BiddingStrategyOperation[] operations = new BiddingStrategyOperation[] {operation}; BiddingStrategyReturnValue result = biddingStrategyService.mutate(operations); SharedBiddingStrategy newBiddingStrategy = result.getValue(0); System.out.printf( "Shared bidding strategy with name '%s' and ID %d of type %s was created.\n",
100101102103104105106107108109110
budgetOperation.setOperand(sharedBudget); budgetOperation.setOperator(Operator.ADD); // Add the budget Long budgetId = budgetService.mutate(new BudgetOperation[] {budgetOperation}).getValue(0).getBudgetId(); // Get the CampaignService. CampaignServiceInterface campaignService = adWordsServices.get(session, CampaignServiceInterface.class);
163164165166167168169170171172173
operation.setOperator(Operator.ADD); BudgetOperation[] operations = new BudgetOperation[] {operation}; // Make the mutate request. BudgetReturnValue result = budgetService.mutate(operations); Budget newBudget = result.getValue(0); System.out.printf("Budget with name '%s', ID %d was created.\n", newBudget.getName(), newBudget.getBudgetId());
BudgetOperation budgetOperation = new BudgetOperation(); budgetOperation.setOperand(sharedBudget); budgetOperation.setOperator(Operator.ADD); // Add the budget and get the budget ID. BudgetReturnValue budgetResult = budgetService.mutate( new BudgetOperation[] {budgetOperation}); Long budgetId = budgetResult.getValue(0).getBudgetId(); // Get the VideoCampaignService. VideoCampaignServiceInterface videoCampaignService =
115116117118119120121122123124125
operation.setOperator(Operator.ADD); CampaignAdExtensionOperation[] operations = new CampaignAdExtensionOperation[] {operation}; // Add campaign ad extension. CampaignAdExtensionReturnValue result = campaignAdExtensionService.mutate(operations); // Display campaign ad extensions. for (CampaignAdExtension campaignAdExtensionResult : result.getValue()) { System.out.println("Location campaign ad extension with campaign id \"" + campaignAdExtensionResult.getCampaignId() + "\", ad extension id \""