PageRenderTime 52ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

/social_network/GoogleAPI/src/contrib/Google_YouTubeService.php

https://github.com/dikafryo/sw4u
PHP | 3684 lines | 3102 code | 120 blank | 462 comment | 50 complexity | 41740022788c34e3bba26abb889855a7 MD5 | raw file
Possible License(s): Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /*
  3. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  4. * use this file except in compliance with the License. You may obtain a copy of
  5. * the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  11. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  12. * License for the specific language governing permissions and limitations under
  13. * the License.
  14. */
  15. /**
  16. * The "activities" collection of methods.
  17. * Typical usage is:
  18. * <code>
  19. * $youtubeService = new Google_YouTubeService(...);
  20. * $activities = $youtubeService->activities;
  21. * </code>
  22. */
  23. class Google_ActivitiesServiceResource extends Google_ServiceResource {
  24. /**
  25. * Posts a bulletin for a specific channel. (The user submitting the request must be authorized to
  26. * act on the channel's behalf.) (activities.insert)
  27. *
  28. * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
  29. The part names that you can include in the parameter value are snippet and contentDetails.
  30. * @param Google_Activity $postBody
  31. * @param array $optParams Optional parameters.
  32. * @return Google_Activity
  33. */
  34. public function insert($part, Google_Activity $postBody, $optParams = array()) {
  35. $params = array('part' => $part, 'postBody' => $postBody);
  36. $params = array_merge($params, $optParams);
  37. $data = $this->__call('insert', array($params));
  38. if ($this->useObjects()) {
  39. return new Google_Activity($data);
  40. } else {
  41. return $data;
  42. }
  43. }
  44. /**
  45. * Returns a list of channel activity events that match the request criteria. For example, you can
  46. * retrieve events associated with a particular channel, events associated with the user's
  47. * subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each
  48. * user. (activities.list)
  49. *
  50. * @param string $part The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.
  51. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.
  52. * @param array $optParams Optional parameters.
  53. *
  54. * @opt_param string channelId The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities.
  55. * @opt_param string home Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user.
  56. * @opt_param string maxResults USE_DESCRIPTION --- channels:list:maxResults
  57. * @opt_param bool mine Set this parameter's value to true to retrieve a feed of the authenticated user's activities.
  58. * @opt_param string pageToken USE_DESCRIPTION --- channels:list:pageToken
  59. * @opt_param string publishedAfter The publishedAfter parameter specifies the earliest date and time that an activity could have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be included in the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  60. * @opt_param string publishedBefore The publishedBefore parameter specifies the date and time before which an activity must have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be excluded from the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  61. * @return Google_ActivityListResponse
  62. */
  63. public function listActivities($part, $optParams = array()) {
  64. $params = array('part' => $part);
  65. $params = array_merge($params, $optParams);
  66. $data = $this->__call('list', array($params));
  67. if ($this->useObjects()) {
  68. return new Google_ActivityListResponse($data);
  69. } else {
  70. return $data;
  71. }
  72. }
  73. }
  74. /**
  75. * The "channels" collection of methods.
  76. * Typical usage is:
  77. * <code>
  78. * $youtubeService = new Google_YouTubeService(...);
  79. * $channels = $youtubeService->channels;
  80. * </code>
  81. */
  82. class Google_ChannelsServiceResource extends Google_ServiceResource {
  83. /**
  84. * Returns a collection of zero or more channel resources that match the request criteria.
  85. * (channels.list)
  86. *
  87. * @param string $part The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, statistics, and topicDetails.
  88. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties.
  89. * @param array $optParams Optional parameters.
  90. *
  91. * @opt_param string categoryId The categoryId parameter specifies a YouTube guide category, thereby requesting YouTube channels associated with that category.
  92. * @opt_param string id The id parameter specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. In a channel resource, the id property specifies the channel's YouTube channel ID.
  93. * @opt_param string maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set.
  94. * @opt_param bool mine Set this parameter's value to true to instruct the API to only return channels owned by the authenticated user.
  95. * @opt_param string mySubscribers Set this parameter's value to true to retrieve a list of channels that subscribed to the authenticated user's channel.
  96. * @opt_param string pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.
  97. * @return Google_ChannelListResponse
  98. */
  99. public function listChannels($part, $optParams = array()) {
  100. $params = array('part' => $part);
  101. $params = array_merge($params, $optParams);
  102. $data = $this->__call('list', array($params));
  103. if ($this->useObjects()) {
  104. return new Google_ChannelListResponse($data);
  105. } else {
  106. return $data;
  107. }
  108. }
  109. }
  110. /**
  111. * The "guideCategories" collection of methods.
  112. * Typical usage is:
  113. * <code>
  114. * $youtubeService = new Google_YouTubeService(...);
  115. * $guideCategories = $youtubeService->guideCategories;
  116. * </code>
  117. */
  118. class Google_GuideCategoriesServiceResource extends Google_ServiceResource {
  119. /**
  120. * Returns a list of categories that can be associated with YouTube channels. (guideCategories.list)
  121. *
  122. * @param string $part The part parameter specifies a comma-separated list of one or more guideCategory resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet.
  123. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a guideCategory resource, the snippet property contains other properties, such as the category's title. If you set part=snippet, the API response will also contain all of those nested properties.
  124. * @param array $optParams Optional parameters.
  125. *
  126. * @opt_param string hl The hl parameter specifies the language that will be used for text values in the API response.
  127. * @opt_param string id The id parameter specifies a comma-separated list of the YouTube channel category ID(s) for the resource(s) that are being retrieved. In a guideCategory resource, the id property specifies the YouTube channel category ID.
  128. * @opt_param string regionCode The regionCode parameter instructs the API to return the list of guide categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.
  129. * @return Google_GuideCategoryListResponse
  130. */
  131. public function listGuideCategories($part, $optParams = array()) {
  132. $params = array('part' => $part);
  133. $params = array_merge($params, $optParams);
  134. $data = $this->__call('list', array($params));
  135. if ($this->useObjects()) {
  136. return new Google_GuideCategoryListResponse($data);
  137. } else {
  138. return $data;
  139. }
  140. }
  141. }
  142. /**
  143. * The "liveBroadcasts" collection of methods.
  144. * Typical usage is:
  145. * <code>
  146. * $youtubeService = new Google_YouTubeService(...);
  147. * $liveBroadcasts = $youtubeService->liveBroadcasts;
  148. * </code>
  149. */
  150. class Google_LiveBroadcastsServiceResource extends Google_ServiceResource {
  151. /**
  152. * Bind a YouTube live broadcast to a stream. (liveBroadcasts.bind)
  153. *
  154. * @param string $id ID of the broadcast to which the stream will be bound
  155. * @param string $part Live broadcast parts to be returned in the response. Valid values are: id, snippet, status, slateSettings, contentDetails.
  156. * @param array $optParams Optional parameters.
  157. *
  158. * @opt_param string streamId ID of the stream to bind to the broadcast
  159. * @return Google_LiveBroadcast
  160. */
  161. public function bind($id, $part, $optParams = array()) {
  162. $params = array('id' => $id, 'part' => $part);
  163. $params = array_merge($params, $optParams);
  164. $data = $this->__call('bind', array($params));
  165. if ($this->useObjects()) {
  166. return new Google_LiveBroadcast($data);
  167. } else {
  168. return $data;
  169. }
  170. }
  171. /**
  172. * Delete a YouTube live broadcast. (liveBroadcasts.delete)
  173. *
  174. * @param string $id The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted.
  175. * @param array $optParams Optional parameters.
  176. */
  177. public function delete($id, $optParams = array()) {
  178. $params = array('id' => $id);
  179. $params = array_merge($params, $optParams);
  180. $data = $this->__call('delete', array($params));
  181. return $data;
  182. }
  183. /**
  184. * Insert a YouTube live broadcast. (liveBroadcasts.insert)
  185. *
  186. * @param string $part Live broadcast parts to be set for the broadcast as well as included in the returned response. Valid values are: snippet, status, slateSettings, contentDetails.
  187. * @param Google_LiveBroadcast $postBody
  188. * @param array $optParams Optional parameters.
  189. * @return Google_LiveBroadcast
  190. */
  191. public function insert($part, Google_LiveBroadcast $postBody, $optParams = array()) {
  192. $params = array('part' => $part, 'postBody' => $postBody);
  193. $params = array_merge($params, $optParams);
  194. $data = $this->__call('insert', array($params));
  195. if ($this->useObjects()) {
  196. return new Google_LiveBroadcast($data);
  197. } else {
  198. return $data;
  199. }
  200. }
  201. /**
  202. * Browse the YouTube broadcast collection. (liveBroadcasts.list)
  203. *
  204. * @param string $part Live broadcast parts to include in the returned response. Valid values are: id, snippet, status, slateSettings, contentDetails.
  205. * @param array $optParams Optional parameters.
  206. *
  207. * @opt_param string broadcastStatus Filter to only return broadcasts with the given status by the authenticated user.
  208. * @opt_param string id IDs of the live broadcasts to be returned.
  209. * @opt_param string maxResults Maximum number of results to return
  210. * @opt_param bool mine Filter to only return broadcasts owned by authenticated user.
  211. * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the request is be on behalf of
  212. * @opt_param string pageToken Token for the page selection.
  213. * @return Google_LiveBroadcastList
  214. */
  215. public function listLiveBroadcasts($part, $optParams = array()) {
  216. $params = array('part' => $part);
  217. $params = array_merge($params, $optParams);
  218. $data = $this->__call('list', array($params));
  219. if ($this->useObjects()) {
  220. return new Google_LiveBroadcastList($data);
  221. } else {
  222. return $data;
  223. }
  224. }
  225. /**
  226. * Change the broadcasting status of a YouTube live broadcast and start all the processes associated
  227. * with it. (liveBroadcasts.transition)
  228. *
  229. * @param string $broadcastStatus Desired broadcast status.
  230. * @param string $id ID of the broadcast to change status
  231. * @param string $part Live broadcast parts to be returned in the response. Valid values are: id, snippet, status, slateSettings, contentDetails.
  232. * @param array $optParams Optional parameters.
  233. * @return Google_LiveBroadcast
  234. */
  235. public function transition($broadcastStatus, $id, $part, $optParams = array()) {
  236. $params = array('broadcastStatus' => $broadcastStatus, 'id' => $id, 'part' => $part);
  237. $params = array_merge($params, $optParams);
  238. $data = $this->__call('transition', array($params));
  239. if ($this->useObjects()) {
  240. return new Google_LiveBroadcast($data);
  241. } else {
  242. return $data;
  243. }
  244. }
  245. /**
  246. * Update a YouTube live broadcast. (liveBroadcasts.update)
  247. *
  248. * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
  249. The part names that you can include in the parameter value are id, snippet, status, slateSettings, contentDetails.
  250. * @param Google_LiveBroadcast $postBody
  251. * @param array $optParams Optional parameters.
  252. * @return Google_LiveBroadcast
  253. */
  254. public function update($part, Google_LiveBroadcast $postBody, $optParams = array()) {
  255. $params = array('part' => $part, 'postBody' => $postBody);
  256. $params = array_merge($params, $optParams);
  257. $data = $this->__call('update', array($params));
  258. if ($this->useObjects()) {
  259. return new Google_LiveBroadcast($data);
  260. } else {
  261. return $data;
  262. }
  263. }
  264. }
  265. /**
  266. * The "liveStreams" collection of methods.
  267. * Typical usage is:
  268. * <code>
  269. * $youtubeService = new Google_YouTubeService(...);
  270. * $liveStreams = $youtubeService->liveStreams;
  271. * </code>
  272. */
  273. class Google_LiveStreamsServiceResource extends Google_ServiceResource {
  274. /**
  275. * Delete a live stream. (liveStreams.delete)
  276. *
  277. * @param string $id The id parameter specifies the YouTube live stream ID for the resource that is being deleted.
  278. * @param array $optParams Optional parameters.
  279. */
  280. public function delete($id, $optParams = array()) {
  281. $params = array('id' => $id);
  282. $params = array_merge($params, $optParams);
  283. $data = $this->__call('delete', array($params));
  284. return $data;
  285. }
  286. /**
  287. * Insert a YouTube live stream. (liveStreams.insert)
  288. *
  289. * @param string $part Live stream parts to include in the returned response. Valid values are: id, snippet, cdn, status.
  290. * @param Google_LiveStream $postBody
  291. * @param array $optParams Optional parameters.
  292. * @return Google_LiveStream
  293. */
  294. public function insert($part, Google_LiveStream $postBody, $optParams = array()) {
  295. $params = array('part' => $part, 'postBody' => $postBody);
  296. $params = array_merge($params, $optParams);
  297. $data = $this->__call('insert', array($params));
  298. if ($this->useObjects()) {
  299. return new Google_LiveStream($data);
  300. } else {
  301. return $data;
  302. }
  303. }
  304. /**
  305. * Browse the YouTube live stream collection. (liveStreams.list)
  306. *
  307. * @param string $part Live stream parts to include in the returned response. Valid values are: id, snippet, cdn, status.
  308. * @param array $optParams Optional parameters.
  309. *
  310. * @opt_param string id IDs of the live streams to be returned.
  311. * @opt_param string maxResults Maximum number of results to return
  312. * @opt_param bool mine Filter to only live streams owned by authenticated user.
  313. * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the request is to be on behalf of
  314. * @opt_param string pageToken Token for the page selection.
  315. * @return Google_LiveStreamList
  316. */
  317. public function listLiveStreams($part, $optParams = array()) {
  318. $params = array('part' => $part);
  319. $params = array_merge($params, $optParams);
  320. $data = $this->__call('list', array($params));
  321. if ($this->useObjects()) {
  322. return new Google_LiveStreamList($data);
  323. } else {
  324. return $data;
  325. }
  326. }
  327. /**
  328. * Update a YouTube live stream. (liveStreams.update)
  329. *
  330. * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
  331. The part names that you can include in the parameter value are id, snippet, cdn, status.
  332. * @param Google_LiveStream $postBody
  333. * @param array $optParams Optional parameters.
  334. * @return Google_LiveStream
  335. */
  336. public function update($part, Google_LiveStream $postBody, $optParams = array()) {
  337. $params = array('part' => $part, 'postBody' => $postBody);
  338. $params = array_merge($params, $optParams);
  339. $data = $this->__call('update', array($params));
  340. if ($this->useObjects()) {
  341. return new Google_LiveStream($data);
  342. } else {
  343. return $data;
  344. }
  345. }
  346. }
  347. /**
  348. * The "playlistItems" collection of methods.
  349. * Typical usage is:
  350. * <code>
  351. * $youtubeService = new Google_YouTubeService(...);
  352. * $playlistItems = $youtubeService->playlistItems;
  353. * </code>
  354. */
  355. class Google_PlaylistItemsServiceResource extends Google_ServiceResource {
  356. /**
  357. * Deletes a playlist item. (playlistItems.delete)
  358. *
  359. * @param string $id The id parameter specifies the YouTube playlist item ID for the playlist item that is being deleted. In a playlistItem resource, the id property specifies the playlist item's ID.
  360. * @param array $optParams Optional parameters.
  361. */
  362. public function delete($id, $optParams = array()) {
  363. $params = array('id' => $id);
  364. $params = array_merge($params, $optParams);
  365. $data = $this->__call('delete', array($params));
  366. return $data;
  367. }
  368. /**
  369. * Adds a resource to a playlist. (playlistItems.insert)
  370. *
  371. * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
  372. The part names that you can include in the parameter value are snippet and contentDetails.
  373. * @param Google_PlaylistItem $postBody
  374. * @param array $optParams Optional parameters.
  375. * @return Google_PlaylistItem
  376. */
  377. public function insert($part, Google_PlaylistItem $postBody, $optParams = array()) {
  378. $params = array('part' => $part, 'postBody' => $postBody);
  379. $params = array_merge($params, $optParams);
  380. $data = $this->__call('insert', array($params));
  381. if ($this->useObjects()) {
  382. return new Google_PlaylistItem($data);
  383. } else {
  384. return $data;
  385. }
  386. }
  387. /**
  388. * Returns a collection of playlist items that match the API request parameters. You can retrieve
  389. * all of the playlist items in a specified playlist or retrieve one or more playlist items by their
  390. * unique IDs. (playlistItems.list)
  391. *
  392. * @param string $part The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.
  393. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties.
  394. * @param array $optParams Optional parameters.
  395. *
  396. * @opt_param string id The id parameter specifies a comma-separated list of one or more unique playlist item IDs.
  397. * @opt_param string maxResults USE_DESCRIPTION --- channels:list:maxResults
  398. * @opt_param string pageToken USE_DESCRIPTION --- channels:list:pageToken
  399. * @opt_param string playlistId The playlistId parameter specifies the unique ID of the playlist for which you want to retrieve playlist items. Note that even though this is an optional parameter, every request to retrieve playlist items must specify a value for either the id parameter or the playlistId parameter.
  400. * @opt_param string videoId The videoId parameter specifies that the request should return only the playlist items that contain the specified video.
  401. * @return Google_PlaylistItemListResponse
  402. */
  403. public function listPlaylistItems($part, $optParams = array()) {
  404. $params = array('part' => $part);
  405. $params = array_merge($params, $optParams);
  406. $data = $this->__call('list', array($params));
  407. if ($this->useObjects()) {
  408. return new Google_PlaylistItemListResponse($data);
  409. } else {
  410. return $data;
  411. }
  412. }
  413. /**
  414. * Modifies a playlist item. For example, you could update the item's position in the playlist.
  415. * (playlistItems.update)
  416. *
  417. * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
  418. The part names that you can include in the parameter value are snippet and contentDetails.
  419. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings.
  420. * @param Google_PlaylistItem $postBody
  421. * @param array $optParams Optional parameters.
  422. * @return Google_PlaylistItem
  423. */
  424. public function update($part, Google_PlaylistItem $postBody, $optParams = array()) {
  425. $params = array('part' => $part, 'postBody' => $postBody);
  426. $params = array_merge($params, $optParams);
  427. $data = $this->__call('update', array($params));
  428. if ($this->useObjects()) {
  429. return new Google_PlaylistItem($data);
  430. } else {
  431. return $data;
  432. }
  433. }
  434. }
  435. /**
  436. * The "playlists" collection of methods.
  437. * Typical usage is:
  438. * <code>
  439. * $youtubeService = new Google_YouTubeService(...);
  440. * $playlists = $youtubeService->playlists;
  441. * </code>
  442. */
  443. class Google_PlaylistsServiceResource extends Google_ServiceResource {
  444. /**
  445. * Deletes a playlist. (playlists.delete)
  446. *
  447. * @param string $id The id parameter specifies the YouTube playlist ID for the playlist that is being deleted. In a playlist resource, the id property specifies the playlist's ID.
  448. * @param array $optParams Optional parameters.
  449. */
  450. public function delete($id, $optParams = array()) {
  451. $params = array('id' => $id);
  452. $params = array_merge($params, $optParams);
  453. $data = $this->__call('delete', array($params));
  454. return $data;
  455. }
  456. /**
  457. * Creates a playlist. (playlists.insert)
  458. *
  459. * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
  460. The part names that you can include in the parameter value are snippet and status.
  461. * @param Google_Playlist $postBody
  462. * @param array $optParams Optional parameters.
  463. * @return Google_Playlist
  464. */
  465. public function insert($part, Google_Playlist $postBody, $optParams = array()) {
  466. $params = array('part' => $part, 'postBody' => $postBody);
  467. $params = array_merge($params, $optParams);
  468. $data = $this->__call('insert', array($params));
  469. if ($this->useObjects()) {
  470. return new Google_Playlist($data);
  471. } else {
  472. return $data;
  473. }
  474. }
  475. /**
  476. * Returns a collection of playlists that match the API request parameters. For example, you can
  477. * retrieve all playlists that the authenticated user owns, or you can retrieve one or more
  478. * playlists by their unique IDs. (playlists.list)
  479. *
  480. * @param string $part The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and status.
  481. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties.
  482. * @param array $optParams Optional parameters.
  483. *
  484. * @opt_param string channelId This value indicates that the API should only return the specified channel's playlists.
  485. * @opt_param string id The id parameter specifies a comma-separated list of the YouTube playlist ID(s) for the resource(s) that are being retrieved. In a playlist resource, the id property specifies the playlist's YouTube playlist ID.
  486. * @opt_param string maxResults USE_DESCRIPTION --- channels:list:maxResults
  487. * @opt_param bool mine Set this parameter's value to true to instruct the API to only return playlists owned by the authenticated user.
  488. * @opt_param string pageToken USE_DESCRIPTION --- channels:list:pageToken
  489. * @return Google_PlaylistListResponse
  490. */
  491. public function listPlaylists($part, $optParams = array()) {
  492. $params = array('part' => $part);
  493. $params = array_merge($params, $optParams);
  494. $data = $this->__call('list', array($params));
  495. if ($this->useObjects()) {
  496. return new Google_PlaylistListResponse($data);
  497. } else {
  498. return $data;
  499. }
  500. }
  501. /**
  502. * Modifies a playlist. For example, you could change a playlist's title, description, or privacy
  503. * status. (playlists.update)
  504. *
  505. * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
  506. The part names that you can include in the parameter value are snippet and status.
  507. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist's privacy setting is contained in the status part. As such, if your request is updating a private playlist, and the request's part parameter value includes the status part, the playlist's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the playlist will revert to the default privacy setting.
  508. * @param Google_Playlist $postBody
  509. * @param array $optParams Optional parameters.
  510. * @return Google_Playlist
  511. */
  512. public function update($part, Google_Playlist $postBody, $optParams = array()) {
  513. $params = array('part' => $part, 'postBody' => $postBody);
  514. $params = array_merge($params, $optParams);
  515. $data = $this->__call('update', array($params));
  516. if ($this->useObjects()) {
  517. return new Google_Playlist($data);
  518. } else {
  519. return $data;
  520. }
  521. }
  522. }
  523. /**
  524. * The "search" collection of methods.
  525. * Typical usage is:
  526. * <code>
  527. * $youtubeService = new Google_YouTubeService(...);
  528. * $search = $youtubeService->search;
  529. * </code>
  530. */
  531. class Google_SearchServiceResource extends Google_ServiceResource {
  532. /**
  533. * Returns a collection of search results that match the query parameters specified in the API
  534. * request. By default, a search result set identifies matching video, channel, and playlist
  535. * resources, but you can also configure queries to only retrieve a specific type of resource.
  536. * (search.list)
  537. *
  538. * @param string $part The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. The part names that you can include in the parameter value are id and snippet.
  539. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a search result, the snippet property contains other properties that identify the result's title, description, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.
  540. * @param array $optParams Optional parameters.
  541. *
  542. * @opt_param string channelId The channelId parameter indicates that the API response should only contain resources created by the channel
  543. * @opt_param string maxResults USE_DESCRIPTION --- channels:list:maxResults
  544. * @opt_param string order The order parameter specifies the method that will be used to order resources in the API response.
  545. * @opt_param string pageToken USE_DESCRIPTION --- channels:list:pageToken
  546. * @opt_param string publishedAfter The publishedAfter parameter indicates that the API response should only contain resources created after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).
  547. * @opt_param string publishedBefore The publishedBefore parameter indicates that the API response should only contain resources created before the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).
  548. * @opt_param string q The q parameter specifies the query term to search for.
  549. * @opt_param string regionCode The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.
  550. * @opt_param string relatedToVideoId The relatedToVideoId parameter retrieves a list of videos that are related to the video that the parameter value identifies. The parameter value must be set to a YouTube video ID and, if you are using this parameter, the type parameter must be set to video.
  551. * @opt_param string topicId The topicId parameter indicates that the API response should only contain resources associated with the specified topic. The value identifies a Freebase topic ID.
  552. * @opt_param string type The type parameter restricts a search query to only retrieve a particular type of resource.
  553. * @opt_param string videoCaption The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions.
  554. * @opt_param string videoCategoryId The videoCategoryId parameter filters video search results based on their category.
  555. * @opt_param string videoDefinition The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available.
  556. * @opt_param string videoDimension The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos.
  557. * @opt_param string videoDuration The videoDuration parameter filters video search results based on their duration.
  558. * @opt_param string videoEmbeddable The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage.
  559. * @opt_param string videoLicense The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos.
  560. * @opt_param string videoSyndicated The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com.
  561. * @return Google_SearchListResponse
  562. */
  563. public function listSearch($part, $optParams = array()) {
  564. $params = array('part' => $part);
  565. $params = array_merge($params, $optParams);
  566. $data = $this->__call('list', array($params));
  567. if ($this->useObjects()) {
  568. return new Google_SearchListResponse($data);
  569. } else {
  570. return $data;
  571. }
  572. }
  573. }
  574. /**
  575. * The "subscriptions" collection of methods.
  576. * Typical usage is:
  577. * <code>
  578. * $youtubeService = new Google_YouTubeService(...);
  579. * $subscriptions = $youtubeService->subscriptions;
  580. * </code>
  581. */
  582. class Google_SubscriptionsServiceResource extends Google_ServiceResource {
  583. /**
  584. * Deletes a subscription. (subscriptions.delete)
  585. *
  586. * @param string $id The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID.
  587. * @param array $optParams Optional parameters.
  588. */
  589. public function delete($id, $optParams = array()) {
  590. $params = array('id' => $id);
  591. $params = array_merge($params, $optParams);
  592. $data = $this->__call('delete', array($params));
  593. return $data;
  594. }
  595. /**
  596. * Adds a subscription for the authenticated user's channel. (subscriptions.insert)
  597. *
  598. * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
  599. The part names that you can include in the parameter value are snippet and contentDetails.
  600. * @param Google_Subscription $postBody
  601. * @param array $optParams Optional parameters.
  602. * @return Google_Subscription
  603. */
  604. public function insert($part, Google_Subscription $postBody, $optParams = array()) {
  605. $params = array('part' => $part, 'postBody' => $postBody);
  606. $params = array_merge($params, $optParams);
  607. $data = $this->__call('insert', array($params));
  608. if ($this->useObjects()) {
  609. return new Google_Subscription($data);
  610. } else {
  611. return $data;
  612. }
  613. }
  614. /**
  615. * Returns subscription resources that match the API request criteria. (subscriptions.list)
  616. *
  617. * @param string $part The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.
  618. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties.
  619. * @param array $optParams Optional parameters.
  620. *
  621. * @opt_param string channelId The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions.
  622. * @opt_param string forChannelId The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels.
  623. * @opt_param string id The id parameter specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID.
  624. * @opt_param string maxResults USE_DESCRIPTION --- channels:list:maxResults
  625. * @opt_param bool mine Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions.
  626. * @opt_param string order The order parameter specifies the method that will be used to sort resources in the API response.
  627. * @opt_param string pageToken USE_DESCRIPTION --- channels:list:pageToken
  628. * @return Google_SubscriptionListResponse
  629. */
  630. public function listSubscriptions($part, $optParams = array()) {
  631. $params = array('part' => $part);
  632. $params = array_merge($params, $optParams);
  633. $data = $this->__call('list', array($params));
  634. if ($this->useObjects()) {
  635. return new Google_SubscriptionListResponse($data);
  636. } else {
  637. return $data;
  638. }
  639. }
  640. }
  641. /**
  642. * The "videoCategories" collection of methods.
  643. * Typical usage is:
  644. * <code>
  645. * $youtubeService = new Google_YouTubeService(...);
  646. * $videoCategories = $youtubeService->videoCategories;
  647. * </code>
  648. */
  649. class Google_VideoCategoriesServiceResource extends Google_ServiceResource {
  650. /**
  651. * Returns a list of categories that can be associated with YouTube videos. (videoCategories.list)
  652. *
  653. * @param string $part The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet.
  654. * @param array $optParams Optional parameters.
  655. *
  656. * @opt_param string hl The hl parameter specifies the language that should be used for text values in the API response.
  657. * @opt_param string id The id parameter specifies a comma-separated list of video category IDs for the resources that you are retrieving.
  658. * @opt_param string regionCode The regionCode parameter instructs the API to return the list of video categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.
  659. * @return Google_VideoCategoryListResponse
  660. */
  661. public function listVideoCategories($part, $optParams = array()) {
  662. $params = array('part' => $part);
  663. $params = array_merge($params, $optParams);
  664. $data = $this->__call('list', array($params));
  665. if ($this->useObjects()) {
  666. return new Google_VideoCategoryListResponse($data);
  667. } else {
  668. return $data;
  669. }
  670. }
  671. }
  672. /**
  673. * The "videos" collection of methods.
  674. * Typical usage is:
  675. * <code>
  676. * $youtubeService = new Google_YouTubeService(...);
  677. * $videos = $youtubeService->videos;
  678. * </code>
  679. */
  680. class Google_VideosServiceResource extends Google_ServiceResource {
  681. /**
  682. * Deletes a YouTube video. (videos.delete)
  683. *
  684. * @param string $id The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID.
  685. * @param array $optParams Optional parameters.
  686. */
  687. public function delete($id, $optParams = array()) {
  688. $params = array('id' => $id);
  689. $params = array_merge($params, $optParams);
  690. $data = $this->__call('delete', array($params));
  691. return $data;
  692. }
  693. /**
  694. * Uploads a video to YouTube and optionally sets the video's metadata. (videos.insert)
  695. *
  696. * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
  697. The part names that you can include in the parameter value are snippet, contentDetails, player, statistics, status, and topicDetails. However, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.
  698. * @param Google_Video $postBody
  699. * @param array $optParams Optional parameters.
  700. * @return Google_Video
  701. */
  702. public function insert($part, Google_Video $postBody, $optParams = array()) {
  703. $params = array('part' => $part, 'postBody' => $postBody);
  704. $params = array_merge($params, $optParams);
  705. $data = $this->__call('insert', array($params));
  706. if ($this->useObjects()) {
  707. return new Google_Video($data);
  708. } else {
  709. return $data;
  710. }
  711. }
  712. /**
  713. * Returns a list of videos that match the API request parameters. (videos.list)
  714. *
  715. * @param string $id The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the video's ID.
  716. * @param string $part The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, player, statistics, status, and topicDetails.
  717. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties.
  718. * @param array $optParams Optional parameters.
  719. * @return Google_VideoListResponse
  720. */
  721. public function listVideos($id, $part, $optParams = array()) {
  722. $params = array('id' => $id, 'part' => $part);
  723. $params = array_merge($params, $optParams);
  724. $data = $this->__call('list', array($params));
  725. if ($this->useObjects()) {
  726. return new Google_VideoListResponse($data);
  727. } else {
  728. return $data;
  729. }
  730. }
  731. /**
  732. * Updates a video's metadata. (videos.update)
  733. *
  734. * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
  735. The part names that you can include in the parameter value are snippet, contentDetails, player, statistics, status, and topicDetails.
  736. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting.
  737. In addition, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.
  738. * @param Google_Video $postBody
  739. * @param array $optParams Optional parameters.
  740. * @return Google_Video
  741. */
  742. public function update($part, Google_Video $postBody, $optParams = array()) {
  743. $params = array('part' => $part, 'postBody' => $postBody);
  744. $params = array_merge($params, $optParams);
  745. $data = $this->__call('update', array($params));
  746. if ($this->useObjects()) {
  747. return new Google_Video($data);
  748. } else {
  749. return $data;
  750. }
  751. }
  752. }
  753. /**
  754. * Service definition for Google_YouTube (v3).
  755. *
  756. * <p>
  757. * Programmatic access to YouTube features.
  758. * </p>
  759. *
  760. * <p>
  761. * For more information about this service, see the
  762. * <a href="https://developers.google.com/youtube/v3" target="_blank">API Documentation</a>
  763. * </p>
  764. *
  765. * @author Google, Inc.
  766. */
  767. class Google_YouTubeService extends Google_Service {
  768. public $activities;
  769. public $channels;
  770. public $guideCategories;
  771. public $liveBroadcasts;
  772. public $liveStreams;
  773. public $playlistItems;
  774. public $playlists;
  775. public $search;
  776. public $subscriptions;
  777. public $videoCategories;
  778. public $videos;
  779. /**
  780. * Constructs the internal representation of the YouTube service.
  781. *
  782. * @param Google_Client $client
  783. */
  784. public function __construct(Google_Client $client) {
  785. $this->servicePath = 'youtube/v3/';
  786. $this->version = 'v3';
  787. $this->serviceName = 'youtube';
  788. $client->addService($this->serviceName, $this->version);
  789. $this->activities = new Google_ActivitiesServiceResource($this, $this->serviceName, 'activities', json_decode('{"methods": {"insert": {"id": "youtube.activities.insert", "path": "activities", "httpMethod": "POST", "parameters": {"part": {"type": "string", "required": true, "location": "query"}}, "request": {"$ref": "Activity"}, "response": {"$ref": "Activity"}, "scopes": ["https://www.googleapis.com/auth/youtube"]}, "list": {"id": "youtube.activities.list", "path": "activities", "httpMethod": "GET", "parameters": {"channelId": {"type": "string", "location": "query"}, "home": {"type": "string", "location": "query"}, "maxResults": {"type": "integer", "default": "5", "format": "uint32", "minimum": "0", "maximum": "50", "location": "query"}, "mine": {"type": "boolean", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "part": {"type": "string", "required": true, "location": "query"}, "publishedAfter": {"type": "string", "format": "date-time", "location": "query"}, "publishedBefore": {"type": "string", "format": "date-time", "location": "query"}}, "response": {"$ref": "ActivityListResponse"}, "scopes": ["https://www.googleapis.com/auth/youtube", "https://www.googleapis.com/auth/youtube.readonly"]}}}', true));
  790. $this->channels = new Google_ChannelsServiceResource($this, $this->serviceName, 'channels', json_decode('{"methods": {"list": {"id": "youtube.channels.list", "path": "channels", "httpMethod": "GET", "parameters": {"categoryId": {"type": "string", "location": "query"}, "id": {"type": "string", "location": "query"}, "maxResults": {"type": "integer", "default": "5", "format": "uint32", "minimum": "0", "maximum": "50", "location": "query"}, "mine": {"type": "boolean", "location": "query"}, "mySubscribers": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "part": {"type": "string", "required": true, "location": "query"}}, "response": {"$ref": "ChannelListResponse"}, "scopes": ["https://www.googleapis.com/auth/youtube", "https://www.googleapis.com/auth/youtube.readonly", "https://www.googleapis.com/auth/youtubepartner"]}}}', true));
  791. $this->guideCategories = new Google_GuideCategoriesServiceResource($this, $this->serviceName, 'guideCategories', json_decode('{"methods": {"list": {"id": "youtube.guideCategories.list", "path": "guideCategories", "httpMethod": "GET", "parameters": {"hl": {"type": "string", "default": "en-US", "location": "query"}, "id": {"type": "string", "location": "query"}, "part": {"type": "string", "required": true, "location": "query"}, "regionCode": {"type": "string", "location": "query"}}, "response": {"$ref": "GuideCategoryListResponse"}, "scopes": ["https://www.googleapis.com/auth/youtube", "https://www.googleapis.com/auth/youtube.readonly", "https://www.googleapis.com/auth/youtubepartner"]}}}', true));
  792. $this->liveBroadcasts = new Google_LiveBroadcastsServiceResource($this, $this->serviceName, 'liveBroadcasts', json_decode('{"methods": {"bind": {"id": "youtube.liveBroadcasts.bind", "path": "liveBroadcasts/bind", "httpMethod": "POST", "parameters": {"id": {"type": "string", "required": true, "location": "query"}, "part": {"type": "string", "required": true, "location": "query"}, "streamId": {"type": "string", "location": "query"}}, "response": {"$ref": "LiveBroadcast"}, "scopes": ["https://www.googleapis.com/auth/youtube"]}, "delete": {"id": "youtube.liveBroadcasts.delete", "path": "liveBroadcasts", "httpMethod": "DELETE", "parameters": {"id": {"type": "string", "required": true, "location": "query"}}, "scopes": ["https://www.googleapis.com/auth/youtube"]}, "insert": {"id": "youtube.liveBroadcasts.insert", "path": "liveBroadcasts", "httpMethod": "POST", "parameters": {"part": {"type": "string", "required": true, "location": "query"}}, "request": {"$ref": "LiveBroadcast"}, "response": {"$ref": "LiveBroadcast"}, "scopes": ["https://www.google…

Large files files are truncated, but you can click here to view the full file