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