Package com.google.api.adwords.v201306.cm

Examples of com.google.api.adwords.v201306.cm.Image


    // Get the MediaService.
    MediaServiceInterface mediaService =
        adWordsServices.get(session, MediaServiceInterface.class);

    // Create image.
    Image image = new Image();
    image.setData(
        com.google.api.ads.common.lib.utils.Media.getMediaDataFromUrl("http://goo.gl/HJM3L"));
    image.setType(MediaMediaType.IMAGE);

    Media[] media = new Media[] {image};

    // Upload image.
    Media[] result = mediaService.upload(media);

    // Display images.
    image = (Image) result[0];
    Map<MediaSize, Dimensions> dimensions = Maps.toMap(image.getDimensions());
    System.out.println("Image with id '" + image.getMediaId() + "', dimensions '"
        + dimensions.get(MediaSize.FULL).getWidth() + "x"
        + dimensions.get(MediaSize.FULL).getHeight() + "', and MIME type '" + image.getMediaType()
        + "' was uploaded.");
  }
View Full Code Here


    // Get the MediaService.
    MediaServiceInterface mediaService =
        adWordsServices.get(session, MediaServiceInterface.class);

    // Create image.
    Image image = new Image();
    image.setData(
        com.google.api.ads.common.lib.utils.Media.getMediaDataFromUrl("http://goo.gl/HJM3L"));
    image.setType(MediaMediaType.IMAGE);

    Media[] media = new Media[] {image};

    // Upload image.
    Media[] result = mediaService.upload(media);

    // Display images.
    image = (Image) result[0];
    Map<MediaSize, Dimensions> dimensions = Maps.toMap(image.getDimensions());
    System.out.println("Image with id '" + image.getMediaId() + "', dimensions '"
        + dimensions.get(MediaSize.FULL).getWidth() + "x"
        + dimensions.get(MediaSize.FULL).getHeight() + "', and MIME type '" + image.getMediaType()
        + "' was uploaded.");
  }
View Full Code Here

    // Get the MediaService.
    MediaServiceInterface mediaService =
        adWordsServices.get(session, MediaServiceInterface.class);

    // Create image.
    Image image = new Image();
    image.setData(
        com.google.api.ads.common.lib.utils.Media.getMediaDataFromUrl("http://goo.gl/HJM3L"));
    image.setType(MediaMediaType.IMAGE);

    Media[] media = new Media[] {image};

    // Upload image.
    Media[] result = mediaService.upload(media);

    // Display images.
    image = (Image) result[0];
    Map<MediaSize, Dimensions> dimensions = Maps.toMap(image.getDimensions());
    System.out.println("Image with id '" + image.getMediaId() + "', dimensions '"
        + dimensions.get(MediaSize.FULL).getWidth() + "x"
        + dimensions.get(MediaSize.FULL).getHeight() + "', and MIME type '" + image.getMediaType()
        + "' was uploaded.");
  }
View Full Code Here

    // Get the MediaService.
    MediaServiceInterface mediaService =
        adWordsServices.get(session, MediaServiceInterface.class);

    // Create image.
    Image image = new Image();
    image.setData(
        com.google.api.ads.common.lib.utils.Media.getMediaDataFromUrl("http://goo.gl/HJM3L"));
    image.setType(MediaMediaType.IMAGE);

    Media[] media = new Media[] {image};

    // Upload image.
    Media[] result = mediaService.upload(media);

    // Display images.
    image = (Image) result[0];
    Map<MediaSize, Dimensions> dimensions = Maps.toMap(image.getDimensions());
    System.out.println("Image with id '" + image.getMediaId() + "', dimensions '"
        + dimensions.get(MediaSize.FULL).getWidth() + "x"
        + dimensions.get(MediaSize.FULL).getHeight() + "', and MIME type '" + image.getMediaType()
        + "' was uploaded.");
  }
View Full Code Here

        }

        numAds = generator.nextInt(10) + 1;
        for (int k = 0; k < numAds; k++) {
          ImageAd ad = new ImageAd();
          Image image = new Image();
          image.setData(DataUtils.getTestImage());
          image.setName("name.jpg");
          ad.setImage(image);
          ad.setDisplayUrl("http://google.com/");
          ad.setUrl("http://example.com");
          ad.setName("name.jpg");
View Full Code Here

      // Create ad extension override.
      AdExtensionOverride adExtensionOverride = new AdExtensionOverride();
      adExtensionOverride.setAdId(adId);

      // Create ad extension using existing id.
      AdExtension adExtension = new AdExtension();
      adExtension.setId(campaignAdExtensionId);
      adExtensionOverride.setAdExtension(adExtension);

      // Create operations.
      AdExtensionOverrideOperation operation = new AdExtensionOverrideOperation();
      operation.setOperand(adExtensionOverride);
View Full Code Here

      long adId = Long.parseLong("INSERT_AD_ID_HERE");
      long campaignAdExtensionId = Long.parseLong("INSERT_CAMPAIGN_AD_EXTENSION_ID_HERE");

      // Create ad extension override.
      AdExtensionOverride adExtensionOverride = new AdExtensionOverride();
      adExtensionOverride.setAdId(adId);

      // Create ad extension using existing id.
      AdExtension adExtension = new AdExtension();
      adExtension.setId(campaignAdExtensionId);
      adExtensionOverride.setAdExtension(adExtension);

      // Create operations.
      AdExtensionOverrideOperation operation = new AdExtensionOverrideOperation();
      operation.setOperand(adExtensionOverride);
      operation.setOperator(Operator.ADD);
View Full Code Here

      AdExtension adExtension = new AdExtension();
      adExtension.setId(campaignAdExtensionId);
      adExtensionOverride.setAdExtension(adExtension);

      // Create operations.
      AdExtensionOverrideOperation operation = new AdExtensionOverrideOperation();
      operation.setOperand(adExtensionOverride);
      operation.setOperator(Operator.ADD);

      AdExtensionOverrideOperation[] operations = new AdExtensionOverrideOperation[] {operation};

      // Add ad extension override.
      AdExtensionOverrideReturnValue result = adExtensionOverrideService.mutate(operations);
View Full Code Here

      operation.setOperator(Operator.ADD);

      AdExtensionOverrideOperation[] operations = new AdExtensionOverrideOperation[] {operation};

      // Add ad extension override.
      AdExtensionOverrideReturnValue result = adExtensionOverrideService.mutate(operations);

      // Display ad extension overrides.
      if (result != null && result.getValue() != null) {
        for (AdExtensionOverride adExtensionOverrideResult : result.getValue()) {
          System.out.println("Ad extension override with ad id \""
              + adExtensionOverrideResult.getAdId() + "\" and ad extension id \""
              + adExtensionOverrideResult.getAdExtension().getId() + "\" was added.");
        }
      } else {
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the AdExtensionOverrideService.
      AdExtensionOverrideServiceInterface adExtensionOverrideService =
          user.getService(AdWordsService.V201306.AD_EXTENSION_OVERRIDE_SERVICE);

      long adId = Long.parseLong("INSERT_AD_ID_HERE");
      long campaignAdExtensionId = Long.parseLong("INSERT_CAMPAIGN_AD_EXTENSION_ID_HERE");

      // Create ad extension override.
      AdExtensionOverride adExtensionOverride = new AdExtensionOverride();
      adExtensionOverride.setAdId(adId);

      // Create ad extension using existing id.
      AdExtension adExtension = new AdExtension();
      adExtension.setId(campaignAdExtensionId);
      adExtensionOverride.setAdExtension(adExtension);

      // Create operations.
      AdExtensionOverrideOperation operation = new AdExtensionOverrideOperation();
      operation.setOperand(adExtensionOverride);
      operation.setOperator(Operator.ADD);

      AdExtensionOverrideOperation[] operations = new AdExtensionOverrideOperation[] {operation};

      // Add ad extension override.
      AdExtensionOverrideReturnValue result = adExtensionOverrideService.mutate(operations);

      // Display ad extension overrides.
      if (result != null && result.getValue() != null) {
        for (AdExtensionOverride adExtensionOverrideResult : result.getValue()) {
          System.out.println("Ad extension override with ad id \""
View Full Code Here

TOP

Related Classes of com.google.api.adwords.v201306.cm.Image

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.