public static void runExample(
AdWordsServices adWordsServices, AdWordsSession session, String videoId)
throws Exception {
// Get the VideoService.
VideoServiceInterface videoService =
adWordsServices.get(session, VideoServiceInterface.class);
// Create the call to action.
VideoCallToAction videoCallToAction = new VideoCallToAction();
videoCallToAction.setId(videoId);
CallToAction callToAction = new CallToAction();
CallToActionCreative callToActionCreative = new CallToActionCreative();
callToActionCreative.setHeadline("Mars cruise");
callToActionCreative.setDescriptionLine1("Astonishing views");
callToActionCreative.setDescriptionLine2("Mild climate");
callToActionCreative.setDisplayUrl("www.example.com/mars");
callToActionCreative.setDestinationUrl("www.example.com/mars");
callToAction.setCreative(callToActionCreative);
videoCallToAction.setCallToAction(callToAction);
VideoCallToActionOperation operation = new VideoCallToActionOperation();
operation.setOperand(videoCallToAction);
// Use SET to add a new Call to Action, or to overwrite an existing one.
operation.setOperator(Operator.SET);
VideoCallToActionOperation[] operations = new VideoCallToActionOperation[] {operation};
// Add video call to action.
VideoReturnValue result = videoService.mutateCallToAction(operations);
for (YouTubeVideo youTubeVideoResult : result.getValue()) {
System.out.printf("CallToAction overlay was added to video ID %s, "
+ "headline '%s'.%n",
youTubeVideoResult.getId(),