Package com.google.api.ads.dfp.v201208

Examples of com.google.api.ads.dfp.v201208.Statement


      UserTeamAssociationServiceInterface userTeamAssociationService =
          user.getService(DfpService.V201208.USER_TEAM_ASSOCIATION_SERVICE);

      // Set defaults for page and filterStatement.
      UserTeamAssociationPage page = new UserTeamAssociationPage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all user team associations.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get user team associations by statement.
        page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement);

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


      // Set the user to set to read only access within its teams.
      Long userId = Long.parseLong("INSERT_USER_ID_HERE");

      // Create filter text to select user team associations by the user ID.
      String statementText = "WHERE userId = :userId LIMIT 500";
      Statement filterStatement =
        new StatementBuilder("")
            .putValue("userId", userId)
            .toStatement();

      // Get user team associations by statement.
View Full Code Here

      // Get the current user.
      long currentUserId = userService.getCurrentUser().getId();

      // Create filter text to select user team associations by the user ID.
      String statementText = "WHERE userId = :userId LIMIT 500";
      Statement filterStatement =
        new StatementBuilder("")
            .putValue("userId", currentUserId)
            .toStatement();

      // Get user team associations by statement.
View Full Code Here

      // Set the user to remove from its teams.
      Long userId = Long.parseLong("INSERT_USER_ID_HERE");

      // Create filter text to select user team associations by the user ID.
      String statementText = "WHERE userId = :userId LIMIT 500";
      Statement filterStatement =
        new StatementBuilder("")
            .putValue("userId", userId)
            .toStatement();

      // Set defaults for page and offset.
      UserTeamAssociationPage page = new UserTeamAssociationPage();
      int offset = 0;

      do {
        // Create a statement to page through user team associations.
        filterStatement.setQuery(statementText + " OFFSET " + offset);

        // Get user team associations by statement.
        page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement);

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (UserTeamAssociation userTeamAssociation : page.getResults()) {
            System.out.println(i + ") User team association between user with ID \""
                + userTeamAssociation.getUserId() + "\" and team with ID \""
                + userTeamAssociation.getTeamId() + "\" will be deleted.");
            i++;
          }
        }

        offset += 500;
      } while (offset < page.getTotalResultSetSize());

      System.out.println("Number of teams that the user will be removed from: "
          + page.getTotalResultSetSize());

      if (page.getTotalResultSetSize() > 0) {
        // Modify statement for action.
        filterStatement.setQuery("WHERE userId = :userId");

        // Create action.
        DeleteUserTeamAssociations action = new DeleteUserTeamAssociations();

        // Perform action.
View Full Code Here

   * builder.
   *
   * @return the {@link Statement}
   */
  public Statement toStatement() {
    return new Statement(query,
        MapUtils.toArray(valueMap, new String_ValueMapEntry[] {}));
  }
View Full Code Here

      // Get the TeamService.
      TeamServiceInterface teamService = user.getService(DfpService.V201208.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

      SuggestedAdUnitServiceInterface suggestedAdUnitService =
          user.getService(DfpService.V201208.SUGGESTED_AD_UNIT_SERVICE);

      // Create statement to select all suggested ad units with 50 or more
      // requests.
      Statement filterStatement =
          new StatementBuilder("WHERE numRequests >= :numRequests").putValue("numRequests", 50L)
              .toStatement();

      // Get suggested ad units by statement.
      SuggestedAdUnitPage page =
View Full Code Here

      // Get the InventoryService.
      InventoryServiceInterface inventoryService =
          user.getService(DfpService.V201208.INVENTORY_SERVICE);

      // Create a statement to get all ad units.
      Statement filterStatement = new Statement("LIMIT 500", null);

      // Get ad units by statement.
      AdUnitPage page = inventoryService.getAdUnitsByStatement(filterStatement);

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

      CreativeTemplateServiceInterface creativeTemplateService =
          user.getService(DfpService.V201208.CREATIVE_TEMPLATE_SERVICE);

      // Set defaults for page and filterStatement.
      CreativeTemplatePage page = new CreativeTemplatePage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all creative templates.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get creative templates by statement.
        page = creativeTemplateService.getCreativeTemplatesByStatement(filterStatement);

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

      SuggestedAdUnitServiceInterface suggestedAdUnitService =
          user.getService(DfpService.V201208.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 =
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.v201208.Statement

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.