PageRenderTime 48ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/google/apiclient-services/src/YouTube/Resource/Videos.php

https://gitlab.com/Japang-Jawara/jawara-penilaian
PHP | 272 lines | 52 code | 4 blank | 216 comment | 0 complexity | e1c22873bdcbfb2b33a48678ea0a81a9 MD5 | raw file
  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\YouTube\Resource;
  18. use Google\Service\YouTube\Video;
  19. use Google\Service\YouTube\VideoAbuseReport;
  20. use Google\Service\YouTube\VideoGetRatingResponse;
  21. use Google\Service\YouTube\VideoListResponse;
  22. /**
  23. * The "videos" collection of methods.
  24. * Typical usage is:
  25. * <code>
  26. * $youtubeService = new Google\Service\YouTube(...);
  27. * $videos = $youtubeService->videos;
  28. * </code>
  29. */
  30. class Videos extends \Google\Service\Resource
  31. {
  32. /**
  33. * Deletes a resource. (videos.delete)
  34. *
  35. * @param string $id
  36. * @param array $optParams Optional parameters.
  37. *
  38. * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
  39. * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
  40. * parameter indicates that the request's authorization credentials identify a
  41. * YouTube CMS user who is acting on behalf of the content owner specified in
  42. * the parameter value. This parameter is intended for YouTube content partners
  43. * that own and manage many different YouTube channels. It allows content owners
  44. * to authenticate once and get access to all their video and channel data,
  45. * without having to provide authentication credentials for each individual
  46. * channel. The actual CMS account that the user authenticates with must be
  47. * linked to the specified YouTube content owner.
  48. */
  49. public function delete($id, $optParams = [])
  50. {
  51. $params = ['id' => $id];
  52. $params = array_merge($params, $optParams);
  53. return $this->call('delete', [$params]);
  54. }
  55. /**
  56. * Retrieves the ratings that the authorized user gave to a list of specified
  57. * videos. (videos.getRating)
  58. *
  59. * @param string|array $id
  60. * @param array $optParams Optional parameters.
  61. *
  62. * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
  63. * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
  64. * parameter indicates that the request's authorization credentials identify a
  65. * YouTube CMS user who is acting on behalf of the content owner specified in
  66. * the parameter value. This parameter is intended for YouTube content partners
  67. * that own and manage many different YouTube channels. It allows content owners
  68. * to authenticate once and get access to all their video and channel data,
  69. * without having to provide authentication credentials for each individual
  70. * channel. The CMS account that the user authenticates with must be linked to
  71. * the specified YouTube content owner.
  72. * @return VideoGetRatingResponse
  73. */
  74. public function getRating($id, $optParams = [])
  75. {
  76. $params = ['id' => $id];
  77. $params = array_merge($params, $optParams);
  78. return $this->call('getRating', [$params], VideoGetRatingResponse::class);
  79. }
  80. /**
  81. * Inserts a new resource into this collection. (videos.insert)
  82. *
  83. * @param string|array $part The *part* parameter serves two purposes in this
  84. * operation. It identifies the properties that the write operation will set as
  85. * well as the properties that the API response will include. Note that not all
  86. * parts contain properties that can be set when inserting or updating a video.
  87. * For example, the statistics object encapsulates statistics that YouTube
  88. * calculates for a video and does not contain values that you can set or
  89. * modify. If the parameter value specifies a part that does not contain mutable
  90. * values, that part will still be included in the API response.
  91. * @param Video $postBody
  92. * @param array $optParams Optional parameters.
  93. *
  94. * @opt_param bool autoLevels Should auto-levels be applied to the upload.
  95. * @opt_param bool notifySubscribers Notify the channel subscribers about the
  96. * new video. As default, the notification is enabled.
  97. * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
  98. * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
  99. * parameter indicates that the request's authorization credentials identify a
  100. * YouTube CMS user who is acting on behalf of the content owner specified in
  101. * the parameter value. This parameter is intended for YouTube content partners
  102. * that own and manage many different YouTube channels. It allows content owners
  103. * to authenticate once and get access to all their video and channel data,
  104. * without having to provide authentication credentials for each individual
  105. * channel. The CMS account that the user authenticates with must be linked to
  106. * the specified YouTube content owner.
  107. * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
  108. * used in a properly authorized request. *Note:* This parameter is intended
  109. * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
  110. * parameter specifies the YouTube channel ID of the channel to which a video is
  111. * being added. This parameter is required when a request specifies a value for
  112. * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
  113. * with that parameter. In addition, the request must be authorized using a CMS
  114. * account that is linked to the content owner that the onBehalfOfContentOwner
  115. * parameter specifies. Finally, the channel that the
  116. * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
  117. * content owner that the onBehalfOfContentOwner parameter specifies. This
  118. * parameter is intended for YouTube content partners that own and manage many
  119. * different YouTube channels. It allows content owners to authenticate once and
  120. * perform actions on behalf of the channel specified in the parameter value,
  121. * without having to provide authentication credentials for each separate
  122. * channel.
  123. * @opt_param bool stabilize Should stabilize be applied to the upload.
  124. * @return Video
  125. */
  126. public function insert($part, Video $postBody, $optParams = [])
  127. {
  128. $params = ['part' => $part, 'postBody' => $postBody];
  129. $params = array_merge($params, $optParams);
  130. return $this->call('insert', [$params], Video::class);
  131. }
  132. /**
  133. * Retrieves a list of resources, possibly filtered. (videos.listVideos)
  134. *
  135. * @param string|array $part The *part* parameter specifies a comma-separated
  136. * list of one or more video resource properties that the API response will
  137. * include. If the parameter identifies a property that contains child
  138. * properties, the child properties will be included in the response. For
  139. * example, in a video resource, the snippet property contains the channelId,
  140. * title, description, tags, and categoryId properties. As such, if you set
  141. * *part=snippet*, the API response will contain all of those properties.
  142. * @param array $optParams Optional parameters.
  143. *
  144. * @opt_param string chart Return the videos that are in the specified chart.
  145. * @opt_param string hl Stands for "host language". Specifies the localization
  146. * language of the metadata to be filled into snippet.localized. The field is
  147. * filled with the default metadata if there is no localization in the specified
  148. * language. The parameter value must be a language code included in the list
  149. * returned by the i18nLanguages.list method (e.g. en_US, es_MX).
  150. * @opt_param string id Return videos with the given ids.
  151. * @opt_param string locale
  152. * @opt_param int maxHeight
  153. * @opt_param string maxResults The *maxResults* parameter specifies the maximum
  154. * number of items that should be returned in the result set. *Note:* This
  155. * parameter is supported for use in conjunction with the myRating and chart
  156. * parameters, but it is not supported for use in conjunction with the id
  157. * parameter.
  158. * @opt_param int maxWidth Return the player with maximum height specified in
  159. * @opt_param string myRating Return videos liked/disliked by the authenticated
  160. * user. Does not support RateType.RATED_TYPE_NONE.
  161. * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
  162. * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
  163. * parameter indicates that the request's authorization credentials identify a
  164. * YouTube CMS user who is acting on behalf of the content owner specified in
  165. * the parameter value. This parameter is intended for YouTube content partners
  166. * that own and manage many different YouTube channels. It allows content owners
  167. * to authenticate once and get access to all their video and channel data,
  168. * without having to provide authentication credentials for each individual
  169. * channel. The CMS account that the user authenticates with must be linked to
  170. * the specified YouTube content owner.
  171. * @opt_param string pageToken The *pageToken* parameter identifies a specific
  172. * page in the result set that should be returned. In an API response, the
  173. * nextPageToken and prevPageToken properties identify other pages that could be
  174. * retrieved. *Note:* This parameter is supported for use in conjunction with
  175. * the myRating and chart parameters, but it is not supported for use in
  176. * conjunction with the id parameter.
  177. * @opt_param string regionCode Use a chart that is specific to the specified
  178. * region
  179. * @opt_param string videoCategoryId Use chart that is specific to the specified
  180. * video category
  181. * @return VideoListResponse
  182. */
  183. public function listVideos($part, $optParams = [])
  184. {
  185. $params = ['part' => $part];
  186. $params = array_merge($params, $optParams);
  187. return $this->call('list', [$params], VideoListResponse::class);
  188. }
  189. /**
  190. * Adds a like or dislike rating to a video or removes a rating from a video.
  191. * (videos.rate)
  192. *
  193. * @param string $id
  194. * @param string $rating
  195. * @param array $optParams Optional parameters.
  196. */
  197. public function rate($id, $rating, $optParams = [])
  198. {
  199. $params = ['id' => $id, 'rating' => $rating];
  200. $params = array_merge($params, $optParams);
  201. return $this->call('rate', [$params]);
  202. }
  203. /**
  204. * Report abuse for a video. (videos.reportAbuse)
  205. *
  206. * @param VideoAbuseReport $postBody
  207. * @param array $optParams Optional parameters.
  208. *
  209. * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
  210. * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
  211. * parameter indicates that the request's authorization credentials identify a
  212. * YouTube CMS user who is acting on behalf of the content owner specified in
  213. * the parameter value. This parameter is intended for YouTube content partners
  214. * that own and manage many different YouTube channels. It allows content owners
  215. * to authenticate once and get access to all their video and channel data,
  216. * without having to provide authentication credentials for each individual
  217. * channel. The CMS account that the user authenticates with must be linked to
  218. * the specified YouTube content owner.
  219. */
  220. public function reportAbuse(VideoAbuseReport $postBody, $optParams = [])
  221. {
  222. $params = ['postBody' => $postBody];
  223. $params = array_merge($params, $optParams);
  224. return $this->call('reportAbuse', [$params]);
  225. }
  226. /**
  227. * Updates an existing resource. (videos.update)
  228. *
  229. * @param string|array $part The *part* parameter serves two purposes in this
  230. * operation. It identifies the properties that the write operation will set as
  231. * well as the properties that the API response will include. Note that this
  232. * method will override the existing values for all of the mutable properties
  233. * that are contained in any parts that the parameter value specifies. For
  234. * example, a video's privacy setting is contained in the status part. As such,
  235. * if your request is updating a private video, and the request's part parameter
  236. * value includes the status part, the video's privacy setting will be updated
  237. * to whatever value the request body specifies. If the request body does not
  238. * specify a value, the existing privacy setting will be removed and the video
  239. * will revert to the default privacy setting. In addition, not all parts
  240. * contain properties that can be set when inserting or updating a video. For
  241. * example, the statistics object encapsulates statistics that YouTube
  242. * calculates for a video and does not contain values that you can set or
  243. * modify. If the parameter value specifies a part that does not contain mutable
  244. * values, that part will still be included in the API response.
  245. * @param Video $postBody
  246. * @param array $optParams Optional parameters.
  247. *
  248. * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
  249. * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
  250. * parameter indicates that the request's authorization credentials identify a
  251. * YouTube CMS user who is acting on behalf of the content owner specified in
  252. * the parameter value. This parameter is intended for YouTube content partners
  253. * that own and manage many different YouTube channels. It allows content owners
  254. * to authenticate once and get access to all their video and channel data,
  255. * without having to provide authentication credentials for each individual
  256. * channel. The actual CMS account that the user authenticates with must be
  257. * linked to the specified YouTube content owner.
  258. * @return Video
  259. */
  260. public function update($part, Video $postBody, $optParams = [])
  261. {
  262. $params = ['part' => $part, 'postBody' => $postBody];
  263. $params = array_merge($params, $optParams);
  264. return $this->call('update', [$params], Video::class);
  265. }
  266. }
  267. // Adding a class alias for backwards compatibility with the previous class name.
  268. class_alias(Videos::class, 'Google_Service_YouTube_Resource_Videos');