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\PlaylistItem;
|
---|
21 | use Google\Service\YouTube\PlaylistItemListResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "playlistItems" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $youtubeService = new Google\Service\YouTube(...);
|
---|
28 | * $playlistItems = $youtubeService->playlistItems;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class PlaylistItems extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Deletes a resource. (playlistItems.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. (playlistItems.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 PlaylistItem $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 | * @return PlaylistItem
|
---|
77 | * @throws \Google\Service\Exception
|
---|
78 | */
|
---|
79 | public function insert($part, PlaylistItem $postBody, $optParams = [])
|
---|
80 | {
|
---|
81 | $params = ['part' => $part, 'postBody' => $postBody];
|
---|
82 | $params = array_merge($params, $optParams);
|
---|
83 | return $this->call('insert', [$params], PlaylistItem::class);
|
---|
84 | }
|
---|
85 | /**
|
---|
86 | * Retrieves a list of resources, possibly filtered.
|
---|
87 | * (playlistItems.listPlaylistItems)
|
---|
88 | *
|
---|
89 | * @param string|array $part The *part* parameter specifies a comma-separated
|
---|
90 | * list of one or more playlistItem resource properties that the API response
|
---|
91 | * will include. If the parameter identifies a property that contains child
|
---|
92 | * properties, the child properties will be included in the response. For
|
---|
93 | * example, in a playlistItem resource, the snippet property contains numerous
|
---|
94 | * fields, including the title, description, position, and resourceId
|
---|
95 | * properties. As such, if you set *part=snippet*, the API response will contain
|
---|
96 | * all of those properties.
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | *
|
---|
99 | * @opt_param string id
|
---|
100 | * @opt_param string maxResults The *maxResults* parameter specifies the maximum
|
---|
101 | * number of items that should be returned in the result set.
|
---|
102 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
103 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
104 | * parameter indicates that the request's authorization credentials identify a
|
---|
105 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
106 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
107 | * that own and manage many different YouTube channels. It allows content owners
|
---|
108 | * to authenticate once and get access to all their video and channel data,
|
---|
109 | * without having to provide authentication credentials for each individual
|
---|
110 | * channel. The CMS account that the user authenticates with must be linked to
|
---|
111 | * the specified YouTube content owner.
|
---|
112 | * @opt_param string pageToken The *pageToken* parameter identifies a specific
|
---|
113 | * page in the result set that should be returned. In an API response, the
|
---|
114 | * nextPageToken and prevPageToken properties identify other pages that could be
|
---|
115 | * retrieved.
|
---|
116 | * @opt_param string playlistId Return the playlist items within the given
|
---|
117 | * playlist.
|
---|
118 | * @opt_param string videoId Return the playlist items associated with the given
|
---|
119 | * video ID.
|
---|
120 | * @return PlaylistItemListResponse
|
---|
121 | * @throws \Google\Service\Exception
|
---|
122 | */
|
---|
123 | public function listPlaylistItems($part, $optParams = [])
|
---|
124 | {
|
---|
125 | $params = ['part' => $part];
|
---|
126 | $params = array_merge($params, $optParams);
|
---|
127 | return $this->call('list', [$params], PlaylistItemListResponse::class);
|
---|
128 | }
|
---|
129 | /**
|
---|
130 | * Updates an existing resource. (playlistItems.update)
|
---|
131 | *
|
---|
132 | * @param string|array $part The *part* parameter serves two purposes in this
|
---|
133 | * operation. It identifies the properties that the write operation will set as
|
---|
134 | * well as the properties that the API response will include. Note that this
|
---|
135 | * method will override the existing values for all of the mutable properties
|
---|
136 | * that are contained in any parts that the parameter value specifies. For
|
---|
137 | * example, a playlist item can specify a start time and end time, which
|
---|
138 | * identify the times portion of the video that should play when users watch the
|
---|
139 | * video in the playlist. If your request is updating a playlist item that sets
|
---|
140 | * these values, and the request's part parameter value includes the
|
---|
141 | * contentDetails part, the playlist item's start and end times will be updated
|
---|
142 | * to whatever value the request body specifies. If the request body does not
|
---|
143 | * specify values, the existing start and end times will be removed and replaced
|
---|
144 | * with the default settings.
|
---|
145 | * @param PlaylistItem $postBody
|
---|
146 | * @param array $optParams Optional parameters.
|
---|
147 | *
|
---|
148 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
149 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
150 | * parameter indicates that the request's authorization credentials identify a
|
---|
151 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
152 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
153 | * that own and manage many different YouTube channels. It allows content owners
|
---|
154 | * to authenticate once and get access to all their video and channel data,
|
---|
155 | * without having to provide authentication credentials for each individual
|
---|
156 | * channel. The CMS account that the user authenticates with must be linked to
|
---|
157 | * the specified YouTube content owner.
|
---|
158 | * @return PlaylistItem
|
---|
159 | * @throws \Google\Service\Exception
|
---|
160 | */
|
---|
161 | public function update($part, PlaylistItem $postBody, $optParams = [])
|
---|
162 | {
|
---|
163 | $params = ['part' => $part, 'postBody' => $postBody];
|
---|
164 | $params = array_merge($params, $optParams);
|
---|
165 | return $this->call('update', [$params], PlaylistItem::class);
|
---|
166 | }
|
---|
167 | }
|
---|
168 |
|
---|
169 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
170 | class_alias(PlaylistItems::class, 'Google_Service_YouTube_Resource_PlaylistItems');
|
---|