}
public static void runExample(
AdWordsServices adWordsServices, AdWordsSession session) throws Exception {
// Get the BudgetService.
BudgetServiceInterface budgetService =
adWordsServices.get(session, BudgetServiceInterface.class);
// Create a budget, which can be shared by multiple video campaigns.
Budget sharedBudget = new Budget();
sharedBudget.setName("Interplanetary Cruise #" + System.currentTimeMillis());
Money budgetAmount = new Money();
budgetAmount.setMicroAmount(50000000L);
sharedBudget.setAmount(budgetAmount);
sharedBudget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
sharedBudget.setPeriod(BudgetBudgetPeriod.DAILY);
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 =