// Get AdWordsUser from "~/adwords.properties".
AdWordsUser user = new AdWordsUser();
// Get the AdGroupService.
AdGroupServiceInterface adGroupService =
user.getService(AdWordsService.V201306.ADGROUP_SERVICE);
long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
// Create ad group with updated status.
AdGroup adGroup = new AdGroup();
adGroup.setId(adGroupId);
adGroup.setStatus(AdGroupStatus.PAUSED);
// Create operations.
AdGroupOperation operation = new AdGroupOperation();
operation.setOperand(adGroup);
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 \""