Package com.google.api.ads.dfp.lib.utils.v201306

Examples of com.google.api.ads.dfp.lib.utils.v201306.ReportUtils


          user.getService(DfpService.V201306.SUGGESTED_AD_UNIT_SERVICE);

      // Create a statement to only select suggested ad units that have more
      // than 50 requests.
      Statement filterStatement =
          new StatementBuilder("WHERE numRequests > :numRequests LIMIT 500")
              .putValue("numRequests", 50).toStatement();

      // Get suggested ad units by statement.
      SuggestedAdUnitPage page =
          suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement);
View Full Code Here


      // Create statement to select only custom fields that apply to line items.
      String statementText =
          "WHERE entityType = :entityType LIMIT 500";
      Statement filterStatement =
          new StatementBuilder(statementText)
              .putValue("entityType", CustomFieldEntityType.LINE_ITEM.toString())
              .toStatement();

      // Set defaults for page and offset.
      CustomFieldPage page = new CustomFieldPage();
View Full Code Here

      // Create statement text to select the active creative wrappers for the
      // given label.
      String statementText =
          "WHERE status = :status AND labelId = :labelId LIMIT 500";
      Statement filterStatement =
          new StatementBuilder(statementText)
              .putValue("status", CreativeWrapperStatus.ACTIVE.toString())
              .putValue("labelId", labelId)
              .toStatement();

      // Set defaults for page and offset.
View Full Code Here

      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
View Full Code Here

      // Get the TeamService.
      TeamServiceInterface teamService = user.getService(DfpService.V201306.TEAM_SERVICE);

      // Create a statement to order teams by name.
      Statement filterStatement =
          new StatementBuilder("ORDER BY name LIMIT 500")
              .toStatement();

      // Get teams by statement.
      TeamPage page = teamService.getTeamsByStatement(filterStatement);
View Full Code Here

          user.getService(DfpService.V201306.CREATIVE_WRAPPER_SERVICE);

      // Create a statement to select only active creative wrappers.
      String statementText = "WHERE status = :status LIMIT 500";
      Statement filterStatement =
          new StatementBuilder(statementText)
              .putValue("status", CreativeWrapperStatus.ACTIVE.toString()).toStatement();

      // Set defaults for page and offset.
      CreativeWrapperPage page = new CreativeWrapperPage();
      int offset = 0;
View Full Code Here

      // Set the line item to get LICAs by.
      Long lineItemId = Long.parseLong("INSERT_LINE_ITEM_ID_HERE");

      // Create a statement to only select LICAs for the given lineItem ID.
      Statement filterStatement =
          new StatementBuilder("WHERE lineItemId = :lineItemId LIMIT 500")
              .putValue("lineItemId", lineItemId).toStatement();

      // Get LICAs by statement.
      LineItemCreativeAssociationPage page =
         licaService.getLineItemCreativeAssociationsByStatement(filterStatement);
View Full Code Here

      // Get the CustomTargetingService.
      CustomTargetingServiceInterface customTargetingService =
          user.getService(DfpService.V201306.CUSTOM_TARGETING_SERVICE);

      // Create a statement to only select predefined custom targeting keys.
      Statement filterStatement = new StatementBuilder("WHERE type = :type LIMIT 500").putValue(
          "type", CustomTargetingKeyType.PREDEFINED.toString()).toStatement();

      // Get custom targeting keys by statement.
      CustomTargetingKeyPage page =
          customTargetingService.getCustomTargetingKeysByStatement(filterStatement);
View Full Code Here

          user.getService(DfpService.V201306.CREATIVE_SERVICE);

      Long[] imageCreativeIds = new Long[] {Long.parseLong("INSERT_IMAGE_CREATIVE_ID_HERE")};

      // Create the statement to filter image creatives by id.
      StatementBuilder statementBuilder =
          new StatementBuilder("WHERE id IN ( " + StringUtils.join(imageCreativeIds, ',')
              + ") and creativeType = :creativeType LIMIT 500").putValue("creativeType",
              ImageCreative.class.getSimpleName());

      // Retrieve all creatives which match.
      CreativePage page =
          creativeService.getCreativesByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        Creative[] creatives = page.getResults();
        long[] oldIds = new long[creatives.length];
        for (int i = 0; i < creatives.length; i++) {
View Full Code Here

      // Set the ID of the ad unit to add to the teams.
      String adUnitId = "INSERT_AD_UNIT_ID_HERE";

      // Create a statement to select first 5 teams that aren't built-in.
      Statement filterStatement = new StatementBuilder("WHERE id > 0 LIMIT 5").toStatement();

      // Get the teams by statement.
      TeamPage page = teamService.getTeamsByStatement(filterStatement);

      if (page.getResults() != null) {
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.lib.utils.v201306.ReportUtils

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.