lineItem.setStartDateTimeType(StartDateTimeType.IMMEDIATELY);
lineItem.setEndDateTime(DateTimeUtils.fromString("2012-09-01T00:00:00"));
// Set the cost per unit to $2.
lineItem.setCostType(CostType.CPM);
lineItem.setCostPerUnit(new Money("USD", 2000000L));
// Set the number of units bought to 500,000 so that the budget is
// $1,000.
lineItem.setUnitsBought(500000L);
lineItem.setUnitType(UnitType.IMPRESSIONS);