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