Note: {@link ManagedCustomerOperation}only supports {@code ADD} operator.
operations
6364656667686970717273
operation.setOperator(Operator.SET); AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] {operation}; // Update ad group criteria. AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations); // Display ad group criteria. if (result != null && result.getValue() != null) { for (AdGroupCriterion adGroupCriterionResult : result.getValue()) { if (adGroupCriterionResult instanceof BiddableAdGroupCriterion) {
5859606162636465666768
operation.setOperator(Operator.SET); AdGroupOperation[] operations = new AdGroupOperation[]{operation}; // Delete ad group. AdGroupReturnValue result = adGroupService.mutate(operations); // Display ad groups. if (result != null && result.getValue() != null) { for (AdGroup adGroupResult : result.getValue()) { System.out.println("Ad group with name \"" + adGroupResult.getName() + "\" and id \""
operation.setOperator(Operator.SET); AdGroupOperation[] operations = new AdGroupOperation[]{operation}; // Update ad group. AdGroupReturnValue result = adGroupService.mutate(operations); // Display ad groups. if (result != null && result.getValue() != null) { for (AdGroup adGroupResult : result.getValue()) { System.out.println("Ad group with name \"" + adGroupResult.getName() + "\", id \""
126127128129130131132133134135136
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.
8687888990919293949596
operation.setOperator(Operator.ADD); AdGroupOperation[] operations = new AdGroupOperation[] {operation}; // Add ad group. AdGroupReturnValue result = adGroupService.mutate(operations); // Display new ad groups. if (result != null && result.getValue() != null) { for (AdGroup adGroupResult : result.getValue()) { System.out.println("Ad group with name \"" + adGroupResult.getName() + "\" and id \""
8586878889909192939495
7071727374757677787980
adParamOperation2.setOperator(Operator.SET); AdParamOperation[] operations = new AdParamOperation[] {adParamOperation1, adParamOperation2}; // Set ad parameters. AdParam[] adParams = adParamService.mutate(operations); // Display ad parameters. if (adParams != null) { for (AdParam adParam : adParams) { System.out.println("Ad parameter with ad group id \"" + adParam.getAdGroupId()
104105106107108109110111112113114
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",
144145146147148149150151152153154
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());
8384858687888990919293
// Add budget. BudgetOperation budgetOperation = new BudgetOperation(); budgetOperation.setOperand(budget); budgetOperation.setOperator(Operator.ADD); BudgetReturnValue budgetReturnValue = budgetService.mutate(new BudgetOperation[] {budgetOperation}); // Set the budget to the campaign. Budget createdBudget = new Budget(); createdBudget.setBudgetId(budgetReturnValue.getValue(0).getBudgetId()); campaign.setBudget(createdBudget);