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\LiveStream;
21use Google\Service\YouTube\LiveStreamListResponse;
22
23/**
24 * The "liveStreams" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $youtubeService = new Google\Service\YouTube(...);
28 *   $liveStreams = $youtubeService->liveStreams;
29 *  </code>
30 */
31class LiveStreams extends \Google\Service\Resource
32{
33  /**
34   * Deletes an existing stream for the authenticated user. (liveStreams.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   * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
50   * used in a properly authorized request. *Note:* This parameter is intended
51   * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
52   * parameter specifies the YouTube channel ID of the channel to which a video is
53   * being added. This parameter is required when a request specifies a value for
54   * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
55   * with that parameter. In addition, the request must be authorized using a CMS
56   * account that is linked to the content owner that the onBehalfOfContentOwner
57   * parameter specifies. Finally, the channel that the
58   * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
59   * content owner that the onBehalfOfContentOwner parameter specifies. This
60   * parameter is intended for YouTube content partners that own and manage many
61   * different YouTube channels. It allows content owners to authenticate once and
62   * perform actions on behalf of the channel specified in the parameter value,
63   * without having to provide authentication credentials for each separate
64   * channel.
65   */
66  public function delete($id, $optParams = [])
67  {
68    $params = ['id' => $id];
69    $params = array_merge($params, $optParams);
70    return $this->call('delete', [$params]);
71  }
72  /**
73   * Inserts a new stream for the authenticated user. (liveStreams.insert)
74   *
75   * @param string|array $part The *part* parameter serves two purposes in this
76   * operation. It identifies the properties that the write operation will set as
77   * well as the properties that the API response will include. The part
78   * properties that you can include in the parameter value are id, snippet, cdn,
79   * content_details, and status.
80   * @param LiveStream $postBody
81   * @param array $optParams Optional parameters.
82   *
83   * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
84   * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
85   * parameter indicates that the request's authorization credentials identify a
86   * YouTube CMS user who is acting on behalf of the content owner specified in
87   * the parameter value. This parameter is intended for YouTube content partners
88   * that own and manage many different YouTube channels. It allows content owners
89   * to authenticate once and get access to all their video and channel data,
90   * without having to provide authentication credentials for each individual
91   * channel. The CMS account that the user authenticates with must be linked to
92   * the specified YouTube content owner.
93   * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
94   * used in a properly authorized request. *Note:* This parameter is intended
95   * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
96   * parameter specifies the YouTube channel ID of the channel to which a video is
97   * being added. This parameter is required when a request specifies a value for
98   * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
99   * with that parameter. In addition, the request must be authorized using a CMS
100   * account that is linked to the content owner that the onBehalfOfContentOwner
101   * parameter specifies. Finally, the channel that the
102   * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
103   * content owner that the onBehalfOfContentOwner parameter specifies. This
104   * parameter is intended for YouTube content partners that own and manage many
105   * different YouTube channels. It allows content owners to authenticate once and
106   * perform actions on behalf of the channel specified in the parameter value,
107   * without having to provide authentication credentials for each separate
108   * channel.
109   * @return LiveStream
110   */
111  public function insert($part, LiveStream $postBody, $optParams = [])
112  {
113    $params = ['part' => $part, 'postBody' => $postBody];
114    $params = array_merge($params, $optParams);
115    return $this->call('insert', [$params], LiveStream::class);
116  }
117  /**
118   * Retrieve the list of streams associated with the given channel. --
119   * (liveStreams.listLiveStreams)
120   *
121   * @param string|array $part The *part* parameter specifies a comma-separated
122   * list of one or more liveStream resource properties that the API response will
123   * include. The part names that you can include in the parameter value are id,
124   * snippet, cdn, and status.
125   * @param array $optParams Optional parameters.
126   *
127   * @opt_param string id Return LiveStreams with the given ids from Stubby or
128   * Apiary.
129   * @opt_param string maxResults The *maxResults* parameter specifies the maximum
130   * number of items that should be returned in the result set.
131   * @opt_param bool mine
132   * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
133   * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
134   * parameter indicates that the request's authorization credentials identify a
135   * YouTube CMS user who is acting on behalf of the content owner specified in
136   * the parameter value. This parameter is intended for YouTube content partners
137   * that own and manage many different YouTube channels. It allows content owners
138   * to authenticate once and get access to all their video and channel data,
139   * without having to provide authentication credentials for each individual
140   * channel. The CMS account that the user authenticates with must be linked to
141   * the specified YouTube content owner.
142   * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
143   * used in a properly authorized request. *Note:* This parameter is intended
144   * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
145   * parameter specifies the YouTube channel ID of the channel to which a video is
146   * being added. This parameter is required when a request specifies a value for
147   * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
148   * with that parameter. In addition, the request must be authorized using a CMS
149   * account that is linked to the content owner that the onBehalfOfContentOwner
150   * parameter specifies. Finally, the channel that the
151   * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
152   * content owner that the onBehalfOfContentOwner parameter specifies. This
153   * parameter is intended for YouTube content partners that own and manage many
154   * different YouTube channels. It allows content owners to authenticate once and
155   * perform actions on behalf of the channel specified in the parameter value,
156   * without having to provide authentication credentials for each separate
157   * channel.
158   * @opt_param string pageToken The *pageToken* parameter identifies a specific
159   * page in the result set that should be returned. In an API response, the
160   * nextPageToken and prevPageToken properties identify other pages that could be
161   * retrieved.
162   * @return LiveStreamListResponse
163   */
164  public function listLiveStreams($part, $optParams = [])
165  {
166    $params = ['part' => $part];
167    $params = array_merge($params, $optParams);
168    return $this->call('list', [$params], LiveStreamListResponse::class);
169  }
170  /**
171   * Updates an existing stream for the authenticated user. (liveStreams.update)
172   *
173   * @param string|array $part The *part* parameter serves two purposes in this
174   * operation. It identifies the properties that the write operation will set as
175   * well as the properties that the API response will include. The part
176   * properties that you can include in the parameter value are id, snippet, cdn,
177   * and status. Note that this method will override the existing values for all
178   * of the mutable properties that are contained in any parts that the parameter
179   * value specifies. If the request body does not specify a value for a mutable
180   * property, the existing value for that property will be removed.
181   * @param LiveStream $postBody
182   * @param array $optParams Optional parameters.
183   *
184   * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
185   * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
186   * parameter indicates that the request's authorization credentials identify a
187   * YouTube CMS user who is acting on behalf of the content owner specified in
188   * the parameter value. This parameter is intended for YouTube content partners
189   * that own and manage many different YouTube channels. It allows content owners
190   * to authenticate once and get access to all their video and channel data,
191   * without having to provide authentication credentials for each individual
192   * channel. The CMS account that the user authenticates with must be linked to
193   * the specified YouTube content owner.
194   * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
195   * used in a properly authorized request. *Note:* This parameter is intended
196   * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
197   * parameter specifies the YouTube channel ID of the channel to which a video is
198   * being added. This parameter is required when a request specifies a value for
199   * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
200   * with that parameter. In addition, the request must be authorized using a CMS
201   * account that is linked to the content owner that the onBehalfOfContentOwner
202   * parameter specifies. Finally, the channel that the
203   * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
204   * content owner that the onBehalfOfContentOwner parameter specifies. This
205   * parameter is intended for YouTube content partners that own and manage many
206   * different YouTube channels. It allows content owners to authenticate once and
207   * perform actions on behalf of the channel specified in the parameter value,
208   * without having to provide authentication credentials for each separate
209   * channel.
210   * @return LiveStream
211   */
212  public function update($part, LiveStream $postBody, $optParams = [])
213  {
214    $params = ['part' => $part, 'postBody' => $postBody];
215    $params = array_merge($params, $optParams);
216    return $this->call('update', [$params], LiveStream::class);
217  }
218}
219
220// Adding a class alias for backwards compatibility with the previous class name.
221class_alias(LiveStreams::class, 'Google_Service_YouTube_Resource_LiveStreams');
222