public class ReportDownloader extends Object implements ReportDownloaderInterface
new ReportDownloader(adWordsSession).downloadReport(reportDefinition);
The adWordsSession is used to authenticate the request against the
reportDownloadUrl.
Implementation is not thread-safe.
| Constructor and Description |
|---|
ReportDownloader(AdWordsSession session)
Constructs a
ReportDownloader. |
| Modifier and Type | Method and Description |
|---|---|
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.
|
int |
getReportDownloadTimeout()
Returns the reportDownloadTimeout in milliseconds.
|
void |
setReportDownloadTimeout(int reportDownloadTimeout)
Sets the timeout for both CONNECT and READ to the specified value.
|
public ReportDownloader(AdWordsSession session)
ReportDownloader.session - AdWordsSession to use to make report download requests.public ReportDownloadResponse downloadReport(ReportDefinition reportDefinition) throws ReportException, ReportDownloadResponseException
ReportDownloaderInterfacedownloadReport in interface ReportDownloaderInterfacereportDefinition - to download a report for.ReportDownloadResponse If the HTTP request completes successfully.ReportException - If we don't receive a response from the server.ReportDownloadResponseException - If the server indicates a problem with the request.public ReportDownloadResponse downloadReport(String reportQuery, DownloadFormat format) throws ReportException, ReportDownloadResponseException
ReportDownloaderInterfacedownloadReport in interface ReportDownloaderInterfacereportQuery - to download a report for.format - Format to download the report as. CSV,ReportDownloadResponse If the HTTP request completes successfully.ReportException - If there is any issue making HTTP request with server.ReportDownloadResponseException - If the server indicates a problem with the request.public int getReportDownloadTimeout()
ReportDownloaderInterfacegetReportDownloadTimeout in interface ReportDownloaderInterfacepublic void setReportDownloadTimeout(int reportDownloadTimeout)
ReportDownloaderInterfacesetReportDownloadTimeout in interface ReportDownloaderInterfacereportDownloadTimeout - the reportDownloadTimeout to set in millisecondsCopyright © 2018. All Rights Reserved.