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\YouTubeAnalytics\Resource;
19
20use Google\Service\YouTubeAnalytics\EmptyResponse;
21use Google\Service\YouTubeAnalytics\Group;
22use Google\Service\YouTubeAnalytics\ListGroupsResponse;
23
24/**
25 * The "groups" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $youtubeAnalyticsService = new Google\Service\YouTubeAnalytics(...);
29 *   $groups = $youtubeAnalyticsService->groups;
30 *  </code>
31 */
32class Groups extends \Google\Service\Resource
33{
34  /**
35   * Deletes a group. (groups.delete)
36   *
37   * @param array $optParams Optional parameters.
38   *
39   * @opt_param string id The `id` parameter specifies the YouTube group ID of the
40   * group that is being deleted.
41   * @opt_param string onBehalfOfContentOwner This parameter can only be used in a
42   * properly authorized request. **Note:** This parameter is intended exclusively
43   * for YouTube content partners that own and manage many different YouTube
44   * channels. The `onBehalfOfContentOwner` parameter indicates that the request's
45   * authorization credentials identify a YouTube user who is acting on behalf of
46   * the content owner specified in the parameter value. It allows content owners
47   * to authenticate once and get access to all their video and channel data,
48   * without having to provide authentication credentials for each individual
49   * channel. The account that the user authenticates with must be linked to the
50   * specified YouTube content owner.
51   * @return EmptyResponse
52   */
53  public function delete($optParams = [])
54  {
55    $params = [];
56    $params = array_merge($params, $optParams);
57    return $this->call('delete', [$params], EmptyResponse::class);
58  }
59  /**
60   * Creates a group. (groups.insert)
61   *
62   * @param Group $postBody
63   * @param array $optParams Optional parameters.
64   *
65   * @opt_param string onBehalfOfContentOwner This parameter can only be used in a
66   * properly authorized request. **Note:** This parameter is intended exclusively
67   * for YouTube content partners that own and manage many different YouTube
68   * channels. The `onBehalfOfContentOwner` parameter indicates that the request's
69   * authorization credentials identify a YouTube user who is acting on behalf of
70   * the content owner specified in the parameter value. 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 account that the user authenticates with must be linked to the
74   * specified YouTube content owner.
75   * @return Group
76   */
77  public function insert(Group $postBody, $optParams = [])
78  {
79    $params = ['postBody' => $postBody];
80    $params = array_merge($params, $optParams);
81    return $this->call('insert', [$params], Group::class);
82  }
83  /**
84   * Returns a collection of groups that match the API request parameters. For
85   * example, you can retrieve all groups that the authenticated user owns, or you
86   * can retrieve one or more groups by their unique IDs. (groups.listGroups)
87   *
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param string id The `id` parameter specifies a comma-separated list of
91   * the YouTube group ID(s) for the resource(s) that are being retrieved. Each
92   * group must be owned by the authenticated user. In a `group` resource, the
93   * `id` property specifies the group's YouTube group ID. Note that if you do not
94   * specify a value for the `id` parameter, then you must set the `mine`
95   * parameter to `true`.
96   * @opt_param bool mine This parameter can only be used in a properly authorized
97   * request. Set this parameter's value to true to retrieve all groups owned by
98   * the authenticated user.
99   * @opt_param string onBehalfOfContentOwner This parameter can only be used in a
100   * properly authorized request. **Note:** This parameter is intended exclusively
101   * for YouTube content partners that own and manage many different YouTube
102   * channels. The `onBehalfOfContentOwner` parameter indicates that the request's
103   * authorization credentials identify a YouTube user who is acting on behalf of
104   * the content owner specified in the parameter value. It allows content owners
105   * to authenticate once and get access to all their video and channel data,
106   * without having to provide authentication credentials for each individual
107   * channel. The account that the user authenticates with must be linked to the
108   * specified YouTube content owner.
109   * @opt_param string pageToken The `pageToken` parameter identifies a specific
110   * page in the result set that should be returned. In an API response, the
111   * `nextPageToken` property identifies the next page that can be retrieved.
112   * @return ListGroupsResponse
113   */
114  public function listGroups($optParams = [])
115  {
116    $params = [];
117    $params = array_merge($params, $optParams);
118    return $this->call('list', [$params], ListGroupsResponse::class);
119  }
120  /**
121   * Modifies a group. For example, you could change a group's title.
122   * (groups.update)
123   *
124   * @param Group $postBody
125   * @param array $optParams Optional parameters.
126   *
127   * @opt_param string onBehalfOfContentOwner This parameter can only be used in a
128   * properly authorized request. **Note:** This parameter is intended exclusively
129   * for YouTube content partners that own and manage many different YouTube
130   * channels. The `onBehalfOfContentOwner` parameter indicates that the request's
131   * authorization credentials identify a YouTube user who is acting on behalf of
132   * the content owner specified in the parameter value. It allows content owners
133   * to authenticate once and get access to all their video and channel data,
134   * without having to provide authentication credentials for each individual
135   * channel. The account that the user authenticates with must be linked to the
136   * specified YouTube content owner.
137   * @return Group
138   */
139  public function update(Group $postBody, $optParams = [])
140  {
141    $params = ['postBody' => $postBody];
142    $params = array_merge($params, $optParams);
143    return $this->call('update', [$params], Group::class);
144  }
145}
146
147// Adding a class alias for backwards compatibility with the previous class name.
148class_alias(Groups::class, 'Google_Service_YouTubeAnalytics_Resource_Groups');
149