com.google.api.ads.adwords.lib.utils.v201206
Class ReportDownloader

java.lang.Object
  extended by com.google.api.ads.adwords.lib.utils.v201206.ReportDownloader

public class ReportDownloader
extends Object

Reports are fetched synchronously like in the following code:

new ReportDownloader(adWordsSession).downloadReport(reportDefinition);

The adWordsSession is used to authenticate the request against the reportDownloadUrl.

Author:
Adam Rogal, Kevin Winter

Constructor Summary
ReportDownloader(AdWordsSession session)
          Constructs a ReportDownloader.
 
Method Summary
 ReportDownloadResponse downloadReport(ReportDefinition reportDefinition)
          Downloads a report and returns a ReportDownloadResponse with the results.
 ReportDownloadResponse downloadReport(String reportQuery, DownloadFormat format)
          Downloads a report query (AWQL) and returns a ReportDownloadResponse with the results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportDownloader

public ReportDownloader(AdWordsSession session)
Constructs a ReportDownloader.

Parameters:
session - AdWordsSession to use to make report download requests.
Method Detail

downloadReport

public ReportDownloadResponse downloadReport(ReportDefinition reportDefinition)
                                      throws ReportException
Downloads a report and returns a ReportDownloadResponse with the results.

Parameters:
reportDefinition - to download a report for.
Returns:
ReportDownloadResponse When HTTP request completes. On success, the outputStream will be flushed and closed.
Throws:
ReportException - If there is any issue making HTTP request with server.

downloadReport

public ReportDownloadResponse downloadReport(String reportQuery,
                                             DownloadFormat format)
                                      throws ReportException
Downloads a report query (AWQL) and returns a ReportDownloadResponse with the results.

Parameters:
reportQuery - to download a report for.
format - Format to download the report as. CSV,
Returns:
ReportDownloadResponse When HTTP request completes. On success, the outputStream will be flushed and closed.
Throws:
ReportException - If there is any issue making HTTP request with server.


Copyright © 2012. All Rights Reserved.