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