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

Examples of com.google.api.ads.dfp.v201306.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

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

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

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

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

        // Get suggested ad units by statement.
        page = suggestedAdUnitService.getSuggestedAdUnitsByStatement(filterStatement);

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

      // Get UserService.
      UserServiceInterface userService =
          user.getService(DfpService.V201306.USER_SERVICE);

      // Create a statement to get all users sorted by name.
      Statement filterStatement = new Statement("ORDER BY name LIMIT 500", null);

      // Get users by statement.
      UserPage page = userService.getUsersByStatement(filterStatement);

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

      // Get the LabelService.
      LabelServiceInterface labelService = user.getService(DfpService.V201306.LABEL_SERVICE);

      // Create statement text to select active labels.
      String statementText = "WHERE isActive = :isActive LIMIT 500";
      Statement filterStatement =
          new StatementBuilder("").putValue("isActive", true).toStatement();

      // Set defaults for page and offset.
      LabelPage page = new LabelPage();
      int offset = 0;
      List<Long> labelIds = new ArrayList<Long>();

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

        // Get labels by statement.
        page = labelService.getLabelsByStatement(filterStatement);

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (Label label : page.getResults()) {
            System.out.println(i + ") Label with ID \"" + label.getId()
                + "\" and name \"" + label.getName()
                + "\" will be deactivated.");
            labelIds.add(label.getId());
            i++;
          }
        }

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

      System.out.println("Number of labels to be deactivated: " + labelIds.size());

      if (labelIds.size() > 0) {
        // Modify statement for action.
        filterStatement.setQuery("WHERE id IN (" + StringUtils.join(labelIds, ",") + ")");

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

        // Perform action.
View Full Code Here

      UserTeamAssociationServiceInterface userTeamAssociationService =
          user.getService(DfpService.V201306.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

      CreativeTemplateServiceInterface creativeTemplateService =
          user.getService(DfpService.V201306.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

      // 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 LabelService.
      LabelServiceInterface labelService = user.getService(DfpService.V201306.LABEL_SERVICE);

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

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

        // Get labels by statement.
        page = labelService.getLabelsByStatement(filterStatement);

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

TOP

Related Classes of com.google.api.ads.dfp.v201306.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.