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

Examples of com.google.api.ads.adwords.axis.v201309.cm.DateRange


   *
   * @return the builder itself to proceed the chain.
   */
  public SelectorBuilder forDateRange(DateTime start, DateTime end) {
    if (this.dateRange == null) {
      this.dateRange = new DateRange();
    }
    DateFormat dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
    if (start != null) {
      this.dateRange.setMin(dateFormat.format(start.toDate()));
    }
View Full Code Here


    Assert.assertEquals(selector.getDateRange().getMin(), formatStart);
    Assert.assertEquals(selector.getDateRange().getMax(), formatEnd);

    String formatEndPlusOne = dateFormat.format(end.plusDays(1).toDate());

    DateRange dateRange = new DateRange();
    dateRange.setMin(formatStart);
    dateRange.setMax(formatEndPlusOne);

    selector.setDateRange(dateRange);

    Assert.assertEquals(selector.getDateRange().getMin(), formatStart);
    Assert.assertEquals(selector.getDateRange().getMax(), formatEndPlusOne);
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

  /**
   * Test getting the cost of a method.
   */
  public void testGetMethodCost() throws Exception {
    // Create selector.
    DateRange range = new DateRange(TestUtils.firstDayOfMonth(), TestUtils.today());
    InfoSelector selector = new InfoSelector("CampaignService", "mutate", Operator.ADD, range,
        null, ApiUsageType.METHOD_COST);

    ApiUsageInfo apiUsageInfo = service.get(selector);

View Full Code Here

    // Create selector.
    CampaignSelector selector = new CampaignSelector();
    long[] ids = {campaign1.getId()};
    selector.setIds(ids);
    selector.setStatsSelector(new StatsSelector(new DateRange("20090101", "20090131"), null));

    // Get all campaigns.
    CampaignPage page = campaignService.get(selector);
    Campaign testCampaign = page.getEntries()[0];
View Full Code Here

    // Create the AdGroupSelector.
    AdGroupSelector selector = new AdGroupSelector();
    selector.setAdGroupIds(new long[] {adGroupId});

    // Create the DateRange and AdGroupSelector.
    DateRange range = new DateRange(TestUtils.firstDayOfMonth(), TestUtils.today());

    selector.setStatsSelector(new StatsSelector(range, null));

    AdGroupPage page = adGroupService.get(selector);
View Full Code Here

    selector.setCriterionUse(CriterionUse.BIDDABLE);
    selector.setUserStatuses(new UserStatus[] {UserStatus.ACTIVE});

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

    AdGroupCriterionPage page = service.get(selector);

    assertNotNull(page);
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201309.cm.DateRange

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.