Package com.google.api.adwords.v201008.cm

Examples of com.google.api.adwords.v201008.cm.Address


    operation.setOperand(campaign);
    operation.setOperator(Operator.ADD);

    CampaignOperation[] operations = new CampaignOperation[] {operation};

    CampaignReturnValue result;
    try {
      result = service.mutate(operations);
      Campaign testCampaign = result.getValue()[0];
    } catch (ApiException e) {
      // Expected API Exception.
    } catch (Exception e) {
      throw e;
    }
View Full Code Here


        // Specifying GOOGLE_SEARCH is necessary if you want to target
        // SEARCH_NETWORK.
        new NetworkTarget(null, NetworkCoverageType.GOOGLE_SEARCH),
        new NetworkTarget(null, NetworkCoverageType.SEARCH_NETWORK)});

    CampaignTargetOperation languageTargetOperation = new CampaignTargetOperation();
    languageTargetOperation.setOperand(languageTargetList);
    languageTargetOperation.setOperator(Operator.SET);

    CampaignTargetOperation geoTargetOperation = new CampaignTargetOperation();
    geoTargetOperation.setOperand(geoTargetList);
    geoTargetOperation.setOperator(Operator.SET);

    CampaignTargetOperation networkTargetOperation = new CampaignTargetOperation();
    networkTargetOperation.setOperand(networkTargetList);
    networkTargetOperation.setOperator(Operator.SET);

    CampaignTargetOperation[] operations = new CampaignTargetOperation[] {languageTargetOperation,
        geoTargetOperation, networkTargetOperation};

    // Set campaign targets.
View Full Code Here

    // Create selector.
    CampaignTargetSelector selector = new CampaignTargetSelector();
    selector.setCampaignIds(new long[] {campaignId});

    // Get all campaign targets.
    CampaignTargetPage page = service.get(selector);

    assertEquals(7, page.getEntries().length);
  }
View Full Code Here

    CampaignTargetOperation[] operations = new CampaignTargetOperation[] {languageTargetOperation,
        geoTargetOperation, networkTargetOperation};

    // Set campaign targets.
    CampaignTargetReturnValue result = service.mutate(operations);

    // Exclude generated fields and test objects.
    if (result != null && result.getValue() != null) {
      for (TargetList testList : result.getValue()) {

        if (testList.getTargetListType().equals("LanguageTargetList")) {
          languageTargetList.setTargetListType(testList.getTargetListType());
          for (LanguageTarget languageTarget : languageTargetList.getTargets()) {
            languageTarget.setTargetType(((LanguageTarget) ((LanguageTargetList) testList)
View Full Code Here

   */
  public void testGetAllForCampaign() throws Exception {
    service = user.getService(AdWordsService.V201008.CAMPAIGN_TARGET_SERVICE);

    // Create selector.
    CampaignTargetSelector selector = new CampaignTargetSelector();
    selector.setCampaignIds(new long[] {campaignId});

    // Get all campaign targets.
    CampaignTargetPage page = service.get(selector);

    assertEquals(7, page.getEntries().length);
View Full Code Here

        new LanguageTarget(null, "ja")});

    // Create geo targets.
    GeoTargetList geoTargetList = new GeoTargetList();
    geoTargetList.setCampaignId(campaignId);
    geoTargetList.setTargets(new GeoTarget[] {new CountryTarget(null, false, "US"),
        new CountryTarget(null, false, "JP")});

    // Create network targets.
    NetworkTargetList networkTargetList = new NetworkTargetList();
    networkTargetList.setCampaignId(campaignId);
    networkTargetList.setTargets(new NetworkTarget[] {
View Full Code Here

   * Test getting all campaign ad extension for a campaign.
   */
  public void testGetAllForCampaign() throws Exception {
    // Create selector.
    CampaignAdExtensionSelector selector = new CampaignAdExtensionSelector();
    DateRange range = new DateRange(TestUtils.firstDayOfMonth(), TestUtils.today());
    selector.setStatsSelector(new CampaignAdExtensionStatsSelector(range, null));
    selector.setCampaignIds(new long[] {campaignId});
    selector.setStatuses(new CampaignAdExtensionStatus[] {CampaignAdExtensionStatus.ACTIVE,
        CampaignAdExtensionStatus.DELETED});

View Full Code Here

    // Create ad selector.
    AdGroupAdSelector selector = new AdGroupAdSelector();
    selector.setAdIds(new long[] {adId});

    // Create date range.
    DateRange range = new DateRange(TestUtils.firstDayOfMonth(), TestUtils.today());
    selector.setStatsSelector(new AdStatsSelector(range, null));

    // Get ads with the selector created above.
    AdGroupAdPage page = service.get(selector);
View Full Code Here

    // Create selector.
    InfoSelector selector = new InfoSelector();
    selector.setServiceName("CampaignService");
    selector.setMethodName("mutate");
    selector.setOperator(Operator.ADD);
    selector.setDateRange(new DateRange(TestUtils.firstDayOfMonth(), TestUtils.today()));
    selector.setApiUsageType(ApiUsageType.UNIT_COUNT);

    ApiUsageInfo apiUsageInfo = service.get(selector);

    assertNull(apiUsageInfo.getApiUsageRecords());
View Full Code Here

  /**
   * Test getting a unit count for clients.
   */
  public void testGetntCountForClients() throws Exception {
    // Create selector.
    DateRange range = new DateRange(TestUtils.firstDayOfMonth(), TestUtils.today());
    InfoSelector selector = new InfoSelector("CampaignService", "mutate", Operator.ADD, range,
        new String[] {clientId}, ApiUsageType.UNIT_COUNT_FOR_CLIENTS);

    ApiUsageInfo apiUsageInfo = service.get(selector);

View Full Code Here

TOP

Related Classes of com.google.api.adwords.v201008.cm.Address

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.