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\GoogleAnalyticsAdmin\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionRequest;
|
---|
21 | use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionResponse;
|
---|
22 | use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1betaDataRetentionSettings;
|
---|
23 | use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1betaListPropertiesResponse;
|
---|
24 | use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1betaProperty;
|
---|
25 | use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1betaRunAccessReportRequest;
|
---|
26 | use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1betaRunAccessReportResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "properties" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $analyticsadminService = new Google\Service\GoogleAnalyticsAdmin(...);
|
---|
33 | * $properties = $analyticsadminService->properties;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class Properties extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Acknowledges the terms of user data collection for the specified property.
|
---|
40 | * This acknowledgement must be completed (either in the Google Analytics UI or
|
---|
41 | * through this API) before MeasurementProtocolSecret resources may be created.
|
---|
42 | * (properties.acknowledgeUserDataCollection)
|
---|
43 | *
|
---|
44 | * @param string $property Required. The property for which to acknowledge user
|
---|
45 | * data collection.
|
---|
46 | * @param GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionRequest $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | * @return GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionResponse
|
---|
49 | * @throws \Google\Service\Exception
|
---|
50 | */
|
---|
51 | public function acknowledgeUserDataCollection($property, GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionRequest $postBody, $optParams = [])
|
---|
52 | {
|
---|
53 | $params = ['property' => $property, 'postBody' => $postBody];
|
---|
54 | $params = array_merge($params, $optParams);
|
---|
55 | return $this->call('acknowledgeUserDataCollection', [$params], GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionResponse::class);
|
---|
56 | }
|
---|
57 | /**
|
---|
58 | * Creates a Google Analytics property with the specified location and
|
---|
59 | * attributes. (properties.create)
|
---|
60 | *
|
---|
61 | * @param GoogleAnalyticsAdminV1betaProperty $postBody
|
---|
62 | * @param array $optParams Optional parameters.
|
---|
63 | * @return GoogleAnalyticsAdminV1betaProperty
|
---|
64 | * @throws \Google\Service\Exception
|
---|
65 | */
|
---|
66 | public function create(GoogleAnalyticsAdminV1betaProperty $postBody, $optParams = [])
|
---|
67 | {
|
---|
68 | $params = ['postBody' => $postBody];
|
---|
69 | $params = array_merge($params, $optParams);
|
---|
70 | return $this->call('create', [$params], GoogleAnalyticsAdminV1betaProperty::class);
|
---|
71 | }
|
---|
72 | /**
|
---|
73 | * Marks target Property as soft-deleted (ie: "trashed") and returns it. This
|
---|
74 | * API does not have a method to restore soft-deleted properties. However, they
|
---|
75 | * can be restored using the Trash Can UI. If the properties are not restored
|
---|
76 | * before the expiration time, the Property and all child resources (eg:
|
---|
77 | * GoogleAdsLinks, Streams, AccessBindings) will be permanently purged.
|
---|
78 | * https://support.google.com/analytics/answer/6154772 Returns an error if the
|
---|
79 | * target is not found. (properties.delete)
|
---|
80 | *
|
---|
81 | * @param string $name Required. The name of the Property to soft-delete.
|
---|
82 | * Format: properties/{property_id} Example: "properties/1000"
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | * @return GoogleAnalyticsAdminV1betaProperty
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function delete($name, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('delete', [$params], GoogleAnalyticsAdminV1betaProperty::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Lookup for a single GA Property. (properties.get)
|
---|
95 | *
|
---|
96 | * @param string $name Required. The name of the property to lookup. Format:
|
---|
97 | * properties/{property_id} Example: "properties/1000"
|
---|
98 | * @param array $optParams Optional parameters.
|
---|
99 | * @return GoogleAnalyticsAdminV1betaProperty
|
---|
100 | * @throws \Google\Service\Exception
|
---|
101 | */
|
---|
102 | public function get($name, $optParams = [])
|
---|
103 | {
|
---|
104 | $params = ['name' => $name];
|
---|
105 | $params = array_merge($params, $optParams);
|
---|
106 | return $this->call('get', [$params], GoogleAnalyticsAdminV1betaProperty::class);
|
---|
107 | }
|
---|
108 | /**
|
---|
109 | * Returns the singleton data retention settings for this property.
|
---|
110 | * (properties.getDataRetentionSettings)
|
---|
111 | *
|
---|
112 | * @param string $name Required. The name of the settings to lookup. Format:
|
---|
113 | * properties/{property}/dataRetentionSettings Example:
|
---|
114 | * "properties/1000/dataRetentionSettings"
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | * @return GoogleAnalyticsAdminV1betaDataRetentionSettings
|
---|
117 | * @throws \Google\Service\Exception
|
---|
118 | */
|
---|
119 | public function getDataRetentionSettings($name, $optParams = [])
|
---|
120 | {
|
---|
121 | $params = ['name' => $name];
|
---|
122 | $params = array_merge($params, $optParams);
|
---|
123 | return $this->call('getDataRetentionSettings', [$params], GoogleAnalyticsAdminV1betaDataRetentionSettings::class);
|
---|
124 | }
|
---|
125 | /**
|
---|
126 | * Returns child Properties under the specified parent Account. Properties will
|
---|
127 | * be excluded if the caller does not have access. Soft-deleted (ie: "trashed")
|
---|
128 | * properties are excluded by default. Returns an empty list if no relevant
|
---|
129 | * properties are found. (properties.listProperties)
|
---|
130 | *
|
---|
131 | * @param array $optParams Optional parameters.
|
---|
132 | *
|
---|
133 | * @opt_param string filter Required. An expression for filtering the results of
|
---|
134 | * the request. Fields eligible for filtering are: `parent:`(The resource name
|
---|
135 | * of the parent account/property) or `ancestor:`(The resource name of the
|
---|
136 | * parent account) or `firebase_project:`(The id or number of the linked
|
---|
137 | * firebase project). Some examples of filters: ``` | Filter | Description |
|
---|
138 | * |-----------------------------|-------------------------------------------| |
|
---|
139 | * parent:accounts/123 | The account with account id: 123. | |
|
---|
140 | * parent:properties/123 | The property with property id: 123. | |
|
---|
141 | * ancestor:accounts/123 | The account with account id: 123. | |
|
---|
142 | * firebase_project:project-id | The firebase project with id: project-id. | |
|
---|
143 | * firebase_project:123 | The firebase project with number: 123. | ```
|
---|
144 | * @opt_param int pageSize The maximum number of resources to return. The
|
---|
145 | * service may return fewer than this value, even if there are additional pages.
|
---|
146 | * If unspecified, at most 50 resources will be returned. The maximum value is
|
---|
147 | * 200; (higher values will be coerced to the maximum)
|
---|
148 | * @opt_param string pageToken A page token, received from a previous
|
---|
149 | * `ListProperties` call. Provide this to retrieve the subsequent page. When
|
---|
150 | * paginating, all other parameters provided to `ListProperties` must match the
|
---|
151 | * call that provided the page token.
|
---|
152 | * @opt_param bool showDeleted Whether to include soft-deleted (ie: "trashed")
|
---|
153 | * Properties in the results. Properties can be inspected to determine whether
|
---|
154 | * they are deleted or not.
|
---|
155 | * @return GoogleAnalyticsAdminV1betaListPropertiesResponse
|
---|
156 | * @throws \Google\Service\Exception
|
---|
157 | */
|
---|
158 | public function listProperties($optParams = [])
|
---|
159 | {
|
---|
160 | $params = [];
|
---|
161 | $params = array_merge($params, $optParams);
|
---|
162 | return $this->call('list', [$params], GoogleAnalyticsAdminV1betaListPropertiesResponse::class);
|
---|
163 | }
|
---|
164 | /**
|
---|
165 | * Updates a property. (properties.patch)
|
---|
166 | *
|
---|
167 | * @param string $name Output only. Resource name of this property. Format:
|
---|
168 | * properties/{property_id} Example: "properties/1000"
|
---|
169 | * @param GoogleAnalyticsAdminV1betaProperty $postBody
|
---|
170 | * @param array $optParams Optional parameters.
|
---|
171 | *
|
---|
172 | * @opt_param string updateMask Required. The list of fields to be updated.
|
---|
173 | * Field names must be in snake case (e.g., "field_to_update"). Omitted fields
|
---|
174 | * will not be updated. To replace the entire entity, use one path with the
|
---|
175 | * string "*" to match all fields.
|
---|
176 | * @return GoogleAnalyticsAdminV1betaProperty
|
---|
177 | * @throws \Google\Service\Exception
|
---|
178 | */
|
---|
179 | public function patch($name, GoogleAnalyticsAdminV1betaProperty $postBody, $optParams = [])
|
---|
180 | {
|
---|
181 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
182 | $params = array_merge($params, $optParams);
|
---|
183 | return $this->call('patch', [$params], GoogleAnalyticsAdminV1betaProperty::class);
|
---|
184 | }
|
---|
185 | /**
|
---|
186 | * Returns a customized report of data access records. The report provides
|
---|
187 | * records of each time a user reads Google Analytics reporting data. Access
|
---|
188 | * records are retained for up to 2 years. Data Access Reports can be requested
|
---|
189 | * for a property. Reports may be requested for any property, but dimensions
|
---|
190 | * that aren't related to quota can only be requested on Google Analytics 360
|
---|
191 | * properties. This method is only available to Administrators. These data
|
---|
192 | * access records include GA UI Reporting, GA UI Explorations, GA Data API, and
|
---|
193 | * other products like Firebase & Admob that can retrieve data from Google
|
---|
194 | * Analytics through a linkage. These records don't include property
|
---|
195 | * configuration changes like adding a stream or changing a property's time
|
---|
196 | * zone. For configuration change history, see [searchChangeHistoryEvents](https
|
---|
197 | * ://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/acc
|
---|
198 | * ounts/searchChangeHistoryEvents). To give your feedback on this API, complete
|
---|
199 | * the [Google Analytics Access Reports feedback](https://docs.google.com/forms/
|
---|
200 | * d/e/1FAIpQLSdmEBUrMzAEdiEKk5TV5dEHvDUZDRlgWYdQdAeSdtR4hVjEhw/viewform) form.
|
---|
201 | * (properties.runAccessReport)
|
---|
202 | *
|
---|
203 | * @param string $entity The Data Access Report supports requesting at the
|
---|
204 | * property level or account level. If requested at the account level, Data
|
---|
205 | * Access Reports include all access for all properties under that account. To
|
---|
206 | * request at the property level, entity should be for example 'properties/123'
|
---|
207 | * if "123" is your Google Analytics property ID. To request at the account
|
---|
208 | * level, entity should be for example 'accounts/1234' if "1234" is your Google
|
---|
209 | * Analytics Account ID.
|
---|
210 | * @param GoogleAnalyticsAdminV1betaRunAccessReportRequest $postBody
|
---|
211 | * @param array $optParams Optional parameters.
|
---|
212 | * @return GoogleAnalyticsAdminV1betaRunAccessReportResponse
|
---|
213 | * @throws \Google\Service\Exception
|
---|
214 | */
|
---|
215 | public function runAccessReport($entity, GoogleAnalyticsAdminV1betaRunAccessReportRequest $postBody, $optParams = [])
|
---|
216 | {
|
---|
217 | $params = ['entity' => $entity, 'postBody' => $postBody];
|
---|
218 | $params = array_merge($params, $optParams);
|
---|
219 | return $this->call('runAccessReport', [$params], GoogleAnalyticsAdminV1betaRunAccessReportResponse::class);
|
---|
220 | }
|
---|
221 | /**
|
---|
222 | * Updates the singleton data retention settings for this property.
|
---|
223 | * (properties.updateDataRetentionSettings)
|
---|
224 | *
|
---|
225 | * @param string $name Output only. Resource name for this DataRetentionSetting
|
---|
226 | * resource. Format: properties/{property}/dataRetentionSettings
|
---|
227 | * @param GoogleAnalyticsAdminV1betaDataRetentionSettings $postBody
|
---|
228 | * @param array $optParams Optional parameters.
|
---|
229 | *
|
---|
230 | * @opt_param string updateMask Required. The list of fields to be updated.
|
---|
231 | * Field names must be in snake case (e.g., "field_to_update"). Omitted fields
|
---|
232 | * will not be updated. To replace the entire entity, use one path with the
|
---|
233 | * string "*" to match all fields.
|
---|
234 | * @return GoogleAnalyticsAdminV1betaDataRetentionSettings
|
---|
235 | * @throws \Google\Service\Exception
|
---|
236 | */
|
---|
237 | public function updateDataRetentionSettings($name, GoogleAnalyticsAdminV1betaDataRetentionSettings $postBody, $optParams = [])
|
---|
238 | {
|
---|
239 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
240 | $params = array_merge($params, $optParams);
|
---|
241 | return $this->call('updateDataRetentionSettings', [$params], GoogleAnalyticsAdminV1betaDataRetentionSettings::class);
|
---|
242 | }
|
---|
243 | }
|
---|
244 |
|
---|
245 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
246 | class_alias(Properties::class, 'Google_Service_GoogleAnalyticsAdmin_Resource_Properties');
|
---|