Examples of ThirdPartySlotPage


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

            .putValue("status", ThirdPartySlotStatus.ACTIVE.toString())
            .putValue("companyId", companyId)
            .toStatement();

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

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

        // Get third party slots by statement.
        page = thirdpartySlotService.getThirdPartySlotsByStatement(filterStatement);

        if (page.getResults() != null) {
          for (ThirdPartySlot thirdPartySlot : page.getResults()) {
            System.out.println("Third party slot with ID \"" + thirdPartySlot.getId()
                + "\" will be archived.");
            thirdPartySlotIds.add(thirdPartySlot.getId());
          }
        }

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

      System.out.println("Number of third party slots to be archived: "
          + thirdPartySlotIds.size());

      if (thirdPartySlotIds.size() > 0) {
View Full Code Here

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

      // Get the ThirdPartySlotService.
      ThirdPartySlotServiceInterface thirdPartySlotService =
          user.getService(DfpService.V201208.THIRD_PARTY_SLOT_SERVICE);

      // Sets defaults for page and filterStatement.
      ThirdPartySlotPage page = new ThirdPartySlotPage();
      Statement filterStatement =
          new StatementBuilder("WHERE status = :status LIMIT 500 ").putValue("status",
              ThirdPartySlotStatus.ARCHIVED.toString()).toStatement();

      // Get third party slots by statement.
      page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement);

      if (page.getResults() != null) {
        int i = page.getStartIndex();
        for (ThirdPartySlot thirdPartySlot : page.getResults()) {
          System.out.println(i + ") Third party slot with ID \"" + thirdPartySlot.getId()
              + "\" was found.");
          i++;
        }
      }

      System.out.println("Number of results found: " + page.getTotalResultSetSize());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

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

      // Get the ThirdPartySlotService.
      ThirdPartySlotServiceInterface thirdPartySlotService =
          user.getService(DfpService.V201208.THIRD_PARTY_SLOT_SERVICE);

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

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

        // Get third party slots by statement.
        page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement);

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (ThirdPartySlot thirdPartySlot : page.getResults()) {
            System.out.println(i + ") Third party slot with ID \""
                + thirdPartySlot.getId() + "\" was found.");
            i++;
          }
        }

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

      System.out.println("Number of results found: " + page.getTotalResultSetSize());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

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

      Statement filterStatement =
          new StatementBuilder("WHERE status = :status LIMIT 1")
              .putValue("status", ThirdPartySlotStatus.ACTIVE.toString()).toStatement();

      // Get third party slot by statement.
      ThirdPartySlotPage page =
          thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement);
     
      if (page.getResults() != null) {
        ThirdPartySlot[] thirdPartySlots = page.getResults();

        // Update each local third party slot by changing its description.
        for (ThirdPartySlot thirdPartySlot : thirdPartySlots) {
          thirdPartySlot.setDescription("Updated description");
         
View Full Code Here

Examples of com.google.api.ads.dfp.v201211.ThirdPartySlotPage

            .putValue("status", ThirdPartySlotStatus.ACTIVE.toString())
            .putValue("companyId", companyId)
            .toStatement();

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

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

        // Get third party slots by statement.
        page = thirdpartySlotService.getThirdPartySlotsByStatement(filterStatement);

        if (page.getResults() != null) {
          for (ThirdPartySlot thirdPartySlot : page.getResults()) {
            System.out.println("Third party slot with ID \"" + thirdPartySlot.getId()
                + "\" will be archived.");
            thirdPartySlotIds.add(thirdPartySlot.getId());
          }
        }

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

      System.out.println("Number of third party slots to be archived: "
          + thirdPartySlotIds.size());

      if (thirdPartySlotIds.size() > 0) {
View Full Code Here

Examples of com.google.api.ads.dfp.v201211.ThirdPartySlotPage

      // Get the ThirdPartySlotService.
      ThirdPartySlotServiceInterface thirdPartySlotService =
          user.getService(DfpService.V201211.THIRD_PARTY_SLOT_SERVICE);

      // Sets defaults for page and filterStatement.
      ThirdPartySlotPage page = new ThirdPartySlotPage();
      Statement filterStatement =
          new StatementBuilder("WHERE status = :status LIMIT 500 ").putValue("status",
              ThirdPartySlotStatus.ARCHIVED.toString()).toStatement();

      // Get third party slots by statement.
      page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement);

      if (page.getResults() != null) {
        int i = page.getStartIndex();
        for (ThirdPartySlot thirdPartySlot : page.getResults()) {
          System.out.println(i + ") Third party slot with ID \"" + thirdPartySlot.getId()
              + "\" was found.");
          i++;
        }
      }

      System.out.println("Number of results found: " + page.getTotalResultSetSize());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of com.google.api.ads.dfp.v201211.ThirdPartySlotPage

      // Get the ThirdPartySlotService.
      ThirdPartySlotServiceInterface thirdPartySlotService =
          user.getService(DfpService.V201211.THIRD_PARTY_SLOT_SERVICE);

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

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

        // Get third party slots by statement.
        page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement);

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (ThirdPartySlot thirdPartySlot : page.getResults()) {
            System.out.println(i + ") Third party slot with ID \""
                + thirdPartySlot.getId() + "\" was found.");
            i++;
          }
        }

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

      System.out.println("Number of results found: " + page.getTotalResultSetSize());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of com.google.api.ads.dfp.v201211.ThirdPartySlotPage

      Statement filterStatement =
          new StatementBuilder("WHERE status = :status LIMIT 1")
              .putValue("status", ThirdPartySlotStatus.ACTIVE.toString()).toStatement();

      // Get third party slot by statement.
      ThirdPartySlotPage page =
          thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement);
     
      if (page.getResults() != null) {
        ThirdPartySlot[] thirdPartySlots = page.getResults();

        // Update each local third party slot by changing its description.
        for (ThirdPartySlot thirdPartySlot : thirdPartySlots) {
          thirdPartySlot.setDescription("Updated description");
         
View Full Code Here

Examples of com.google.api.ads.dfp.v201302.ThirdPartySlotPage

      // Get the ThirdPartySlotService.
      ThirdPartySlotServiceInterface thirdPartySlotService =
          user.getService(DfpService.V201302.THIRD_PARTY_SLOT_SERVICE);

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

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

        // Get third party slots by statement.
        page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement);

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (ThirdPartySlot thirdPartySlot : page.getResults()) {
            System.out.println(i + ") Third party slot with ID \""
                + thirdPartySlot.getId() + "\" was found.");
            i++;
          }
        }

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

      System.out.println("Number of results found: " + page.getTotalResultSetSize());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of com.google.api.ads.dfp.v201302.ThirdPartySlotPage

      Statement filterStatement =
          new StatementBuilder("WHERE status = :status LIMIT 1")
              .putValue("status", ThirdPartySlotStatus.ACTIVE.toString()).toStatement();

      // Get third party slot by statement.
      ThirdPartySlotPage page =
          thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement);
     
      if (page.getResults() != null) {
        ThirdPartySlot[] thirdPartySlots = page.getResults();

        // Update each local third party slot by changing its description.
        for (ThirdPartySlot thirdPartySlot : thirdPartySlots) {
          thirdPartySlot.setDescription("Updated description");
         
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.