Google::Ads::Common::ReportUtils
use Google::Ads::Common::ReportUtils; Google::Ads::Common::ReportUtils::download_report($report_definition, $client, $path);
Google::Ads::Common::ReportUtils a collection of utility methods for working with reports.
Downloads a new instance of an existing report definition. If the file_path parameter is specified it will be downloaded to the file at that path, otherwise it will be downloaded to memory and be returned as a string.
The report_definition parameter is either: - the id of a pre-defined report to download - a ReportDefinition object to be defined and download on the fly - a hash with an AWQL query and format. i.e. { query => 'query', format => 'format' }
ReportDefinition
In the case of a plain id then the regular download endpoint will be used to download a pre-stored definition, otherwise the versioned download url endpoint (based on the version of the given Client object) will be used.
Client
The client parameter is an instance of a valid Google::AdWords::Client.
The file_path is an optional parameter that if given the subroutine will write out the report to the given file path.
The server is an optional parameter that can be set to alter the URL from where the report will be requested.
The return_money_in_micros is an optional parameter that can be set to alter the output of money kind of fields in the report.
The timeout is an optional parameter that can be set to alter the default time that the http client waits to get a response from the server. If not set, the default timeout used is Google::Ads::Common::ReportUtils::LWP_DEFAULT_TIMEOUT.
If a file_path is given, the report gets saved to file and the file size is returned, if not the report data itself is returned.
Starting with v201209 of the API a Google::Ads::Common::ReportDownloadError object will be returned in case of a download error. If not passing a file_path to dump the report then you must check if the return isa("Google::Ads::Common::ReportDownloadError").
file_path
Prior to v201209 a warn() will be issued if a report download error occurs.
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
David Torres <api.davidtorres at gmail.com>
$Rev: $ $LastChangedBy: $ $Id: $
To install Google::Ads::AdWords::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Google::Ads::AdWords::Client
CPAN shell
perl -MCPAN -e shell install Google::Ads::AdWords::Client
For more information on module installation, please visit the detailed CPAN module installation guide.