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\Cuepoint;
|
---|
21 | use Google\Service\YouTube\LiveBroadcast;
|
---|
22 | use Google\Service\YouTube\LiveBroadcastListResponse;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "liveBroadcasts" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $youtubeService = new Google\Service\YouTube(...);
|
---|
29 | * $liveBroadcasts = $youtubeService->liveBroadcasts;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class LiveBroadcasts extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Bind a broadcast to a stream. (liveBroadcasts.bind)
|
---|
36 | *
|
---|
37 | * @param string $id Broadcast to bind to the stream
|
---|
38 | * @param string|array $part The *part* parameter specifies a comma-separated
|
---|
39 | * list of one or more liveBroadcast resource properties that the API response
|
---|
40 | * will include. The part names that you can include in the parameter value are
|
---|
41 | * id, snippet, contentDetails, and status.
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | *
|
---|
44 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
45 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
46 | * parameter indicates that the request's authorization credentials identify a
|
---|
47 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
48 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
49 | * that own and manage many different YouTube channels. It allows content owners
|
---|
50 | * to authenticate once and get access to all their video and channel data,
|
---|
51 | * without having to provide authentication credentials for each individual
|
---|
52 | * channel. The CMS account that the user authenticates with must be linked to
|
---|
53 | * the specified YouTube content owner.
|
---|
54 | * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
|
---|
55 | * used in a properly authorized request. *Note:* This parameter is intended
|
---|
56 | * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
|
---|
57 | * parameter specifies the YouTube channel ID of the channel to which a video is
|
---|
58 | * being added. This parameter is required when a request specifies a value for
|
---|
59 | * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
|
---|
60 | * with that parameter. In addition, the request must be authorized using a CMS
|
---|
61 | * account that is linked to the content owner that the onBehalfOfContentOwner
|
---|
62 | * parameter specifies. Finally, the channel that the
|
---|
63 | * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
|
---|
64 | * content owner that the onBehalfOfContentOwner parameter specifies. This
|
---|
65 | * parameter is intended for YouTube content partners that own and manage many
|
---|
66 | * different YouTube channels. It allows content owners to authenticate once and
|
---|
67 | * perform actions on behalf of the channel specified in the parameter value,
|
---|
68 | * without having to provide authentication credentials for each separate
|
---|
69 | * channel.
|
---|
70 | * @opt_param string streamId Stream to bind, if not set unbind the current one.
|
---|
71 | * @return LiveBroadcast
|
---|
72 | * @throws \Google\Service\Exception
|
---|
73 | */
|
---|
74 | public function bind($id, $part, $optParams = [])
|
---|
75 | {
|
---|
76 | $params = ['id' => $id, 'part' => $part];
|
---|
77 | $params = array_merge($params, $optParams);
|
---|
78 | return $this->call('bind', [$params], LiveBroadcast::class);
|
---|
79 | }
|
---|
80 | /**
|
---|
81 | * Delete a given broadcast. (liveBroadcasts.delete)
|
---|
82 | *
|
---|
83 | * @param string $id Broadcast to delete.
|
---|
84 | * @param array $optParams Optional parameters.
|
---|
85 | *
|
---|
86 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
87 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
88 | * parameter indicates that the request's authorization credentials identify a
|
---|
89 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
90 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
91 | * that own and manage many different YouTube channels. It allows content owners
|
---|
92 | * to authenticate once and get access to all their video and channel data,
|
---|
93 | * without having to provide authentication credentials for each individual
|
---|
94 | * channel. The CMS account that the user authenticates with must be linked to
|
---|
95 | * the specified YouTube content owner.
|
---|
96 | * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
|
---|
97 | * used in a properly authorized request. *Note:* This parameter is intended
|
---|
98 | * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
|
---|
99 | * parameter specifies the YouTube channel ID of the channel to which a video is
|
---|
100 | * being added. This parameter is required when a request specifies a value for
|
---|
101 | * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
|
---|
102 | * with that parameter. In addition, the request must be authorized using a CMS
|
---|
103 | * account that is linked to the content owner that the onBehalfOfContentOwner
|
---|
104 | * parameter specifies. Finally, the channel that the
|
---|
105 | * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
|
---|
106 | * content owner that the onBehalfOfContentOwner parameter specifies. This
|
---|
107 | * parameter is intended for YouTube content partners that own and manage many
|
---|
108 | * different YouTube channels. It allows content owners to authenticate once and
|
---|
109 | * perform actions on behalf of the channel specified in the parameter value,
|
---|
110 | * without having to provide authentication credentials for each separate
|
---|
111 | * channel.
|
---|
112 | * @throws \Google\Service\Exception
|
---|
113 | */
|
---|
114 | public function delete($id, $optParams = [])
|
---|
115 | {
|
---|
116 | $params = ['id' => $id];
|
---|
117 | $params = array_merge($params, $optParams);
|
---|
118 | return $this->call('delete', [$params]);
|
---|
119 | }
|
---|
120 | /**
|
---|
121 | * Inserts a new stream for the authenticated user. (liveBroadcasts.insert)
|
---|
122 | *
|
---|
123 | * @param string|array $part The *part* parameter serves two purposes in this
|
---|
124 | * operation. It identifies the properties that the write operation will set as
|
---|
125 | * well as the properties that the API response will include. The part
|
---|
126 | * properties that you can include in the parameter value are id, snippet,
|
---|
127 | * contentDetails, and status.
|
---|
128 | * @param LiveBroadcast $postBody
|
---|
129 | * @param array $optParams Optional parameters.
|
---|
130 | *
|
---|
131 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
132 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
133 | * parameter indicates that the request's authorization credentials identify a
|
---|
134 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
135 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
136 | * that own and manage many different YouTube channels. It allows content owners
|
---|
137 | * to authenticate once and get access to all their video and channel data,
|
---|
138 | * without having to provide authentication credentials for each individual
|
---|
139 | * channel. The CMS account that the user authenticates with must be linked to
|
---|
140 | * the specified YouTube content owner.
|
---|
141 | * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
|
---|
142 | * used in a properly authorized request. *Note:* This parameter is intended
|
---|
143 | * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
|
---|
144 | * parameter specifies the YouTube channel ID of the channel to which a video is
|
---|
145 | * being added. This parameter is required when a request specifies a value for
|
---|
146 | * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
|
---|
147 | * with that parameter. In addition, the request must be authorized using a CMS
|
---|
148 | * account that is linked to the content owner that the onBehalfOfContentOwner
|
---|
149 | * parameter specifies. Finally, the channel that the
|
---|
150 | * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
|
---|
151 | * content owner that the onBehalfOfContentOwner parameter specifies. This
|
---|
152 | * parameter is intended for YouTube content partners that own and manage many
|
---|
153 | * different YouTube channels. It allows content owners to authenticate once and
|
---|
154 | * perform actions on behalf of the channel specified in the parameter value,
|
---|
155 | * without having to provide authentication credentials for each separate
|
---|
156 | * channel.
|
---|
157 | * @return LiveBroadcast
|
---|
158 | * @throws \Google\Service\Exception
|
---|
159 | */
|
---|
160 | public function insert($part, LiveBroadcast $postBody, $optParams = [])
|
---|
161 | {
|
---|
162 | $params = ['part' => $part, 'postBody' => $postBody];
|
---|
163 | $params = array_merge($params, $optParams);
|
---|
164 | return $this->call('insert', [$params], LiveBroadcast::class);
|
---|
165 | }
|
---|
166 | /**
|
---|
167 | * Insert cuepoints in a broadcast (liveBroadcasts.insertCuepoint)
|
---|
168 | *
|
---|
169 | * @param Cuepoint $postBody
|
---|
170 | * @param array $optParams Optional parameters.
|
---|
171 | *
|
---|
172 | * @opt_param string id Broadcast to insert ads to, or equivalently
|
---|
173 | * `external_video_id` for internal use.
|
---|
174 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
175 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
176 | * parameter indicates that the request's authorization credentials identify a
|
---|
177 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
178 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
179 | * that own and manage many different YouTube channels. It allows content owners
|
---|
180 | * to authenticate once and get access to all their video and channel data,
|
---|
181 | * without having to provide authentication credentials for each individual
|
---|
182 | * channel. The CMS account that the user authenticates with must be linked to
|
---|
183 | * the specified YouTube content owner.
|
---|
184 | * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
|
---|
185 | * used in a properly authorized request. *Note:* This parameter is intended
|
---|
186 | * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
|
---|
187 | * parameter specifies the YouTube channel ID of the channel to which a video is
|
---|
188 | * being added. This parameter is required when a request specifies a value for
|
---|
189 | * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
|
---|
190 | * with that parameter. In addition, the request must be authorized using a CMS
|
---|
191 | * account that is linked to the content owner that the onBehalfOfContentOwner
|
---|
192 | * parameter specifies. Finally, the channel that the
|
---|
193 | * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
|
---|
194 | * content owner that the onBehalfOfContentOwner parameter specifies. This
|
---|
195 | * parameter is intended for YouTube content partners that own and manage many
|
---|
196 | * different YouTube channels. It allows content owners to authenticate once and
|
---|
197 | * perform actions on behalf of the channel specified in the parameter value,
|
---|
198 | * without having to provide authentication credentials for each separate
|
---|
199 | * channel.
|
---|
200 | * @opt_param string part The *part* parameter specifies a comma-separated list
|
---|
201 | * of one or more liveBroadcast resource properties that the API response will
|
---|
202 | * include. The part names that you can include in the parameter value are id,
|
---|
203 | * snippet, contentDetails, and status.
|
---|
204 | * @return Cuepoint
|
---|
205 | * @throws \Google\Service\Exception
|
---|
206 | */
|
---|
207 | public function insertCuepoint(Cuepoint $postBody, $optParams = [])
|
---|
208 | {
|
---|
209 | $params = ['postBody' => $postBody];
|
---|
210 | $params = array_merge($params, $optParams);
|
---|
211 | return $this->call('insertCuepoint', [$params], Cuepoint::class);
|
---|
212 | }
|
---|
213 | /**
|
---|
214 | * Retrieve the list of broadcasts associated with the given channel.
|
---|
215 | * (liveBroadcasts.listLiveBroadcasts)
|
---|
216 | *
|
---|
217 | * @param string|array $part The *part* parameter specifies a comma-separated
|
---|
218 | * list of one or more liveBroadcast resource properties that the API response
|
---|
219 | * will include. The part names that you can include in the parameter value are
|
---|
220 | * id, snippet, contentDetails, status and statistics.
|
---|
221 | * @param array $optParams Optional parameters.
|
---|
222 | *
|
---|
223 | * @opt_param string broadcastStatus Return broadcasts with a certain status,
|
---|
224 | * e.g. active broadcasts.
|
---|
225 | * @opt_param string broadcastType Return only broadcasts with the selected
|
---|
226 | * type.
|
---|
227 | * @opt_param string id Return broadcasts with the given ids from Stubby or
|
---|
228 | * Apiary.
|
---|
229 | * @opt_param string maxResults The *maxResults* parameter specifies the maximum
|
---|
230 | * number of items that should be returned in the result set.
|
---|
231 | * @opt_param bool mine
|
---|
232 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
233 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
234 | * parameter indicates that the request's authorization credentials identify a
|
---|
235 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
236 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
237 | * that own and manage many different YouTube channels. It allows content owners
|
---|
238 | * to authenticate once and get access to all their video and channel data,
|
---|
239 | * without having to provide authentication credentials for each individual
|
---|
240 | * channel. The CMS account that the user authenticates with must be linked to
|
---|
241 | * the specified YouTube content owner.
|
---|
242 | * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
|
---|
243 | * used in a properly authorized request. *Note:* This parameter is intended
|
---|
244 | * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
|
---|
245 | * parameter specifies the YouTube channel ID of the channel to which a video is
|
---|
246 | * being added. This parameter is required when a request specifies a value for
|
---|
247 | * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
|
---|
248 | * with that parameter. In addition, the request must be authorized using a CMS
|
---|
249 | * account that is linked to the content owner that the onBehalfOfContentOwner
|
---|
250 | * parameter specifies. Finally, the channel that the
|
---|
251 | * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
|
---|
252 | * content owner that the onBehalfOfContentOwner parameter specifies. This
|
---|
253 | * parameter is intended for YouTube content partners that own and manage many
|
---|
254 | * different YouTube channels. It allows content owners to authenticate once and
|
---|
255 | * perform actions on behalf of the channel specified in the parameter value,
|
---|
256 | * without having to provide authentication credentials for each separate
|
---|
257 | * channel.
|
---|
258 | * @opt_param string pageToken The *pageToken* parameter identifies a specific
|
---|
259 | * page in the result set that should be returned. In an API response, the
|
---|
260 | * nextPageToken and prevPageToken properties identify other pages that could be
|
---|
261 | * retrieved.
|
---|
262 | * @return LiveBroadcastListResponse
|
---|
263 | * @throws \Google\Service\Exception
|
---|
264 | */
|
---|
265 | public function listLiveBroadcasts($part, $optParams = [])
|
---|
266 | {
|
---|
267 | $params = ['part' => $part];
|
---|
268 | $params = array_merge($params, $optParams);
|
---|
269 | return $this->call('list', [$params], LiveBroadcastListResponse::class);
|
---|
270 | }
|
---|
271 | /**
|
---|
272 | * Transition a broadcast to a given status. (liveBroadcasts.transition)
|
---|
273 | *
|
---|
274 | * @param string $broadcastStatus The status to which the broadcast is going to
|
---|
275 | * transition.
|
---|
276 | * @param string $id Broadcast to transition.
|
---|
277 | * @param string|array $part The *part* parameter specifies a comma-separated
|
---|
278 | * list of one or more liveBroadcast resource properties that the API response
|
---|
279 | * will include. The part names that you can include in the parameter value are
|
---|
280 | * id, snippet, contentDetails, and status.
|
---|
281 | * @param array $optParams Optional parameters.
|
---|
282 | *
|
---|
283 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
284 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
285 | * parameter indicates that the request's authorization credentials identify a
|
---|
286 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
287 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
288 | * that own and manage many different YouTube channels. It allows content owners
|
---|
289 | * to authenticate once and get access to all their video and channel data,
|
---|
290 | * without having to provide authentication credentials for each individual
|
---|
291 | * channel. The CMS account that the user authenticates with must be linked to
|
---|
292 | * the specified YouTube content owner.
|
---|
293 | * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
|
---|
294 | * used in a properly authorized request. *Note:* This parameter is intended
|
---|
295 | * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
|
---|
296 | * parameter specifies the YouTube channel ID of the channel to which a video is
|
---|
297 | * being added. This parameter is required when a request specifies a value for
|
---|
298 | * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
|
---|
299 | * with that parameter. In addition, the request must be authorized using a CMS
|
---|
300 | * account that is linked to the content owner that the onBehalfOfContentOwner
|
---|
301 | * parameter specifies. Finally, the channel that the
|
---|
302 | * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
|
---|
303 | * content owner that the onBehalfOfContentOwner parameter specifies. This
|
---|
304 | * parameter is intended for YouTube content partners that own and manage many
|
---|
305 | * different YouTube channels. It allows content owners to authenticate once and
|
---|
306 | * perform actions on behalf of the channel specified in the parameter value,
|
---|
307 | * without having to provide authentication credentials for each separate
|
---|
308 | * channel.
|
---|
309 | * @return LiveBroadcast
|
---|
310 | * @throws \Google\Service\Exception
|
---|
311 | */
|
---|
312 | public function transition($broadcastStatus, $id, $part, $optParams = [])
|
---|
313 | {
|
---|
314 | $params = ['broadcastStatus' => $broadcastStatus, 'id' => $id, 'part' => $part];
|
---|
315 | $params = array_merge($params, $optParams);
|
---|
316 | return $this->call('transition', [$params], LiveBroadcast::class);
|
---|
317 | }
|
---|
318 | /**
|
---|
319 | * Updates an existing broadcast for the authenticated user.
|
---|
320 | * (liveBroadcasts.update)
|
---|
321 | *
|
---|
322 | * @param string|array $part The *part* parameter serves two purposes in this
|
---|
323 | * operation. It identifies the properties that the write operation will set as
|
---|
324 | * well as the properties that the API response will include. The part
|
---|
325 | * properties that you can include in the parameter value are id, snippet,
|
---|
326 | * contentDetails, and status. Note that this method will override the existing
|
---|
327 | * values for all of the mutable properties that are contained in any parts that
|
---|
328 | * the parameter value specifies. For example, a broadcast's privacy status is
|
---|
329 | * defined in the status part. As such, if your request is updating a private or
|
---|
330 | * unlisted broadcast, and the request's part parameter value includes the
|
---|
331 | * status part, the broadcast's privacy setting will be updated to whatever
|
---|
332 | * value the request body specifies. If the request body does not specify a
|
---|
333 | * value, the existing privacy setting will be removed and the broadcast will
|
---|
334 | * revert to the default privacy setting.
|
---|
335 | * @param LiveBroadcast $postBody
|
---|
336 | * @param array $optParams Optional parameters.
|
---|
337 | *
|
---|
338 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
339 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
340 | * parameter indicates that the request's authorization credentials identify a
|
---|
341 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
342 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
343 | * that own and manage many different YouTube channels. It allows content owners
|
---|
344 | * to authenticate once and get access to all their video and channel data,
|
---|
345 | * without having to provide authentication credentials for each individual
|
---|
346 | * channel. The CMS account that the user authenticates with must be linked to
|
---|
347 | * the specified YouTube content owner.
|
---|
348 | * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
|
---|
349 | * used in a properly authorized request. *Note:* This parameter is intended
|
---|
350 | * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
|
---|
351 | * parameter specifies the YouTube channel ID of the channel to which a video is
|
---|
352 | * being added. This parameter is required when a request specifies a value for
|
---|
353 | * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
|
---|
354 | * with that parameter. In addition, the request must be authorized using a CMS
|
---|
355 | * account that is linked to the content owner that the onBehalfOfContentOwner
|
---|
356 | * parameter specifies. Finally, the channel that the
|
---|
357 | * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
|
---|
358 | * content owner that the onBehalfOfContentOwner parameter specifies. This
|
---|
359 | * parameter is intended for YouTube content partners that own and manage many
|
---|
360 | * different YouTube channels. It allows content owners to authenticate once and
|
---|
361 | * perform actions on behalf of the channel specified in the parameter value,
|
---|
362 | * without having to provide authentication credentials for each separate
|
---|
363 | * channel.
|
---|
364 | * @return LiveBroadcast
|
---|
365 | * @throws \Google\Service\Exception
|
---|
366 | */
|
---|
367 | public function update($part, LiveBroadcast $postBody, $optParams = [])
|
---|
368 | {
|
---|
369 | $params = ['part' => $part, 'postBody' => $postBody];
|
---|
370 | $params = array_merge($params, $optParams);
|
---|
371 | return $this->call('update', [$params], LiveBroadcast::class);
|
---|
372 | }
|
---|
373 | }
|
---|
374 |
|
---|
375 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
376 | class_alias(LiveBroadcasts::class, 'Google_Service_YouTube_Resource_LiveBroadcasts');
|
---|