Package com.google.api.ads.adwords.axis.v201406.cm

Examples of com.google.api.ads.adwords.axis.v201406.cm.CampaignServiceInterface


    // Get the VideoCampaignService.
    VideoServiceInterface videoService = adWordsServices.get(session, VideoServiceInterface.class);

    // Create a selector.
    VideoSearchSelector selector = new VideoSearchSelector();
    selector.setSearchType(VideoSearchSelectorSearchType.VIDEO);
    selector.setQuery(query);
    selector.setPaging(new Paging(0, PAGE_SIZE));

    // Run the query.
    VideoSearchPage page = videoService.search(selector);

    // Display videos.
View Full Code Here


  public static void runExample(AdWordsServices adWordsServices,
      AdWordsSession session, String query)
      throws Exception {

    // Get the VideoCampaignService.
    VideoServiceInterface videoService = adWordsServices.get(session, VideoServiceInterface.class);

    // Create a selector.
    VideoSearchSelector selector = new VideoSearchSelector();
    selector.setSearchType(VideoSearchSelectorSearchType.VIDEO);
    selector.setQuery(query);
    selector.setPaging(new Paging(0, PAGE_SIZE));

    // Run the query.
    VideoSearchPage page = videoService.search(selector);

    // Display videos.
    if (page.getTotalNumEntries() > 0) {
      for (YouTubeVideo video : page.getEntries()) {
        System.out.printf("YouTube video id %s with title '%s' found.%n",
View Full Code Here

  public static void runExample(AdWordsServices adWordsServices,
      AdWordsSession session, Long campaignId, Long targetingGroupId)
      throws Exception {
    // Get the VideoTargetingGroupCriterionService
    VideoTargetingGroupCriterionServiceInterface videoTargetingGroupCriterionService =
        adWordsServices.get(session, VideoTargetingGroupCriterionServiceInterface.class);

    // Create an age criterion for age range 18 to 24.
    TargetingGroupCriterion ageCriterion = new TargetingGroupCriterion();
    ageCriterion.setCampaignId(campaignId);
    ageCriterion.setTargetingGroupId(targetingGroupId);
    AudienceAge age = new AudienceAge();
    age.setAgeRange(AudienceAgeAgeRange.AGE_RANGE_18_24);
    ageCriterion.setCriterion(age);

    TargetingGroupCriterionOperation addAgeCriterionOp =
        new TargetingGroupCriterionOperation();
    addAgeCriterionOp.setOperand(ageCriterion);
    addAgeCriterionOp.setOperator(Operator.ADD);
   
    // Create a negative age criterion for age 65+.
    NegativeTargetingGroupCriterion negativeAgeCriterion =
        new NegativeTargetingGroupCriterion();
    negativeAgeCriterion.setCampaignId(campaignId);
    negativeAgeCriterion.setTargetingGroupId(targetingGroupId);
    AudienceAge negativeAge = new AudienceAge();
    negativeAge.setAgeRange(AudienceAgeAgeRange.AGE_RANGE_65_UP);
    negativeAgeCriterion.setCriterion(negativeAge);

    TargetingGroupCriterionOperation addNegativeAgeCriterionOp =
        new TargetingGroupCriterionOperation();
    addNegativeAgeCriterionOp.setOperand(negativeAgeCriterion);
    addNegativeAgeCriterionOp.setOperator(Operator.ADD);

    // Create a gender criterion for male.
    TargetingGroupCriterion genderCriterion = new TargetingGroupCriterion();
    AudienceGender gender = new AudienceGender();
    gender.setGenderType(AudienceGenderGenderType.GENDER_MALE);
    genderCriterion.setCampaignId(campaignId);
    genderCriterion.setTargetingGroupId(targetingGroupId);
    genderCriterion.setCriterion(gender);

    TargetingGroupCriterionOperation addGenderCriterionOp =
        new TargetingGroupCriterionOperation();
    addGenderCriterionOp.setOperand(genderCriterion);
    addGenderCriterionOp.setOperator(Operator.ADD);

    // Create a topic criterion for the Autos & Vehicles topic.
    // See ConstantDataService for a list of verticals.
    TargetingGroupCriterion topicCriterion = new TargetingGroupCriterion();
    Topic topic = new Topic();
    topic.setVerticalId(47L);
    topicCriterion.setCampaignId(campaignId);
    topicCriterion.setTargetingGroupId(targetingGroupId);
    topicCriterion.setCriterion(topic);

    TargetingGroupCriterionOperation addTopicCriterionOp =
        new TargetingGroupCriterionOperation();
    addTopicCriterionOp.setOperand(topicCriterion);
    addTopicCriterionOp.setOperator(Operator.ADD);

    // Create an interest criterion for the Tablet PC interest.
    // See ConstantDataService for a list of verticals.
    TargetingGroupCriterion interestCriterion = new TargetingGroupCriterion();
    AudienceInterest interest = new AudienceInterest();
    interest.setInterestId(1277L);

    interestCriterion.setCampaignId(campaignId);
    interestCriterion.setTargetingGroupId(targetingGroupId);
    interestCriterion.setCriterion(interest);

    TargetingGroupCriterionOperation addUserInterestCriteriaOp =
        new TargetingGroupCriterionOperation();
    addUserInterestCriteriaOp.setOperand(interestCriterion);
    addUserInterestCriteriaOp.setOperator(Operator.ADD);

    TargetingGroupCriterionReturnValue result = videoTargetingGroupCriterionService.mutate(
        new TargetingGroupCriterionOperation[] {
          addAgeCriterionOp, addGenderCriterionOp,
          addNegativeAgeCriterionOp, addTopicCriterionOp,
          addUserInterestCriteriaOp});
   
View Full Code Here

    assertTrue("No services should be registered yet.",
        instance.getNumberRegisteredServices() == 0);

    AdWordsUser testUser1 = new AdWordsUser("test_data/test.properties");
    AdWordsUser testUser2 = new AdWordsUser("test_data/test.properties");
    CampaignServiceInterface campaignService =
        testUser1.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);

    instance.putService(((Stub) campaignService), testUser2);

    assertEquals(1, instance.getNumberRegisteredServices());
View Full Code Here

  public void testGetServiceAccountantRemote() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(true);
    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");

    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    assertNotNull(instance.getServiceAccountant(campaignService));
  }
View Full Code Here

  public void testGetServiceAccountantStub() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(true);
    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");

    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    assertNotNull(instance.getServiceAccountant((Stub) campaignService));
  }
View Full Code Here

  public void testGetServiceAccountantService() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(true);
    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");

    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    assertNotNull(instance.getServiceAccountant(((Stub) campaignService)._getService()));
  }
View Full Code Here

  public void testRemoveServiceRemote() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(true);
    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");

    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    instance.removeService(campaignService);
    assertTrue("Service was not removed.", instance.getNumberRegisteredServices() == 0);
  }
View Full Code Here

  public void testRemoveServiceStub() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(true);
    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");

    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    instance.removeService((Stub) campaignService);
    assertTrue("Service was not removed.", instance.getNumberRegisteredServices() == 0);
  }
View Full Code Here

  public void testRemoveServiceService() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(true);
    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");

    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    instance.removeService(((Stub) campaignService)._getService());
    assertTrue("Service was not removed.", instance.getNumberRegisteredServices() == 0);
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201406.cm.CampaignServiceInterface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.