YouTubeReporting.php 7.9 KB

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