public static void runExample(
      AdWordsServicesInterface adWordsServices,
      AdWordsSession session,
      Long budgetId,
      Long merchantId)
      throws IOException {
    Campaign campaign = createCampaign(adWordsServices, session, budgetId, merchantId);
    System.out.printf(
        "Campaign with name '%s' and ID %d was added.%n", campaign.getName(), campaign.getId());

    AdGroup adGroup = createAdGroup(adWordsServices, session, campaign);
    System.out.printf(
        "Ad group with name '%s' and ID %d was added.%n", adGroup.getName(), adGroup.getId());

    AdGroupAd adGroupAd = createShowcaseAd(adWordsServices, session, adGroup);
    System.out.printf("Showcase ad with ID %d was added.%n", adGroupAd.getAd().getId());

    ProductPartitionTree partitionTree =
        createProductPartitions(adWordsServices, session, adGroup.getId());
    System.out.printf("Final tree: %s%n", partitionTree);
  }
public static void runExample ( AdWordsServicesInterface adWordsServices , AdWordsSession session , Long budgetId , Long merchantId ) throws IOException { Campaign campaign = createCampaign ( adWordsServices , session , budgetId , merchantId ) ; System . out . printf ( "Campaign with name '%s' and ID %d was added.%n" , campaign . getName ( ) , campaign . getId ( ) ) ; AdGroup adGroup = createAdGroup ( adWordsServices , session , campaign ) ; System . out . printf ( "Ad group with name '%s' and ID %d was added.%n" , adGroup . getName ( ) , adGroup . getId ( ) ) ; AdGroupAd adGroupAd = createShowcaseAd ( adWordsServices , session , adGroup ) ; System . out . printf ( "Showcase ad with ID %d was added.%n" , adGroupAd . getAd ( ) . getId ( ) ) ; ProductPartitionTree partitionTree = createProductPartitions ( adWordsServices , session , adGroup . getId ( ) ) ; System . out . printf ( "Final tree: %s%n" , partitionTree ) ; }
Runs the example.

@param adWordsServices the services factory.
@param session the session.
@param budgetId the budget ID to use for the new campaign.
@param merchantId the Merchant Center ID for the new campaign.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors.
@throws IOException if unable to get media data from the URL.