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\Webproperties;
|
---|
21 | use Google\Service\Analytics\Webproperty;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "webproperties" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $analyticsService = new Google\Service\Analytics(...);
|
---|
28 | * $webproperties = $analyticsService->management_webproperties;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class ManagementWebproperties extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Gets a web property to which the user has access. (webproperties.get)
|
---|
35 | *
|
---|
36 | * @param string $accountId Account ID to retrieve the web property for.
|
---|
37 | * @param string $webPropertyId ID to retrieve the web property for.
|
---|
38 | * @param array $optParams Optional parameters.
|
---|
39 | * @return Webproperty
|
---|
40 | * @throws \Google\Service\Exception
|
---|
41 | */
|
---|
42 | public function get($accountId, $webPropertyId, $optParams = [])
|
---|
43 | {
|
---|
44 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId];
|
---|
45 | $params = array_merge($params, $optParams);
|
---|
46 | return $this->call('get', [$params], Webproperty::class);
|
---|
47 | }
|
---|
48 | /**
|
---|
49 | * Create a new property if the account has fewer than 20 properties. Web
|
---|
50 | * properties are visible in the Google Analytics interface only if they have at
|
---|
51 | * least one profile. (webproperties.insert)
|
---|
52 | *
|
---|
53 | * @param string $accountId Account ID to create the web property for.
|
---|
54 | * @param Webproperty $postBody
|
---|
55 | * @param array $optParams Optional parameters.
|
---|
56 | * @return Webproperty
|
---|
57 | * @throws \Google\Service\Exception
|
---|
58 | */
|
---|
59 | public function insert($accountId, Webproperty $postBody, $optParams = [])
|
---|
60 | {
|
---|
61 | $params = ['accountId' => $accountId, 'postBody' => $postBody];
|
---|
62 | $params = array_merge($params, $optParams);
|
---|
63 | return $this->call('insert', [$params], Webproperty::class);
|
---|
64 | }
|
---|
65 | /**
|
---|
66 | * Lists web properties to which the user has access.
|
---|
67 | * (webproperties.listManagementWebproperties)
|
---|
68 | *
|
---|
69 | * @param string $accountId Account ID to retrieve web properties for. Can
|
---|
70 | * either be a specific account ID or '~all', which refers to all the accounts
|
---|
71 | * that user has access to.
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | *
|
---|
74 | * @opt_param int max-results The maximum number of web properties to include in
|
---|
75 | * this response.
|
---|
76 | * @opt_param int start-index An index of the first entity to retrieve. Use this
|
---|
77 | * parameter as a pagination mechanism along with the max-results parameter.
|
---|
78 | * @return Webproperties
|
---|
79 | * @throws \Google\Service\Exception
|
---|
80 | */
|
---|
81 | public function listManagementWebproperties($accountId, $optParams = [])
|
---|
82 | {
|
---|
83 | $params = ['accountId' => $accountId];
|
---|
84 | $params = array_merge($params, $optParams);
|
---|
85 | return $this->call('list', [$params], Webproperties::class);
|
---|
86 | }
|
---|
87 | /**
|
---|
88 | * Updates an existing web property. This method supports patch semantics.
|
---|
89 | * (webproperties.patch)
|
---|
90 | *
|
---|
91 | * @param string $accountId Account ID to which the web property belongs
|
---|
92 | * @param string $webPropertyId Web property ID
|
---|
93 | * @param Webproperty $postBody
|
---|
94 | * @param array $optParams Optional parameters.
|
---|
95 | * @return Webproperty
|
---|
96 | * @throws \Google\Service\Exception
|
---|
97 | */
|
---|
98 | public function patch($accountId, $webPropertyId, Webproperty $postBody, $optParams = [])
|
---|
99 | {
|
---|
100 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody];
|
---|
101 | $params = array_merge($params, $optParams);
|
---|
102 | return $this->call('patch', [$params], Webproperty::class);
|
---|
103 | }
|
---|
104 | /**
|
---|
105 | * Updates an existing web property. (webproperties.update)
|
---|
106 | *
|
---|
107 | * @param string $accountId Account ID to which the web property belongs
|
---|
108 | * @param string $webPropertyId Web property ID
|
---|
109 | * @param Webproperty $postBody
|
---|
110 | * @param array $optParams Optional parameters.
|
---|
111 | * @return Webproperty
|
---|
112 | * @throws \Google\Service\Exception
|
---|
113 | */
|
---|
114 | public function update($accountId, $webPropertyId, Webproperty $postBody, $optParams = [])
|
---|
115 | {
|
---|
116 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody];
|
---|
117 | $params = array_merge($params, $optParams);
|
---|
118 | return $this->call('update', [$params], Webproperty::class);
|
---|
119 | }
|
---|
120 | }
|
---|
121 |
|
---|
122 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
123 | class_alias(ManagementWebproperties::class, 'Google_Service_Analytics_Resource_ManagementWebproperties');
|
---|