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