public static void runExample(
AdWordsServices adWordsServices, AdWordsSession session, Long videoAdId)
throws Exception {
// Get the VideoCampaignService.
VideoAdServiceInterface videoAdService =
adWordsServices.get(session, VideoAdServiceInterface.class);
VideoAdDisplayFormat_VideoAdStatusMapEntry trueViewStatus =
new VideoAdDisplayFormat_VideoAdStatusMapEntry();
trueViewStatus.setKey(VideoAdDisplayFormat.TRUE_VIEW_IN_DISPLAY);
trueViewStatus.setValue(VideoAdStatus.PAUSED);
VideoAd ad = new VideoAd();
ad.setId(videoAdId);
ad.setStatusByFormat(new VideoAdDisplayFormat_VideoAdStatusMapEntry[] {trueViewStatus});
VideoAdOperation operation = new VideoAdOperation();
operation.setOperand(ad);
operation.setOperator(Operator.SET);
VideoAdReturnValue result = videoAdService.mutate(new VideoAdOperation[] {operation});
for (VideoAd videoAdResult : result.getValue()) {
System.out.printf("Video ad with id %d was updated.%n",
videoAdResult.getId());
}