BudgetReturnValue budgetResult = budgetService.mutate(
new BudgetOperation[] {budgetOperation});
Long budgetId = budgetResult.getValue(0).getBudgetId();
// Get the VideoCampaignService.
VideoCampaignServiceInterface videoCampaignService =
adWordsServices.get(session, VideoCampaignServiceInterface.class);
// Create video campaign.
VideoCampaign videoCampaign = new VideoCampaign();
videoCampaign.setName("Interplanetary Cruise #"
+ System.currentTimeMillis());
videoCampaign.setStatus(VideoCampaignStatus.PAUSED);
VideoAdNetworks networks = new VideoAdNetworks();
networks.setNetworks(new VideoAdNetwork[] {
VideoAdNetwork.GOOGLE_DISPLAY_NETWORK,
VideoAdNetwork.YOUTUBE_WATCH});
videoCampaign.setNetworks(networks);
// You can optionally provide these field(s).
videoCampaign.setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd"));
videoCampaign.setBudgetId(budgetId);
// Create operations.
VideoCampaignOperation operation = new VideoCampaignOperation();
operation.setOperand(videoCampaign);
operation.setOperator(Operator.ADD);
VideoCampaignOperation[] operations = new VideoCampaignOperation[] {operation};
// Add video campaigns.
VideoCampaignReturnValue result = videoCampaignService.mutate(operations);
// Display video campaigns.
for (VideoCampaign videoCampaignResult : result.getValue()) {
System.out.printf("Campaign with name '%s' and id %d was added.%n",
videoCampaignResult.getName(),