1<?php 2/* 3 * Copyright 2014 Google Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 * use this file except in compliance with the License. You may obtain a copy of 7 * the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 18/** 19 * The "reports" collection of methods. 20 * Typical usage is: 21 * <code> 22 * $adsensehostService = new Google_Service_AdSenseHost(...); 23 * $reports = $adsensehostService->reports; 24 * </code> 25 */ 26class Google_Service_AdSenseHost_Resource_Reports extends Google_Service_Resource 27{ 28 /** 29 * Generate an AdSense report based on the report request sent in the query 30 * parameters. Returns the result as JSON; to retrieve output in CSV format 31 * specify "alt=csv" as a query parameter. (reports.generate) 32 * 33 * @param string $startDate Start of the date range to report on in "YYYY-MM-DD" 34 * format, inclusive. 35 * @param string $endDate End of the date range to report on in "YYYY-MM-DD" 36 * format, inclusive. 37 * @param array $optParams Optional parameters. 38 * 39 * @opt_param string dimension Dimensions to base the report on. 40 * @opt_param string filter Filters to be run on the report. 41 * @opt_param string locale Optional locale to use for translating report output 42 * to a local language. Defaults to "en_US" if not specified. 43 * @opt_param string maxResults The maximum number of rows of report data to 44 * return. 45 * @opt_param string metric Numeric columns to include in the report. 46 * @opt_param string sort The name of a dimension or metric to sort the 47 * resulting report on, optionally prefixed with "+" to sort ascending or "-" to 48 * sort descending. If no prefix is specified, the column is sorted ascending. 49 * @opt_param string startIndex Index of the first row of report data to return. 50 * @return Google_Service_AdSenseHost_Report 51 */ 52 public function generate($startDate, $endDate, $optParams = array()) 53 { 54 $params = array('startDate' => $startDate, 'endDate' => $endDate); 55 $params = array_merge($params, $optParams); 56 return $this->call('generate', array($params), "Google_Service_AdSenseHost_Report"); 57 } 58} 59