Package com.google.api.ads.dfp.axis.v201211

Examples of com.google.api.ads.dfp.axis.v201211.Date


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

    do {
      // Get creative wrappers by statement.
      CreativeWrapperPage page =
          creativeWrapperService.getCreativeWrappersByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (CreativeWrapper creativeWrapper : page.getResults()) {
          System.out.printf(
              "%d) Creative wrapper with ID \"%d\" applying to label \"%s\" was found.\n", i++,
              creativeWrapper.getId(), creativeWrapper.getLabelId());         
        }
      }
View Full Code Here


  static final String CREATIVE_WRAPPER_ID = "INSERT_CREATIVE_WRAPPER_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session, Long creativeWrapperId)
      throws Exception {
    // Get the CreativeWrapperService.
    CreativeWrapperServiceInterface creativeWrapperService =
        dfpServices.get(session, CreativeWrapperServiceInterface.class);

    // Get the creative wrapper.
    CreativeWrapper creativeWrapper = creativeWrapperService.getCreativeWrapper(creativeWrapperId);

    creativeWrapper.setOrdering(CreativeWrapperOrdering.OUTER);
   
    // Update the creative wrappers on the server.
    CreativeWrapper[] creativeWrappers =
        creativeWrapperService.updateCreativeWrappers(new CreativeWrapper[] {creativeWrapper});

    for (CreativeWrapper updatedCreativeWrapper : creativeWrappers) {     
      System.out.printf(
          "Creative wrapper with ID \"%d\" and wrapping order \"%s\" was updated.\n",
          updatedCreativeWrapper.getId(), updatedCreativeWrapper.getOrdering());
View Full Code Here

public class GetActiveCreativeWrappers {

  public static void runExample(DfpServices dfpServices, DfpSession session)
      throws Exception {   
    // Get the CreativeWrapperService.
    CreativeWrapperServiceInterface creativeWrapperService =
        dfpServices.get(session, CreativeWrapperServiceInterface.class);

    // Create a statement to only select the active creative wrappers.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("WHERE status = :status")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("status", CreativeWrapperStatus.ACTIVE.toString());

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

    do {
      // Get creative wrappers by statement.
      CreativeWrapperPage page =
          creativeWrapperService.getCreativeWrappersByStatement(statementBuilder.toStatement());

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

  private static final String LABEL_ID = "INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE";
 
  public static void runExample(DfpServices dfpServices, DfpSession session, long labelId)
      throws Exception {
    // Get the CreativeWrapperService.
    CreativeWrapperServiceInterface creativeWrapperService =
        dfpServices.get(session, CreativeWrapperServiceInterface.class);

    // Create a creative wrapper.
    CreativeWrapper innerCreativeWrapper = new CreativeWrapper();
    // A label can only be associated with one creative wrapper.
    innerCreativeWrapper.setLabelId(labelId);
    innerCreativeWrapper.setOrdering(CreativeWrapperOrdering.INNER);
    innerCreativeWrapper.setHeader(
        new CreativeWrapperHtmlSnippet("<b>My creative wrapper header</b>"));
    innerCreativeWrapper.setFooter(
        new CreativeWrapperHtmlSnippet("<b>My creative wrapper footer</b>"));

    // Create the creative wrappers on the server.
    CreativeWrapper[] creativeWrappers =
        creativeWrapperService.createCreativeWrappers(new CreativeWrapper[] {innerCreativeWrapper});

    for (CreativeWrapper creativeWrapper : creativeWrappers) {
      System.out.printf(
          "Creative wrapper with ID \"%d\" applying to label \"%s\" was created.\n",
          creativeWrapper.getId(), creativeWrapper.getLabelId());
View Full Code Here

private static final String LABEL_ID = "INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE";
 
  public static void runExample(DfpServices dfpServices, DfpSession session, long labelId)
      throws Exception {
    // Get the CreativeWrapperService.
    CreativeWrapperServiceInterface creativeWrapperService =
        dfpServices.get(session, CreativeWrapperServiceInterface.class);

    // Create a statement to select the active creative wrappers for the
    // given label.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("WHERE status = :status AND labelId = :labelId")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("status", CreativeWrapperStatus.ACTIVE.toString())       
        .withBindVariableValue("labelId", labelId);
   
    // Default for total result set size.
    int totalResultSetSize = 0;
    List<Long> creativeWrapperIds = new ArrayList<Long>();

    do {
      // Get creative wrappers by statement.
      CreativeWrapperPage page =
          creativeWrapperService.getCreativeWrappersByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (CreativeWrapper creativeWrapper : page.getResults()) {
          System.out.printf("%d) Creative wrapper with ID \"%d\" applying to label"
              + " \"%s\" will be deactivated.\n", i++, creativeWrapper.getId(),
              creativeWrapper.getLabelId());
          creativeWrapperIds.add(creativeWrapper.getId());
        }
      }

      statementBuilder.increaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT);
    } while (statementBuilder.getOffset() < totalResultSetSize);
   
    System.out.printf("Number of creative wrappers to be deactivated: %s\n", totalResultSetSize);

    if (!creativeWrapperIds.isEmpty()) {
      // Remove limit and offset from statement.
      statementBuilder.removeLimitAndOffset();

      // Create action.
      com.google.api.ads.dfp.axis.v201211.DeactivateCreativeWrappers action =
          new com.google.api.ads.dfp.axis.v201211.DeactivateCreativeWrappers();

      // Perform action.
      UpdateResult result = creativeWrapperService.performCreativeWrapperAction(
          action, statementBuilder.toStatement());

      if (result != null && result.getNumChanges() > 0) {
        System.out.println("Number of creative wrappers deactivated: " + result.getNumChanges());
      } else {
View Full Code Here

public class GetAllCreativeWrappers {

  public static void runExample(DfpServices dfpServices, DfpSession session)
      throws Exception {   
    // Get the CreativeWrapperService.
    CreativeWrapperServiceInterface creativeWrapperService =
        dfpServices.get(session, CreativeWrapperServiceInterface.class);

    // Create a statement to select all creative wrappers.
    StatementBuilder statementBuilder = new StatementBuilder()
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

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

    do {
      // Get creative wrappers by statement.
      CreativeWrapperPage page =
          creativeWrapperService.getCreativeWrappersByStatement(statementBuilder.toStatement());

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

    numberValue3 = new NumberValue();
    numberValue3.setValue("-1");

    dateTime1 = new DateTime();
    Date date1 = new Date();
    date1.setYear(2012);
    date1.setMonth(12);
    date1.setDay(2);
    dateTime1.setDate(date1);
    dateTime1.setHour(12);
    dateTime1.setMinute(45);
    dateTime1.setSecond(0);
    dateTime1.setTimeZoneID(TIME_ZONE_ID1);
View Full Code Here

    numberValue2.setValue("1.02");

    numberValue3 = new NumberValue();
    numberValue3.setValue("-1");

    dateTime1 = new DateTime();
    Date date1 = new Date();
    date1.setYear(2012);
    date1.setMonth(12);
    date1.setDay(2);
    dateTime1.setDate(date1);
View Full Code Here

      } else if (value instanceof String) {
        TextValue textValue = new TextValue();
        textValue.setValue((String) value);
        return textValue;
      } else if (value instanceof DateTime) {
        DateTimeValue dateTimeValue = new DateTimeValue();
        dateTimeValue.setValue((DateTime) value);
        return dateTimeValue;
      } else {
        throw new IllegalArgumentException("Unsupported Value type [" + value.getClass() + "]");
      }
    }
View Full Code Here

    dateTime1.setHour(12);
    dateTime1.setMinute(45);
    dateTime1.setSecond(0);
    dateTime1.setTimeZoneID(TIME_ZONE_ID1);

    dateTimeValue1 = new DateTimeValue();
    dateTimeValue1.setValue(dateTime1);
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.axis.v201211.Date

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.