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\YouTube\Resource; 19 20use Google\Service\YouTube\Playlist; 21use Google\Service\YouTube\PlaylistListResponse; 22 23/** 24 * The "playlists" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $youtubeService = new Google\Service\YouTube(...); 28 * $playlists = $youtubeService->playlists; 29 * </code> 30 */ 31class Playlists extends \Google\Service\Resource 32{ 33 /** 34 * Deletes a resource. (playlists.delete) 35 * 36 * @param string $id 37 * @param array $optParams Optional parameters. 38 * 39 * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended 40 * exclusively for YouTube content partners. The *onBehalfOfContentOwner* 41 * parameter indicates that the request's authorization credentials identify a 42 * YouTube CMS user who is acting on behalf of the content owner specified in 43 * the parameter value. This parameter is intended for YouTube content partners 44 * that own and manage many different YouTube channels. It allows content owners 45 * to authenticate once and get access to all their video and channel data, 46 * without having to provide authentication credentials for each individual 47 * channel. The CMS account that the user authenticates with must be linked to 48 * the specified YouTube content owner. 49 */ 50 public function delete($id, $optParams = []) 51 { 52 $params = ['id' => $id]; 53 $params = array_merge($params, $optParams); 54 return $this->call('delete', [$params]); 55 } 56 /** 57 * Inserts a new resource into this collection. (playlists.insert) 58 * 59 * @param string|array $part The *part* parameter serves two purposes in this 60 * operation. It identifies the properties that the write operation will set as 61 * well as the properties that the API response will include. 62 * @param Playlist $postBody 63 * @param array $optParams Optional parameters. 64 * 65 * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended 66 * exclusively for YouTube content partners. The *onBehalfOfContentOwner* 67 * parameter indicates that the request's authorization credentials identify a 68 * YouTube CMS user who is acting on behalf of the content owner specified in 69 * the parameter value. This parameter is intended for YouTube content partners 70 * that own and manage many different YouTube channels. It allows content owners 71 * to authenticate once and get access to all their video and channel data, 72 * without having to provide authentication credentials for each individual 73 * channel. The CMS account that the user authenticates with must be linked to 74 * the specified YouTube content owner. 75 * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be 76 * used in a properly authorized request. *Note:* This parameter is intended 77 * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel* 78 * parameter specifies the YouTube channel ID of the channel to which a video is 79 * being added. This parameter is required when a request specifies a value for 80 * the onBehalfOfContentOwner parameter, and it can only be used in conjunction 81 * with that parameter. In addition, the request must be authorized using a CMS 82 * account that is linked to the content owner that the onBehalfOfContentOwner 83 * parameter specifies. Finally, the channel that the 84 * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the 85 * content owner that the onBehalfOfContentOwner parameter specifies. This 86 * parameter is intended for YouTube content partners that own and manage many 87 * different YouTube channels. It allows content owners to authenticate once and 88 * perform actions on behalf of the channel specified in the parameter value, 89 * without having to provide authentication credentials for each separate 90 * channel. 91 * @return Playlist 92 */ 93 public function insert($part, Playlist $postBody, $optParams = []) 94 { 95 $params = ['part' => $part, 'postBody' => $postBody]; 96 $params = array_merge($params, $optParams); 97 return $this->call('insert', [$params], Playlist::class); 98 } 99 /** 100 * Retrieves a list of resources, possibly filtered. (playlists.listPlaylists) 101 * 102 * @param string|array $part The *part* parameter specifies a comma-separated 103 * list of one or more playlist resource properties that the API response will 104 * include. If the parameter identifies a property that contains child 105 * properties, the child properties will be included in the response. For 106 * example, in a playlist resource, the snippet property contains properties 107 * like author, title, description, tags, and timeCreated. As such, if you set 108 * *part=snippet*, the API response will contain all of those properties. 109 * @param array $optParams Optional parameters. 110 * 111 * @opt_param string channelId Return the playlists owned by the specified 112 * channel ID. 113 * @opt_param string hl Returen content in specified language 114 * @opt_param string id Return the playlists with the given IDs for Stubby or 115 * Apiary. 116 * @opt_param string maxResults The *maxResults* parameter specifies the maximum 117 * number of items that should be returned in the result set. 118 * @opt_param bool mine Return the playlists owned by the authenticated user. 119 * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended 120 * exclusively for YouTube content partners. The *onBehalfOfContentOwner* 121 * parameter indicates that the request's authorization credentials identify a 122 * YouTube CMS user who is acting on behalf of the content owner specified in 123 * the parameter value. This parameter is intended for YouTube content partners 124 * that own and manage many different YouTube channels. It allows content owners 125 * to authenticate once and get access to all their video and channel data, 126 * without having to provide authentication credentials for each individual 127 * channel. The CMS account that the user authenticates with must be linked to 128 * the specified YouTube content owner. 129 * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be 130 * used in a properly authorized request. *Note:* This parameter is intended 131 * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel* 132 * parameter specifies the YouTube channel ID of the channel to which a video is 133 * being added. This parameter is required when a request specifies a value for 134 * the onBehalfOfContentOwner parameter, and it can only be used in conjunction 135 * with that parameter. In addition, the request must be authorized using a CMS 136 * account that is linked to the content owner that the onBehalfOfContentOwner 137 * parameter specifies. Finally, the channel that the 138 * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the 139 * content owner that the onBehalfOfContentOwner parameter specifies. This 140 * parameter is intended for YouTube content partners that own and manage many 141 * different YouTube channels. It allows content owners to authenticate once and 142 * perform actions on behalf of the channel specified in the parameter value, 143 * without having to provide authentication credentials for each separate 144 * channel. 145 * @opt_param string pageToken The *pageToken* parameter identifies a specific 146 * page in the result set that should be returned. In an API response, the 147 * nextPageToken and prevPageToken properties identify other pages that could be 148 * retrieved. 149 * @return PlaylistListResponse 150 */ 151 public function listPlaylists($part, $optParams = []) 152 { 153 $params = ['part' => $part]; 154 $params = array_merge($params, $optParams); 155 return $this->call('list', [$params], PlaylistListResponse::class); 156 } 157 /** 158 * Updates an existing resource. (playlists.update) 159 * 160 * @param string|array $part The *part* parameter serves two purposes in this 161 * operation. It identifies the properties that the write operation will set as 162 * well as the properties that the API response will include. Note that this 163 * method will override the existing values for mutable properties that are 164 * contained in any parts that the request body specifies. For example, a 165 * playlist's description is contained in the snippet part, which must be 166 * included in the request body. If the request does not specify a value for the 167 * snippet.description property, the playlist's existing description will be 168 * deleted. 169 * @param Playlist $postBody 170 * @param array $optParams Optional parameters. 171 * 172 * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended 173 * exclusively for YouTube content partners. The *onBehalfOfContentOwner* 174 * parameter indicates that the request's authorization credentials identify a 175 * YouTube CMS user who is acting on behalf of the content owner specified in 176 * the parameter value. This parameter is intended for YouTube content partners 177 * that own and manage many different YouTube channels. It allows content owners 178 * to authenticate once and get access to all their video and channel data, 179 * without having to provide authentication credentials for each individual 180 * channel. The CMS account that the user authenticates with must be linked to 181 * the specified YouTube content owner. 182 * @return Playlist 183 */ 184 public function update($part, Playlist $postBody, $optParams = []) 185 { 186 $params = ['part' => $part, 'postBody' => $postBody]; 187 $params = array_merge($params, $optParams); 188 return $this->call('update', [$params], Playlist::class); 189 } 190} 191 192// Adding a class alias for backwards compatibility with the previous class name. 193class_alias(Playlists::class, 'Google_Service_YouTube_Resource_Playlists'); 194