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
18namespace Google\Service\YouTubeAnalytics\Resource;
19
20use Google\Service\YouTubeAnalytics\QueryResponse;
21
22/**
23 * The "reports" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $youtubeAnalyticsService = new Google\Service\YouTubeAnalytics(...);
27 *   $reports = $youtubeAnalyticsService->reports;
28 *  </code>
29 */
30class Reports extends \Google\Service\Resource
31{
32  /**
33   * Retrieve your YouTube Analytics reports. (reports.query)
34   *
35   * @param array $optParams Optional parameters.
36   *
37   * @opt_param string currency The currency to which financial metrics should be
38   * converted. The default is US Dollar (USD). If the result contains no
39   * financial metrics, this flag will be ignored. Responds with an error if the
40   * specified currency is not recognized.", pattern: [A-Z]{3}
41   * @opt_param string dimensions A comma-separated list of YouTube Analytics
42   * dimensions, such as `views` or `ageGroup,gender`. See the [Available
43   * Reports](/youtube/analytics/v2/available_reports) document for a list of the
44   * reports that you can retrieve and the dimensions used for those reports. Also
45   * see the [Dimensions](/youtube/analytics/v2/dimsmets/dims) document for
46   * definitions of those dimensions." pattern: [0-9a-zA-Z,]+
47   * @opt_param string endDate The end date for fetching YouTube Analytics data.
48   * The value should be in `YYYY-MM-DD` format. required: true, pattern:
49   * [0-9]{4}-[0-9]{2}-[0-9]{2}
50   * @opt_param string filters A list of filters that should be applied when
51   * retrieving YouTube Analytics data. The [Available
52   * Reports](/youtube/analytics/v2/available_reports) document identifies the
53   * dimensions that can be used to filter each report, and the
54   * [Dimensions](/youtube/analytics/v2/dimsmets/dims) document defines those
55   * dimensions. If a request uses multiple filters, join them together with a
56   * semicolon (`;`), and the returned result table will satisfy both filters. For
57   * example, a filters parameter value of `video==dMH0bHeiRNg;country==IT`
58   * restricts the result set to include data for the given video in Italy.",
59   * @opt_param string ids Identifies the YouTube channel or content owner for
60   * which you are retrieving YouTube Analytics data. - To request data for a
61   * YouTube user, set the `ids` parameter value to `channel==CHANNEL_ID`, where
62   * `CHANNEL_ID` specifies the unique YouTube channel ID. - To request data for a
63   * YouTube CMS content owner, set the `ids` parameter value to
64   * `contentOwner==OWNER_NAME`, where `OWNER_NAME` is the CMS name of the content
65   * owner. required: true, pattern: [a-zA-Z]+==[a-zA-Z0-9_+-]+
66   * @opt_param bool includeHistoricalChannelData If set to true historical data
67   * (i.e. channel data from before the linking of the channel to the content
68   * owner) will be retrieved.",
69   * @opt_param int maxResults The maximum number of rows to include in the
70   * response.", minValue: 1
71   * @opt_param string metrics A comma-separated list of YouTube Analytics
72   * metrics, such as `views` or `likes,dislikes`. See the [Available
73   * Reports](/youtube/analytics/v2/available_reports) document for a list of the
74   * reports that you can retrieve and the metrics available in each report, and
75   * see the [Metrics](/youtube/analytics/v2/dimsmets/mets) document for
76   * definitions of those metrics. required: true, pattern: [0-9a-zA-Z,]+
77   * @opt_param string sort A comma-separated list of dimensions or metrics that
78   * determine the sort order for YouTube Analytics data. By default the sort
79   * order is ascending. The '`-`' prefix causes descending sort order.", pattern:
80   * [-0-9a-zA-Z,]+
81   * @opt_param string startDate The start date for fetching YouTube Analytics
82   * data. The value should be in `YYYY-MM-DD` format. required: true, pattern:
83   * "[0-9]{4}-[0-9]{2}-[0-9]{2}
84   * @opt_param int startIndex An index of the first entity to retrieve. Use this
85   * parameter as a pagination mechanism along with the max-results parameter
86   * (one-based, inclusive).", minValue: 1
87   * @return QueryResponse
88   */
89  public function query($optParams = [])
90  {
91    $params = [];
92    $params = array_merge($params, $optParams);
93    return $this->call('query', [$params], QueryResponse::class);
94  }
95}
96
97// Adding a class alias for backwards compatibility with the previous class name.
98class_alias(Reports::class, 'Google_Service_YouTubeAnalytics_Resource_Reports');
99