code: public static void runExample(
        AdManagerServices adManagerServices,
        AdManagerSession session,
        long rateCardId,
        long productTemplateId)
        throws RemoteException {
      // Get the BaseRateService.
      BaseRateServiceInterface baseRateService =
          adManagerServices.get(session, BaseRateServiceInterface.class);
  
      // Create a base rate for a product template.
      ProductTemplateBaseRate productTemplateBaseRate = new ProductTemplateBaseRate();
  
      // Set the rate card ID that the product template base rate belongs to.
      productTemplateBaseRate.setRateCardId(rateCardId);
  
      // Set the product template the base rate will be applied to.
      productTemplateBaseRate.setProductTemplateId(productTemplateId);
  
      // Create a rate worth $2 and set that on the product template base rate.
      Money rate = new Money();
      rate.setCurrencyCode("USD");
      rate.setMicroAmount(2000000L);
      productTemplateBaseRate.setRate(rate);
  
      // Create the product template base rate on the server.
      BaseRate[] baseRates =
          baseRateService.createBaseRates(new BaseRate[] {productTemplateBaseRate});
  
      for (BaseRate createdBaseRate : baseRates) {
        System.out.printf(
            "A product template base rate with ID %d and rate %.4f %s " + "was created.%n",
            createdBaseRate.getId(),
            (((ProductTemplateBaseRate) createdBaseRate).getRate().getMicroAmount() / 1000000f),
            ((ProductTemplateBaseRate) createdBaseRate).getRate().getCurrencyCode());
      }
    }
docs: Runs the example.
  
  @param adManagerServices the services factory.
  @param session the session.
  @param rateCardId the rate card ID to add the base rate to.
  @param productTemplateId the product template to apply this base rate to.
  @throws ApiException if the API request failed with one or more service errors.
  @throws RemoteException if the API request failed due to other errors.