Examples of CreativeSetServiceInterface


Examples of com.google.api.ads.dfp.axis.v201308.CreativeSetServiceInterface

  private static final String MASTER_CREATIVE_ID = "INSERT_MASTER_CREATIVE_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session,
      long masterCreativeId) throws Exception {
    // Get the CreativeSetService.
    CreativeSetServiceInterface creativeSetService =
        dfpServices.get(session, CreativeSetServiceInterface.class);

    // Create a statement to only select creative sets that have the
    // given master creative.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("masterCreativeId = :masterCreativeId")
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("masterCreativeId", masterCreativeId);

    // Default for total result set size.
    int totalResultSetSize = 0;

    do {
      // Get creative sets by statement.
      CreativeSetPage page =
          creativeSetService.getCreativeSetsByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (CreativeSet creativeSet : page.getResults()) {
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201308.CreativeSetServiceInterface

  public static void runExample(
      DfpServices dfpServices, DfpSession session, long creativeSetId, long companionCreativeId)
      throws Exception {
    // Get the CreativeSetService.
    CreativeSetServiceInterface creativeSetService =
        dfpServices.get(session, CreativeSetServiceInterface.class);

    // Get the creative set.
    CreativeSet creativeSet = creativeSetService.getCreativeSet(creativeSetId);

    // Add the companion creative to the creative set.
    creativeSet.setCompanionCreativeIds(
        Longs.concat(creativeSet.getCompanionCreativeIds(), new long[] {companionCreativeId}));

    // Update the creative set on the server.
    CreativeSet updatedCreativeSet = creativeSetService.updateCreativeSet(creativeSet);

    System.out.printf("A creative set with ID \"%d\", master creative ID \"%d\", "
        + "and companion creative IDs [%s] was updated.", updatedCreativeSet.getId(),
        updatedCreativeSet.getMasterCreativeId(),
        Longs.join(",", updatedCreativeSet.getCompanionCreativeIds()));
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201311.CreativeSetServiceInterface

  public static void runExample(
      DfpServices dfpServices, DfpSession session, long creativeSetId, long companionCreativeId)
      throws Exception {
    // Get the CreativeSetService.
    CreativeSetServiceInterface creativeSetService =
        dfpServices.get(session, CreativeSetServiceInterface.class);

    // Get the creative set.
    CreativeSet creativeSet = creativeSetService.getCreativeSet(creativeSetId);

    // Add the companion creative to the creative set.
    creativeSet.setCompanionCreativeIds(
        Longs.concat(creativeSet.getCompanionCreativeIds(), new long[] {companionCreativeId}));

    // Update the creative set on the server.
    CreativeSet updatedCreativeSet = creativeSetService.updateCreativeSet(creativeSet);

    System.out.printf("A creative set with ID \"%d\", master creative ID \"%d\", "
        + "and companion creative IDs [%s] was updated.", updatedCreativeSet.getId(),
        updatedCreativeSet.getMasterCreativeId(),
        Longs.join(",", updatedCreativeSet.getCompanionCreativeIds()));
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201311.CreativeSetServiceInterface

  private static final String COMPANION_CREATIVE_ID = "INSERT_COMPANION_CREATIVE_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session,
      long masterCreativeId, long companionCreativeId) throws Exception {
    // Get the CreativeSetService.
    CreativeSetServiceInterface creativeSetService =
        dfpServices.get(session, CreativeSetServiceInterface.class);

    CreativeSet creativeSet = new CreativeSet();
    creativeSet.setName("Creative set #" + new Random().nextInt(Integer.MAX_VALUE));
    creativeSet.setMasterCreativeId(masterCreativeId);
    creativeSet.setCompanionCreativeIds(new long[] {companionCreativeId});

    // Create the creative set on the server.
    CreativeSet createdCreativeSet = creativeSetService.createCreativeSet(creativeSet);

    System.out.printf("A creative set with ID \"%d\", master creative ID \"%d\", "
        + "and companion creative IDs [%s] was created.\n", createdCreativeSet.getId(),
        createdCreativeSet.getMasterCreativeId(),
        Longs.join(",", createdCreativeSet.getCompanionCreativeIds()));
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201311.CreativeSetServiceInterface

*/
public class GetAllCreativeSets {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the CreativeSetService.
    CreativeSetServiceInterface creativeSetService =
        dfpServices.get(session, CreativeSetServiceInterface.class);

    // Create a statement to get all creativeSets.
    StatementBuilder statementBuilder = new StatementBuilder()
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

    // Default for total result set size.
    int totalResultSetSize = 0;

    do {
      // Get creative sets by statement.
      CreativeSetPage page =
          creativeSetService.getCreativeSetsByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (CreativeSet creativeSet : page.getResults()) {
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201311.CreativeSetServiceInterface

  private static final String MASTER_CREATIVE_ID = "INSERT_MASTER_CREATIVE_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session,
      long masterCreativeId) throws Exception {
    // Get the CreativeSetService.
    CreativeSetServiceInterface creativeSetService =
        dfpServices.get(session, CreativeSetServiceInterface.class);

    // Create a statement to only select creative sets that have the
    // given master creative.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("masterCreativeId = :masterCreativeId")
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("masterCreativeId", masterCreativeId);

    // Default for total result set size.
    int totalResultSetSize = 0;

    do {
      // Get creative sets by statement.
      CreativeSetPage page =
          creativeSetService.getCreativeSetsByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (CreativeSet creativeSet : page.getResults()) {
View Full Code Here

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

      // Get DfpUser from "~/dfp.properties".
      DfpUser user = new DfpUser();

      // Get the CreativeSetService.
      CreativeSetServiceInterface creativeSetService =
          user.getService(DfpService.V201208.CREATIVE_SET_SERVICE);

      // Set the ID of the creative set to get and the companion creative to
      // add.
      Long creativeSetId = Long.parseLong("INSERT_CREATIVE_SET_ID_HERE");
      Long companionCreativeId = Long.parseLong("INSERT_COMPANION_CREATIVE_ID_HERE");

      // Get the creative set.
      CreativeSet creativeSet = creativeSetService.getCreativeSet(creativeSetId);

      // Add the companion creative to the creative set.
      creativeSet.setCompanionCreativeIds(ArrayUtils.add(creativeSet.getCompanionCreativeIds(),
          companionCreativeId));

      // Update the creative set on the server.
      creativeSet = creativeSetService.updateCreativeSet(creativeSet);

      // Display results.
      System.out.println("A creative set with ID \"" + creativeSet.getId()
          + "\", master creative ID \"" + creativeSet.getMasterCreativeId()
          + "\", and companion creative IDs {"
View Full Code Here

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

      // Get DfpUser from "~/dfp.properties".
      DfpUser user = new DfpUser();

      // Get the CreativeSetService.
      CreativeSetServiceInterface creativeSetService =
          user.getService(DfpService.V201208.CREATIVE_SET_SERVICE);

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

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

        // Get creative sets by statement.
        page = creativeSetService.getCreativeSetsByStatement(filterStatement);

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (CreativeSet creativeSet : page.getResults()) {
            System.out.println(i + ") Creative set with ID \"" + creativeSet.getId()
View Full Code Here

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

      // Get DfpUser from "~/dfp.properties".
      DfpUser user = new DfpUser();

      // Get the CreativeSetService.
      CreativeSetServiceInterface creativeSetService =
          user.getService(DfpService.V201208.CREATIVE_SET_SERVICE);

      // Set the ID of the creatives to associate with this set.
      Long masterCreativeId = Long.parseLong("INSERT_MASTER_CREATIVE_ID_HERE");
      Long companionCreativeId = Long.parseLong("INSERT_COMPANION_CREATIVE_ID_HERE");

      CreativeSet creativeSet = new CreativeSet();
      creativeSet.setName("Creative set #" + new Random().nextLong());
      creativeSet.setMasterCreativeId(masterCreativeId);
      creativeSet.setCompanionCreativeIds(new long[] {companionCreativeId});

      // Create the creative set on the server.
      creativeSet = creativeSetService.createCreativeSet(creativeSet);

      if (creativeSet != null) {
        System.out.println("A creative set with ID \"" + creativeSet.getId()
            + "\", master creative ID \"" + creativeSet.getMasterCreativeId()
            + "\", and companion creative IDs {"
View Full Code Here

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

      // Get DfpUser from "~/dfp.properties".
      DfpUser user = new DfpUser();

      // Get the CreativeSetService.
      CreativeSetServiceInterface creativeSetService =
          user.getService(DfpService.V201208.CREATIVE_SET_SERVICE);

      // Set the ID of the master creative to get creative sets for.
      Long masterCreativeId = Long.parseLong("INSERT_MASTER_CREATIVE_ID_HERE");

      // Create statement object to only select creative sets that have the
      // given master creative.
      Statement filterStatement =
          new StatementBuilder("WHERE masterCreativeId = :masterCreativeId LIMIT 500")
              .putValue("masterCreativeId", masterCreativeId).toStatement();

      // Get creative sets by statement.
      CreativeSetPage page = creativeSetService.getCreativeSetsByStatement(filterStatement);

      if (page.getResults() != null) {
        int i = page.getStartIndex();
        for (CreativeSet creativeSet : page.getResults()) {
          System.out.println(i + ") Creative set with ID \"" + creativeSet.getId()
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.