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

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


    customCriteriaSet.setChildren(new CustomCriteriaNode[] {contentCustomCriteria});

    // Create inventory targeting.
    InventoryTargeting inventoryTargeting = new InventoryTargeting();
    inventoryTargeting.setTargetedAdUnits(
        new AdUnitTargeting[] {new AdUnitTargeting(targetedVideoAdUnitId, true)});

    // Create video position targeting.
    VideoPosition videoPosition = new VideoPosition();
    videoPosition.setPositionType(VideoPositionType.PREROLL);
    VideoPositionTarget videoPositionTarget = new VideoPositionTarget();
View Full Code Here


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

    do {
      // Get audience segments by statement.
      AudienceSegmentPage page =
          audienceSegmentService.getAudienceSegmentsByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (AudienceSegment audienceSegment : page.getResults()) {
          System.out.printf(
              "%d) Audience segment with ID \"%d\" and name \"%s\" was found.\n", i++,
              audienceSegment.getId(), audienceSegment.getName());
        }
      }
View Full Code Here

*/
public class GetAllAudienceSegments {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the AudienceSegmentService.
    AudienceSegmentServiceInterface audienceSegmentService =
        dfpServices.get(session, AudienceSegmentServiceInterface.class);

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

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

    do {
      // Get audience segments by statement.
      AudienceSegmentPage page =
          audienceSegmentService.getAudienceSegmentsByStatement(statementBuilder.toStatement());

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

      return (Value) value;
    } else if (value == null) {
      return new TextValue();
    } else {
      if (value instanceof Boolean) {
        BooleanValue booleanValue = new BooleanValue();
        booleanValue.setValue((Boolean) value);
        return booleanValue;
      } else if (value instanceof Double || value instanceof Long || value instanceof Integer) {
        NumberValue numberValue = new NumberValue();
        numberValue.setValue(value.toString());
        return numberValue;
View Full Code Here

    size.setWidth(300);
    size.setHeight(250);
    size.setIsAspectRatio(false);

    // Create the creative placeholder.
    CreativePlaceholder creativePlaceholder = new CreativePlaceholder();
    creativePlaceholder.setSize(size);

    // Set the size of creatives that can be associated with this line item.
    lineItem.setCreativePlaceholders(new CreativePlaceholder[] {creativePlaceholder});

    // Set the length of the line item to run.
View Full Code Here

    // Set the creative rotation type to optimized.
    lineItem.setCreativeRotationType(CreativeRotationType.OPTIMIZED);

    // Create the master creative placeholder.
    CreativePlaceholder creativeMasterPlaceholder = new CreativePlaceholder();
    creativeMasterPlaceholder.setSize(new Size(640, 360, false));

    // Create companion creative placeholders.
    CreativePlaceholder companionCreativePlaceholder = new CreativePlaceholder();
    companionCreativePlaceholder.setSize(new Size(300, 250, false));

    // Set companion creative placeholders.
    creativeMasterPlaceholder.setCompanions(
        new CreativePlaceholder[] {companionCreativePlaceholder});
View Full Code Here

    // 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

  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

*/
public class GetSystemDefinedCreativeTemplates {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the CreativeTemplateService.
    CreativeTemplateServiceInterface creativeTemplateService =
        dfpServices.get(session, CreativeTemplateServiceInterface.class);

    // Create a statement to select only system defined creative templates.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("type = :type")
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("type", CreativeTemplateType.SYSTEM_DEFINED.toString());

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

    do {
      // Get creative templates by statement.
      CreativeTemplatePage page =
          creativeTemplateService.getCreativeTemplatesByStatement(statementBuilder.toStatement());

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

    // Get the LineItemService.
    LineItemServiceInterface lineItemService =
        dfpServices.get(session, LineItemServiceInterface.class);

    // Create custom criteria for the content metadata targeting.
    CustomCriteria contentCustomCriteria = new CustomCriteria();
    contentCustomCriteria.setKeyId(contentCustomTargetingKeyId);
    contentCustomCriteria.setValueIds(new long[] {contentCustomTargetingValueId});
    contentCustomCriteria.setOperator(CustomCriteriaComparisonOperator.IS);

    // Create custom criteria set.
    CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet();
    customCriteriaSet.setChildren(new CustomCriteriaNode[] {contentCustomCriteria});
View Full Code Here

TOP

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