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\Analytics\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Analytics\EntityUserLink;
|
---|
21 | use Google\Service\Analytics\EntityUserLinks;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "webpropertyUserLinks" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $analyticsService = new Google\Service\Analytics(...);
|
---|
28 | * $webpropertyUserLinks = $analyticsService->management_webpropertyUserLinks;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class ManagementWebpropertyUserLinks extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Removes a user from the given web property. (webpropertyUserLinks.delete)
|
---|
35 | *
|
---|
36 | * @param string $accountId Account ID to delete the user link for.
|
---|
37 | * @param string $webPropertyId Web Property ID to delete the user link for.
|
---|
38 | * @param string $linkId Link ID to delete the user link for.
|
---|
39 | * @param array $optParams Optional parameters.
|
---|
40 | * @throws \Google\Service\Exception
|
---|
41 | */
|
---|
42 | public function delete($accountId, $webPropertyId, $linkId, $optParams = [])
|
---|
43 | {
|
---|
44 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'linkId' => $linkId];
|
---|
45 | $params = array_merge($params, $optParams);
|
---|
46 | return $this->call('delete', [$params]);
|
---|
47 | }
|
---|
48 | /**
|
---|
49 | * Adds a new user to the given web property. (webpropertyUserLinks.insert)
|
---|
50 | *
|
---|
51 | * @param string $accountId Account ID to create the user link for.
|
---|
52 | * @param string $webPropertyId Web Property ID to create the user link for.
|
---|
53 | * @param EntityUserLink $postBody
|
---|
54 | * @param array $optParams Optional parameters.
|
---|
55 | * @return EntityUserLink
|
---|
56 | * @throws \Google\Service\Exception
|
---|
57 | */
|
---|
58 | public function insert($accountId, $webPropertyId, EntityUserLink $postBody, $optParams = [])
|
---|
59 | {
|
---|
60 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody];
|
---|
61 | $params = array_merge($params, $optParams);
|
---|
62 | return $this->call('insert', [$params], EntityUserLink::class);
|
---|
63 | }
|
---|
64 | /**
|
---|
65 | * Lists webProperty-user links for a given web property.
|
---|
66 | * (webpropertyUserLinks.listManagementWebpropertyUserLinks)
|
---|
67 | *
|
---|
68 | * @param string $accountId Account ID which the given web property belongs to.
|
---|
69 | * @param string $webPropertyId Web Property ID for the webProperty-user links
|
---|
70 | * to retrieve. Can either be a specific web property ID or '~all', which refers
|
---|
71 | * to all the web properties that user has access to.
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | *
|
---|
74 | * @opt_param int max-results The maximum number of webProperty-user Links to
|
---|
75 | * include in this response.
|
---|
76 | * @opt_param int start-index An index of the first webProperty-user link to
|
---|
77 | * retrieve. Use this parameter as a pagination mechanism along with the max-
|
---|
78 | * results parameter.
|
---|
79 | * @return EntityUserLinks
|
---|
80 | * @throws \Google\Service\Exception
|
---|
81 | */
|
---|
82 | public function listManagementWebpropertyUserLinks($accountId, $webPropertyId, $optParams = [])
|
---|
83 | {
|
---|
84 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId];
|
---|
85 | $params = array_merge($params, $optParams);
|
---|
86 | return $this->call('list', [$params], EntityUserLinks::class);
|
---|
87 | }
|
---|
88 | /**
|
---|
89 | * Updates permissions for an existing user on the given web property.
|
---|
90 | * (webpropertyUserLinks.update)
|
---|
91 | *
|
---|
92 | * @param string $accountId Account ID to update the account-user link for.
|
---|
93 | * @param string $webPropertyId Web property ID to update the account-user link
|
---|
94 | * for.
|
---|
95 | * @param string $linkId Link ID to update the account-user link for.
|
---|
96 | * @param EntityUserLink $postBody
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | * @return EntityUserLink
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function update($accountId, $webPropertyId, $linkId, EntityUserLink $postBody, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'linkId' => $linkId, 'postBody' => $postBody];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('update', [$params], EntityUserLink::class);
|
---|
106 | }
|
---|
107 | }
|
---|
108 |
|
---|
109 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
110 | class_alias(ManagementWebpropertyUserLinks::class, 'Google_Service_Analytics_Resource_ManagementWebpropertyUserLinks');
|
---|