/** * Downloads a report and returns a ReportDownloadResponse with the results. * * @param reportDefinition to download a report for. * @return {@link ReportDownloadResponse} When HTTP request completes. On success, the * outputStream will be flushed and closed. * @throws ReportException If we don't receive a response from the server. * @throws ReportDownloadResponseException If the server indicates a problem with the request. */ public ReportDownloadResponse downloadReport(ReportDefinition reportDefinition) throws ReportException, ReportDownloadResponseException { return handleResponse(adHocReportDownloadHelper.downloadReport(toXml(reportDefinition))); }
/** Returns the reportDownloadTimeout in milliseconds. */ public int getReportDownloadTimeout() { return adHocReportDownloadHelper.getReportDownloadTimeout(); }
/** * Sets the timeout for both CONNECT and READ to the specified value. Defaults to 3 minutes. Set * property api.adwords.reportDownloadTimeout in ads.properties or as a system property to set a * default for all ReportDownloaders. * * @param reportDownloadTimeout the reportDownloadTimeout to set in milliseconds */ public void setReportDownloadTimeout(int reportDownloadTimeout) { adHocReportDownloadHelper.setReportDownloadTimeout(reportDownloadTimeout); }
/** * Downloads a report query (AWQL) and returns a ReportDownloadResponse with the results. * * @param reportQuery to download a report for. * @param format Format to download the report as. CSV, * @return {@link 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. * @throws ReportDownloadResponseException If the server indicates a problem with the request. */ public ReportDownloadResponse downloadReport(String reportQuery, DownloadFormat format) throws ReportException, ReportDownloadResponseException { return handleResponse(adHocReportDownloadHelper.downloadReport(reportQuery, format.value())); }