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

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


    AdUnitSize adUnitSize = new AdUnitSize();
    adUnitSize.setSize(size);
    adUnitSize.setEnvironmentType(EnvironmentType.BROWSER);

    // Create a web ad unit.
    AdUnit webAdUnit = new AdUnit();
    webAdUnit.setName("Web_ad_unit_" + new Random().nextLong());
    webAdUnit.setDescription(webAdUnit.getName());
    webAdUnit.setTargetPlatform(TargetPlatform.WEB);
    webAdUnit.setParentId(parentId);
    webAdUnit.setTargetWindow(AdUnitTargetWindow.BLANK);
    webAdUnit.setAdUnitSizes(new AdUnitSize[]{adUnitSize});

    // Create a mobile ad unit.
    AdUnit mobileAdUnit = new AdUnit();
    mobileAdUnit.setName("Mobile_ad_unit_" + new Random().nextLong());
    mobileAdUnit.setDescription(webAdUnit.getName());
    mobileAdUnit.setTargetPlatform(TargetPlatform.MOBILE);
    mobileAdUnit.setParentId(parentId);
    mobileAdUnit.setTargetWindow(AdUnitTargetWindow.BLANK);
    mobileAdUnit.setMobilePlatform(MobilePlatform.APPLICATION);
    mobileAdUnit.setAdUnitSizes(new AdUnitSize[]{adUnitSize});

    // Create the ad units on the server.
    AdUnit[] adUnits = inventoryService.createAdUnits(new AdUnit[] {webAdUnit, mobileAdUnit});

    for (AdUnit adUnit : adUnits) {
View Full Code Here


    // Get the InventoryService.
    InventoryServiceInterface inventoryService =
        dfpServices.get(session, InventoryServiceInterface.class);

    // Get the ad unit.
    AdUnit adUnit = inventoryService.getAdUnit(adUnitId);

    // Add the size 468x60 to the ad unit.
    List<AdUnitSize> adUnitSizes = Lists.<AdUnitSize>newArrayList(adUnit.getAdUnitSizes());

    Size size = new Size();
    size.setWidth(468);
    size.setHeight(60);

    AdUnitSize adUnitSize = new AdUnitSize();
    adUnitSize.setSize(size);
    adUnitSize.setEnvironmentType(EnvironmentType.BROWSER);
    adUnitSizes.add(adUnitSize);

    adUnit.setAdUnitSizes(adUnitSizes.toArray(new AdUnitSize[] {}));

    // Update the ad units on the server.
    AdUnit[] adUnits = inventoryService.updateAdUnits(new AdUnit[] {adUnit});

    for (AdUnit updatedAdUnit : adUnits) {
View Full Code Here

    // Get the NetworkService.
    NetworkServiceInterface networkService =
        dfpServices.get(session, NetworkServiceInterface.class);

    // Get the effective root ad unit.
    AdUnit effectiveRootAdUnit =
        inventoryService.getAdUnit(
            networkService.getCurrentNetwork().getEffectiveRootAdUnitId());

    buildAndDisplayAdUnitTree(effectiveRootAdUnit, adUnits);
  }
View Full Code Here

    int totalResultSetSize = 0;
    List<String> adUnitIds = new ArrayList<String>();

    do {
      // Get ad units by statement.
      AdUnitPage page = inventoryService.getAdUnitsByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (AdUnit adUnit : page.getResults()) {
          System.out.printf(
              "%s) Ad unit with ID \"%s\" and name \"%s\" will be archived.\n", i,
              adUnit.getId(), adUnit.getName());
          adUnitIds.add(adUnit.getId());
          i++;
View Full Code Here

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

    do {
      // Get ad units by statement.
      AdUnitPage page = inventoryService.getAdUnitsByStatement(statementBuilder.toStatement());

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

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

    do {
      // Get ad units by statement.
      AdUnitPage page = inventoryService.getAdUnitsByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (AdUnit adUnit : page.getResults()) {
          System.out.printf(
              "%s) Ad unit with ID \"%s\" and name \"%s\" was found.\n", i,
              adUnit.getId(), adUnit.getName());
          i++;
        }
        Collections.addAll(adUnits, page.getResults());
      }

      statementBuilder.increaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT);
    } while (statementBuilder.getOffset() < totalResultSetSize);
View Full Code Here

    Size size = new Size();
    size.setWidth(300);
    size.setHeight(250);
    size.setIsAspectRatio(false);

    AdUnitSize adUnitSize = new AdUnitSize();
    adUnitSize.setSize(size);
    adUnitSize.setEnvironmentType(EnvironmentType.BROWSER);

    // Create a web ad unit.
    AdUnit webAdUnit = new AdUnit();
    webAdUnit.setName("Web_ad_unit_" + new Random().nextLong());
    webAdUnit.setDescription(webAdUnit.getName());
View Full Code Here

    Size size = new Size();
    size.setWidth(468);
    size.setHeight(60);

    AdUnitSize adUnitSize = new AdUnitSize();
    adUnitSize.setSize(size);
    adUnitSize.setEnvironmentType(EnvironmentType.BROWSER);
    adUnitSizes.add(adUnitSize);

    adUnit.setAdUnitSizes(adUnitSizes.toArray(new AdUnitSize[] {}));

    // Update the ad units on the server.
View Full Code Here

    AdUnitSize[] adUnitSizes =
        inventoryService.getAdUnitSizesByStatement(statementBuilder.toStatement());

    if (adUnitSizes != null) {
      for (int i = 0; i < adUnitSizes.length; i++) {
        AdUnitSize adUnitSize = adUnitSizes[i];
        System.out.printf("%s) Web ad unit size of dimensions %s was found.\n", i,
            adUnitSize.getFullDisplayString());
      }
    } else {
      System.out.println("No ad unit sizes found.");
    }
  }
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

TOP

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