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