Package com.google.api.ads.dfa.axis.v1_20

Examples of com.google.api.ads.dfa.axis.v1_20.UserProfile


      String url, String landingPageName) throws Exception {
    // Request the campaign service from the service client factory.
    CampaignRemote campaignService = dfaServices.get(session, CampaignRemote.class);

    // Create the campaign structure.
    Campaign campaign = new Campaign();
    campaign.setId(0);
    campaign.setName(campaignName);
    campaign.setAdvertiserId(advertiserId);

    // Create and set a default landing page.
    LandingPage defaultLandingPage = new LandingPage();
    defaultLandingPage.setId(0);
    defaultLandingPage.setName(landingPageName);
    defaultLandingPage.setUrl(url);
    campaign.setDefaultLandingPageId(campaignService.saveLandingPage(
        defaultLandingPage).getId());

    // Set the campaign start date. This example uses today's date.
    Calendar startDate = Calendar.getInstance();
    campaign.setStartDate(startDate);

    // Set the campaign end date. This example uses one month from today's date.
    Calendar endDate = Calendar.getInstance();
    endDate.add(Calendar.MONTH, 1);
    campaign.setEndDate(endDate);

    // Save the campaign.
    CampaignSaveResult campaignSaveResult = campaignService.saveCampaign(campaign);

    // Display the new campaign ID.
View Full Code Here


  public static void runExample(
      DfaServices dfaServices, DfaSession session, String campaignName, long advertiserId,
      String url, String landingPageName) throws Exception {
    // Request the campaign service from the service client factory.
    CampaignRemote campaignService = dfaServices.get(session, CampaignRemote.class);

    // Create the campaign structure.
    Campaign campaign = new Campaign();
    campaign.setId(0);
    campaign.setName(campaignName);
    campaign.setAdvertiserId(advertiserId);

    // Create and set a default landing page.
    LandingPage defaultLandingPage = new LandingPage();
    defaultLandingPage.setId(0);
    defaultLandingPage.setName(landingPageName);
    defaultLandingPage.setUrl(url);
    campaign.setDefaultLandingPageId(campaignService.saveLandingPage(
        defaultLandingPage).getId());

    // Set the campaign start date. This example uses today's date.
    Calendar startDate = Calendar.getInstance();
    campaign.setStartDate(startDate);

    // Set the campaign end date. This example uses one month from today's date.
    Calendar endDate = Calendar.getInstance();
    endDate.add(Calendar.MONTH, 1);
    campaign.setEndDate(endDate);

    // Save the campaign.
    CampaignSaveResult campaignSaveResult = campaignService.saveCampaign(campaign);

    // Display the new campaign ID.
    System.out.printf("Campaign with ID \"%s\" was created.%n", campaignSaveResult.getId());
  }
View Full Code Here

    Calendar endDate = Calendar.getInstance();
    endDate.add(Calendar.MONTH, 1);
    campaign.setEndDate(endDate);

    // Save the campaign.
    CampaignSaveResult campaignSaveResult = campaignService.saveCampaign(campaign);

    // Display the new campaign ID.
    System.out.printf("Campaign with ID \"%s\" was created.%n", campaignSaveResult.getId());
  }
View Full Code Here

      DfaServices dfaServices, DfaSession session, long advertiserId) throws Exception {
    // Request the service.
    ChangeLogRemote service = dfaServices.get(session, ChangeLogRemote.class);

    // Create change log search criteria structure.
    ChangeLogRecordSearchCriteria searchCriteria = new ChangeLogRecordSearchCriteria();
    searchCriteria.setPageSize(10);
    searchCriteria.setObjectId(advertiserId);
    // The following field has been filled in to choose advertiser change
    // logs. This values was determined using GetChangeLogObjectTypes.java.
    searchCriteria.setObjectTypeId(1L);

    // Get change log record set.
    ChangeLogRecordSet changeLogRecordSet = service.getChangeLogRecords(searchCriteria);

    // Set up a formatter to make the change log timestamps human-readable.
View Full Code Here

    // The following field has been filled in to choose advertiser change
    // logs. This values was determined using GetChangeLogObjectTypes.java.
    searchCriteria.setObjectTypeId(1L);

    // Get change log record set.
    ChangeLogRecordSet changeLogRecordSet = service.getChangeLogRecords(searchCriteria);

    // Set up a formatter to make the change log timestamps human-readable.
    SimpleDateFormat dateFormat = new SimpleDateFormat("d MMM yyyy HH:mm");

    // Display the contents of each change log record
    if (changeLogRecordSet.getRecords() != null) {
      for (ChangeLogRecord result : changeLogRecordSet.getRecords()) {
        System.out.println("Action \"" + result.getAction()
            + "\", Context \"" +  result.getContext()
            + "\", Change Date \"" + dateFormat.format(result.getChangeDate().getTime())
            + "\", New Value \"" + result.getNewValue()
            + "\", Old Value \"" + result.getOldValue()
View Full Code Here

  private static final String ADVERTISER_ID = "INSERT_ADVERTISER_ID_HERE";

  public static void runExample(
      DfaServices dfaServices, DfaSession session, long advertiserId) throws Exception {
    // Request the service.
    ChangeLogRemote service = dfaServices.get(session, ChangeLogRemote.class);

    // Create change log search criteria structure.
    ChangeLogRecordSearchCriteria searchCriteria = new ChangeLogRecordSearchCriteria();
    searchCriteria.setPageSize(10);
    searchCriteria.setObjectId(advertiserId);
    // The following field has been filled in to choose advertiser change
    // logs. This values was determined using GetChangeLogObjectTypes.java.
    searchCriteria.setObjectTypeId(1L);

    // Get change log record set.
    ChangeLogRecordSet changeLogRecordSet = service.getChangeLogRecords(searchCriteria);

    // Set up a formatter to make the change log timestamps human-readable.
    SimpleDateFormat dateFormat = new SimpleDateFormat("d MMM yyyy HH:mm");

    // Display the contents of each change log record
View Full Code Here

*/
public class GetChangeLogObjectTypes {

  public static void runExample(DfaServices dfaServices, DfaSession session) throws Exception {
    // Request the service.
    ChangeLogRemote service = dfaServices.get(session, ChangeLogRemote.class);

    // Get change log object types
    ChangeLogObjectType[] changeLogObjects = service.getChangeLogObjectTypes();

    // Display change log object type names and IDs.
    for (ChangeLogObjectType result : changeLogObjects) {
      System.out.println("Change Log Object type with name \"" + result.getName()
          + "\" and ID \"" + result.getId() + ("\" was found."));
View Full Code Here

  public static void runExample(DfaServices dfaServices, DfaSession session) throws Exception {
    // Request the service.
    SpotlightRemote service = dfaServices.get(session, SpotlightRemote.class);

    // Set search criteria.
    CountrySearchCriteria countrySearchCriteria = new CountrySearchCriteria ();
    countrySearchCriteria.setSecure(false);

    // Get countries.
    Country[] countries = service.getCountriesByCriteria(countrySearchCriteria);

    // Display country names, codes and secure server support information.
View Full Code Here

      long creativeId) throws Exception {
    // Request the creative service from the service client factory.
    CreativeRemote creativeService = dfaServices.get(session, CreativeRemote.class);

    // Create the In-Stream video creative asset.
    CreativeAsset inStreamVideoAsset = new CreativeAsset();
    inStreamVideoAsset.setName(assetName);
    inStreamVideoAsset.setContent(Media.getMediaDataFromFile(pathToFile));

    // Create an upload request to make this asset a media file for an existing
    // In-Stream creative.
    InStreamAssetUploadRequest inStreamAssetUploadRequest = new InStreamAssetUploadRequest();
    inStreamAssetUploadRequest.setMediaFile(true);
View Full Code Here

      long advertiserId) throws Exception {
    // Request the service.
    CreativeRemote service = dfaServices.get(session, CreativeRemote.class);

    // Create the HTML asset.
    CreativeAsset swfAsset = new CreativeAsset();
    swfAsset.setForHTMLCreatives(true);
    swfAsset.setName(assetName);
    swfAsset.setContent(Media.getMediaDataFromFile(pathToFile));
    swfAsset.setAdvertiserId(advertiserId);

    // Save the asset.
    CreativeAssetSaveResult creativeAssetSaveResult = service.saveCreativeAsset(swfAsset);

    // Display the new asset file name.
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfa.axis.v1_20.UserProfile

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.