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\ChannelSection;
21use Google\Service\YouTube\ChannelSectionListResponse;
22
23/**
24 * The "channelSections" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $youtubeService = new Google\Service\YouTube(...);
28 *   $channelSections = $youtubeService->channelSections;
29 *  </code>
30 */
31class ChannelSections extends \Google\Service\Resource
32{
33  /**
34   * Deletes a resource. (channelSections.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. (channelSections.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. The part names
62   * that you can include in the parameter value are snippet and contentDetails.
63   * @param ChannelSection $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   * @opt_param string onBehalfOfContentOwnerChannel This parameter can only be
77   * used in a properly authorized request. *Note:* This parameter is intended
78   * exclusively for YouTube content partners. The *onBehalfOfContentOwnerChannel*
79   * parameter specifies the YouTube channel ID of the channel to which a video is
80   * being added. This parameter is required when a request specifies a value for
81   * the onBehalfOfContentOwner parameter, and it can only be used in conjunction
82   * with that parameter. In addition, the request must be authorized using a CMS
83   * account that is linked to the content owner that the onBehalfOfContentOwner
84   * parameter specifies. Finally, the channel that the
85   * onBehalfOfContentOwnerChannel parameter value specifies must be linked to the
86   * content owner that the onBehalfOfContentOwner parameter specifies. This
87   * parameter is intended for YouTube content partners that own and manage many
88   * different YouTube channels. It allows content owners to authenticate once and
89   * perform actions on behalf of the channel specified in the parameter value,
90   * without having to provide authentication credentials for each separate
91   * channel.
92   * @return ChannelSection
93   */
94  public function insert($part, ChannelSection $postBody, $optParams = [])
95  {
96    $params = ['part' => $part, 'postBody' => $postBody];
97    $params = array_merge($params, $optParams);
98    return $this->call('insert', [$params], ChannelSection::class);
99  }
100  /**
101   * Retrieves a list of resources, possibly filtered.
102   * (channelSections.listChannelSections)
103   *
104   * @param string|array $part The *part* parameter specifies a comma-separated
105   * list of one or more channelSection resource properties that the API response
106   * will include. The part names that you can include in the parameter value are
107   * id, snippet, and contentDetails. If the parameter identifies a property that
108   * contains child properties, the child properties will be included in the
109   * response. For example, in a channelSection resource, the snippet property
110   * contains other properties, such as a display title for the channelSection. If
111   * you set *part=snippet*, the API response will also contain all of those
112   * nested properties.
113   * @param array $optParams Optional parameters.
114   *
115   * @opt_param string channelId Return the ChannelSections owned by the specified
116   * channel ID.
117   * @opt_param string hl Return content in specified language
118   * @opt_param string id Return the ChannelSections with the given IDs for Stubby
119   * or Apiary.
120   * @opt_param bool mine Return the ChannelSections owned by the authenticated
121   * user.
122   * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
123   * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
124   * parameter indicates that the request's authorization credentials identify a
125   * YouTube CMS user who is acting on behalf of the content owner specified in
126   * the parameter value. This parameter is intended for YouTube content partners
127   * that own and manage many different YouTube channels. It allows content owners
128   * to authenticate once and get access to all their video and channel data,
129   * without having to provide authentication credentials for each individual
130   * channel. The CMS account that the user authenticates with must be linked to
131   * the specified YouTube content owner.
132   * @return ChannelSectionListResponse
133   */
134  public function listChannelSections($part, $optParams = [])
135  {
136    $params = ['part' => $part];
137    $params = array_merge($params, $optParams);
138    return $this->call('list', [$params], ChannelSectionListResponse::class);
139  }
140  /**
141   * Updates an existing resource. (channelSections.update)
142   *
143   * @param string|array $part The *part* parameter serves two purposes in this
144   * operation. It identifies the properties that the write operation will set as
145   * well as the properties that the API response will include. The part names
146   * that you can include in the parameter value are snippet and contentDetails.
147   * @param ChannelSection $postBody
148   * @param array $optParams Optional parameters.
149   *
150   * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
151   * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
152   * parameter indicates that the request's authorization credentials identify a
153   * YouTube CMS user who is acting on behalf of the content owner specified in
154   * the parameter value. This parameter is intended for YouTube content partners
155   * that own and manage many different YouTube channels. It allows content owners
156   * to authenticate once and get access to all their video and channel data,
157   * without having to provide authentication credentials for each individual
158   * channel. The CMS account that the user authenticates with must be linked to
159   * the specified YouTube content owner.
160   * @return ChannelSection
161   */
162  public function update($part, ChannelSection $postBody, $optParams = [])
163  {
164    $params = ['part' => $part, 'postBody' => $postBody];
165    $params = array_merge($params, $optParams);
166    return $this->call('update', [$params], ChannelSection::class);
167  }
168}
169
170// Adding a class alias for backwards compatibility with the previous class name.
171class_alias(ChannelSections::class, 'Google_Service_YouTube_Resource_ChannelSections');
172