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;
19
20use Google\Client;
21
22/**
23 * Service definition for YouTubeReporting (v1).
24 *
25 * <p>
26 * Schedules reporting jobs containing your YouTube Analytics data and downloads
27 * the resulting bulk data reports in the form of CSV files.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://developers.google.com/youtube/reporting/v1/reports/" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class YouTubeReporting extends \Google\Service
37{
38  /** View monetary and non-monetary YouTube Analytics reports for your YouTube content. */
39  const YT_ANALYTICS_MONETARY_READONLY =
40      "https://www.googleapis.com/auth/yt-analytics-monetary.readonly";
41  /** View YouTube Analytics reports for your YouTube content. */
42  const YT_ANALYTICS_READONLY =
43      "https://www.googleapis.com/auth/yt-analytics.readonly";
44
45  public $jobs;
46  public $jobs_reports;
47  public $media;
48  public $reportTypes;
49
50  /**
51   * Constructs the internal representation of the YouTubeReporting service.
52   *
53   * @param Client|array $clientOrConfig The client used to deliver requests, or a
54   *                                     config array to pass to a new Client instance.
55   * @param string $rootUrl The root URL used for requests to the service.
56   */
57  public function __construct($clientOrConfig = [], $rootUrl = null)
58  {
59    parent::__construct($clientOrConfig);
60    $this->rootUrl = $rootUrl ?: 'https://youtubereporting.googleapis.com/';
61    $this->servicePath = '';
62    $this->batchPath = 'batch';
63    $this->version = 'v1';
64    $this->serviceName = 'youtubereporting';
65
66    $this->jobs = new YouTubeReporting\Resource\Jobs(
67        $this,
68        $this->serviceName,
69        'jobs',
70        [
71          'methods' => [
72            'create' => [
73              'path' => 'v1/jobs',
74              'httpMethod' => 'POST',
75              'parameters' => [
76                'onBehalfOfContentOwner' => [
77                  'location' => 'query',
78                  'type' => 'string',
79                ],
80              ],
81            ],'delete' => [
82              'path' => 'v1/jobs/{jobId}',
83              'httpMethod' => 'DELETE',
84              'parameters' => [
85                'jobId' => [
86                  'location' => 'path',
87                  'type' => 'string',
88                  'required' => true,
89                ],
90                'onBehalfOfContentOwner' => [
91                  'location' => 'query',
92                  'type' => 'string',
93                ],
94              ],
95            ],'get' => [
96              'path' => 'v1/jobs/{jobId}',
97              'httpMethod' => 'GET',
98              'parameters' => [
99                'jobId' => [
100                  'location' => 'path',
101                  'type' => 'string',
102                  'required' => true,
103                ],
104                'onBehalfOfContentOwner' => [
105                  'location' => 'query',
106                  'type' => 'string',
107                ],
108              ],
109            ],'list' => [
110              'path' => 'v1/jobs',
111              'httpMethod' => 'GET',
112              'parameters' => [
113                'includeSystemManaged' => [
114                  'location' => 'query',
115                  'type' => 'boolean',
116                ],
117                'onBehalfOfContentOwner' => [
118                  'location' => 'query',
119                  'type' => 'string',
120                ],
121                'pageSize' => [
122                  'location' => 'query',
123                  'type' => 'integer',
124                ],
125                'pageToken' => [
126                  'location' => 'query',
127                  'type' => 'string',
128                ],
129              ],
130            ],
131          ]
132        ]
133    );
134    $this->jobs_reports = new YouTubeReporting\Resource\JobsReports(
135        $this,
136        $this->serviceName,
137        'reports',
138        [
139          'methods' => [
140            'get' => [
141              'path' => 'v1/jobs/{jobId}/reports/{reportId}',
142              'httpMethod' => 'GET',
143              'parameters' => [
144                'jobId' => [
145                  'location' => 'path',
146                  'type' => 'string',
147                  'required' => true,
148                ],
149                'reportId' => [
150                  'location' => 'path',
151                  'type' => 'string',
152                  'required' => true,
153                ],
154                'onBehalfOfContentOwner' => [
155                  'location' => 'query',
156                  'type' => 'string',
157                ],
158              ],
159            ],'list' => [
160              'path' => 'v1/jobs/{jobId}/reports',
161              'httpMethod' => 'GET',
162              'parameters' => [
163                'jobId' => [
164                  'location' => 'path',
165                  'type' => 'string',
166                  'required' => true,
167                ],
168                'createdAfter' => [
169                  'location' => 'query',
170                  'type' => 'string',
171                ],
172                'onBehalfOfContentOwner' => [
173                  'location' => 'query',
174                  'type' => 'string',
175                ],
176                'pageSize' => [
177                  'location' => 'query',
178                  'type' => 'integer',
179                ],
180                'pageToken' => [
181                  'location' => 'query',
182                  'type' => 'string',
183                ],
184                'startTimeAtOrAfter' => [
185                  'location' => 'query',
186                  'type' => 'string',
187                ],
188                'startTimeBefore' => [
189                  'location' => 'query',
190                  'type' => 'string',
191                ],
192              ],
193            ],
194          ]
195        ]
196    );
197    $this->media = new YouTubeReporting\Resource\Media(
198        $this,
199        $this->serviceName,
200        'media',
201        [
202          'methods' => [
203            'download' => [
204              'path' => 'v1/media/{+resourceName}',
205              'httpMethod' => 'GET',
206              'parameters' => [
207                'resourceName' => [
208                  'location' => 'path',
209                  'type' => 'string',
210                  'required' => true,
211                ],
212              ],
213            ],
214          ]
215        ]
216    );
217    $this->reportTypes = new YouTubeReporting\Resource\ReportTypes(
218        $this,
219        $this->serviceName,
220        'reportTypes',
221        [
222          'methods' => [
223            'list' => [
224              'path' => 'v1/reportTypes',
225              'httpMethod' => 'GET',
226              'parameters' => [
227                'includeSystemManaged' => [
228                  'location' => 'query',
229                  'type' => 'boolean',
230                ],
231                'onBehalfOfContentOwner' => [
232                  'location' => 'query',
233                  'type' => 'string',
234                ],
235                'pageSize' => [
236                  'location' => 'query',
237                  'type' => 'integer',
238                ],
239                'pageToken' => [
240                  'location' => 'query',
241                  'type' => 'string',
242                ],
243              ],
244            ],
245          ]
246        ]
247    );
248  }
249}
250
251// Adding a class alias for backwards compatibility with the previous class name.
252class_alias(YouTubeReporting::class, 'Google_Service_YouTubeReporting');
253