DEFAULT_POLL_SECONDS
DEFAULT_POLL_SECONDS
Provides functionality to help with retrieving a report. Encapsulates common tasks, such as polling for a report's status until it is ready to be downloaded and downloading the report.
__construct(\Google\AdsApi\AdManager\v202105\ReportService $reportService,integer $reportJobId,integer|null $pollTimeSeconds = null,\GuzzleHttp\Client|null $httpClient = null,\Google\AdsApi\Common\GuzzleHttpClientFactory|null $httpClientFactory = null)
Creates a downloader for the specified report job ID and requires an instance of a report service for making API calls on the report.
\Google\AdsApi\AdManager\v202105\ReportService | $reportService | |
integer | $reportJobId | |
integer|null | $pollTimeSeconds | optional, specify the time to sleep, in seconds, when polling for a report's status |
\GuzzleHttp\Client|null | $httpClient | optional, the Guzzle HTTP client whose handler stacks this library's logging middleware will be pushed to |
\Google\AdsApi\Common\GuzzleHttpClientFactory|null | $httpClientFactory | optional, the Guzzle HTTP client factory that will generate a client handling HTTP calls |
downloadReport(string $exportFormat,string $filePath = null): void|\Psr\Http\Message\StreamInterface
Downloads the report with the specified export format.
string | $exportFormat | the export format of the report |
string | $filePath | an optional file path to download the report to |
if the report is still in progress or has failed
nothing if a file path is specified, otherwise report contents as a stream