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 \""
+ adGroupResult.getId() + "\" was added.");
}
} else {
System.out.println("No ad groups were added.");