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

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


    // Get the creative.
    Creative creative = creativeService.getCreative(creativeId);

    // Only update the destination URL if it has one.
    if (creative instanceof HasDestinationUrlCreative) {
      HasDestinationUrlCreative hasDestinationUrlCreative = (HasDestinationUrlCreative) creative;

      // Update the destination URL of the creative.
      hasDestinationUrlCreative.setDestinationUrl("http://news.google.com");

      // Update the creative on the server.
      Creative[] creatives = creativeService.updateCreatives(new Creative[] {creative});

      for (Creative updatedCreative : creatives) {
View Full Code Here


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

    // Create an image creative.
    ImageCreative imageCreative = new ImageCreative();
    imageCreative.setName("Image creative #" + new Random().nextInt(Integer.MAX_VALUE));
    imageCreative.setAdvertiserId(advertiserId);
    imageCreative.setDestinationUrl("http://google.com");
    imageCreative.setSize(size);

    // Create image asset.
    CreativeAsset creativeAsset = new CreativeAsset();
    creativeAsset.setFileName("image.jpg");
    creativeAsset.setAssetByteArray(Media.getMediaDataFromUrl(
        "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"));
    creativeAsset.setSize(size);
    imageCreative.setPrimaryImageAsset(creativeAsset);

    // Create an image redirect creative.
    ImageRedirectCreative imageRedirectCreative = new ImageRedirectCreative();
    imageRedirectCreative.setName(
        "Image redirect creative #" + new Random().nextInt(Integer.MAX_VALUE));
View Full Code Here

        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("id", creativeId);

    // Get the creative.
    ImageCreative imageCreative = (ImageCreative) creativeService.getCreativesByStatement(
        statementBuilder.toStatement()).getResults()[0];

    // Modify existing image creative to copy it.
    imageCreative.setId(null);
    imageCreative.setName("Image creative copy #" + new Random().nextInt(Integer.MAX_VALUE));

    // Create copy of image asset.
    CreativeAsset creativeAsset = new CreativeAsset();
    creativeAsset.setFileName("image.jpg");
    creativeAsset.setAssetByteArray(Media.getMediaDataFromUrl(
        imageCreative.getPrimaryImageAsset().getAssetUrl()));
    creativeAsset.setSize(imageCreative.getPrimaryImageAsset().getSize());
    imageCreative.setPrimaryImageAsset(creativeAsset);

    // Create the creative on the server.
    Creative[] creatives =
        creativeService.createCreatives(new Creative[] {imageCreative});
View Full Code Here

        "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"));
    creativeAsset.setSize(size);
    imageCreative.setPrimaryImageAsset(creativeAsset);

    // Create an image redirect creative.
    ImageRedirectCreative imageRedirectCreative = new ImageRedirectCreative();
    imageRedirectCreative.setName(
        "Image redirect creative #" + new Random().nextInt(Integer.MAX_VALUE));
    imageRedirectCreative.setAdvertiserId(advertiserId);
    imageRedirectCreative.setDestinationUrl("http://google.com");
    imageRedirectCreative.setImageUrl(
        "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg");
    imageRedirectCreative.setSize(size);

    // Create the creatives on the server.
    Creative[] creatives =
        creativeService.createCreatives(new Creative[] {imageCreative, imageRedirectCreative});
View Full Code Here

    // Filenames must be unique.
    assetVariableValue.setFileName(
        String.format("image%s.jpg", new Random().nextInt(Integer.MAX_VALUE)));

    // Create the image width variable value.
    LongCreativeTemplateVariableValue imageWidthVariableValue =
        new LongCreativeTemplateVariableValue();
    imageWidthVariableValue.setUniqueName("Imagewidth");
    imageWidthVariableValue.setValue(300L);

    // Create the image height variable value.
    LongCreativeTemplateVariableValue imageHeightVariableValue =
        new LongCreativeTemplateVariableValue();
    imageHeightVariableValue.setUniqueName("Imageheight");
    imageHeightVariableValue.setValue(250L);

    // Create the URL variable value.
    UrlCreativeTemplateVariableValue urlVariableValue =
        new UrlCreativeTemplateVariableValue();
    urlVariableValue.setUniqueName("ClickthroughURL");
View Full Code Here

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

    // Get the current network.
    Network network = networkService.getCurrentNetwork();

    System.out.printf("Current network has network code \"%s\" and display name \"%s\".\n",
        network.getNetworkCode(), network.getDisplayName());
  }
View Full Code Here

*/
public class GetAllNetworks {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the NetworkService.
    NetworkServiceInterface networkService =
        dfpServices.get(session, NetworkServiceInterface.class);

    // Get all networks that you have access to with the current authentication
    // credentials.
    Network[] networks = networkService.getAllNetworks();

    int i = 0;
    for (Network network : networks) {
      System.out.printf(
          "%d) Network with network code \"%s\" and display name \"%s\" was found.\n",
View Full Code Here

    // Get the OrderService.
    OrderServiceInterface orderService =
        dfpServices.get(session, OrderServiceInterface.class);

    // Get the order.
    Order order = orderService.getOrder(orderId);

    // Update the order's notes.
    order.setNotes("Spoke to advertiser. All is well.");

    // Update the order on the server.
    Order[] orders = orderService.updateOrders(new Order[] {order});

    for (Order updatedOrder : orders) {
View Full Code Here

    // Get the OrderService.
    OrderServiceInterface orderService =
        dfpServices.get(session, OrderServiceInterface.class);

    // Create an order.
    Order order = new Order();
    order.setName("Order #" + new Random().nextInt(Integer.MAX_VALUE));
    order.setAdvertiserId(advertiserId);
    order.setTraffickerId(traffickerId);

    // Create the order on the server.
    Order[] orders = orderService.createOrders(new Order[] {order});

    for (Order createdOrder : orders) {
View Full Code Here

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

    do {
      // Get orders by statement.
      OrderPage page = orderService.getOrdersByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (Order order : page.getResults()) {
          System.out.printf("%d) Order with ID \"%d\" will be approved.\n", i++, order.getId());
        }
      }

      statementBuilder.increaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT);
View Full Code Here

TOP

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