code: public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
        throws IOException, InterruptedException {
      // Get the ReportService.
      ReportServiceInterface reportService =
          adManagerServices.get(session, ReportServiceInterface.class);
  
      // Create report query.
      ReportQuery reportQuery = new ReportQuery();
      reportQuery.setDimensions(new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME});
      reportQuery.setColumns(
          new Column[] {Column.REACH_FREQUENCY, Column.REACH_AVERAGE_REVENUE, Column.REACH});
  
      // Set the dynamic date range type or a custom start and end date that is
      // the beginning of the week (Sunday) to the end of the week (Saturday), or
      // the first of the month to the end of the month.
      reportQuery.setDateRangeType(DateRangeType.REACH_LIFETIME);
  
      // Create report job.
      ReportJob reportJob = new ReportJob();
      reportJob.setReportQuery(reportQuery);
  
      // Run report job.
      reportJob = reportService.runReportJob(reportJob);
  
      // Create report downloader.
      ReportDownloader reportDownloader = new ReportDownloader(reportService, reportJob.getId());
  
      // Wait for the report to be ready.
      reportDownloader.waitForReportReady();
  
      // Change to your file location.
      File file = File.createTempFile("reach-report-", ".csv.gz");
  
      System.out.printf("Downloading report to %s ...", file.toString());
  
      // Download the report.
      ReportDownloadOptions options = new ReportDownloadOptions();
      options.setExportFormat(ExportFormat.CSV_DUMP);
      options.setUseGzipCompression(true);
      URL url = reportDownloader.getDownloadUrl(options);
      Resources.asByteSource(url).copyTo(Files.asByteSink(file));
  
      System.out.println("done.");
    }
docs: Runs the example.
  
  @param adManagerServices the services factory.
  @param session the session.
  @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 write the response to a file.
  @throws InterruptedException if the thread is interrupted while waiting for the report to
  complete.