[e3d4e0a] | 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\GoogleAnalyticsAdminV1betaArchiveCustomMetricRequest;
|
---|
| 21 | use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1betaCustomMetric;
|
---|
| 22 | use Google\Service\GoogleAnalyticsAdmin\GoogleAnalyticsAdminV1betaListCustomMetricsResponse;
|
---|
| 23 | use Google\Service\GoogleAnalyticsAdmin\GoogleProtobufEmpty;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "customMetrics" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $analyticsadminService = new Google\Service\GoogleAnalyticsAdmin(...);
|
---|
| 30 | * $customMetrics = $analyticsadminService->properties_customMetrics;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class PropertiesCustomMetrics extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Archives a CustomMetric on a property. (customMetrics.archive)
|
---|
| 37 | *
|
---|
| 38 | * @param string $name Required. The name of the CustomMetric to archive.
|
---|
| 39 | * Example format: properties/1234/customMetrics/5678
|
---|
| 40 | * @param GoogleAnalyticsAdminV1betaArchiveCustomMetricRequest $postBody
|
---|
| 41 | * @param array $optParams Optional parameters.
|
---|
| 42 | * @return GoogleProtobufEmpty
|
---|
| 43 | * @throws \Google\Service\Exception
|
---|
| 44 | */
|
---|
| 45 | public function archive($name, GoogleAnalyticsAdminV1betaArchiveCustomMetricRequest $postBody, $optParams = [])
|
---|
| 46 | {
|
---|
| 47 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 48 | $params = array_merge($params, $optParams);
|
---|
| 49 | return $this->call('archive', [$params], GoogleProtobufEmpty::class);
|
---|
| 50 | }
|
---|
| 51 | /**
|
---|
| 52 | * Creates a CustomMetric. (customMetrics.create)
|
---|
| 53 | *
|
---|
| 54 | * @param string $parent Required. Example format: properties/1234
|
---|
| 55 | * @param GoogleAnalyticsAdminV1betaCustomMetric $postBody
|
---|
| 56 | * @param array $optParams Optional parameters.
|
---|
| 57 | * @return GoogleAnalyticsAdminV1betaCustomMetric
|
---|
| 58 | * @throws \Google\Service\Exception
|
---|
| 59 | */
|
---|
| 60 | public function create($parent, GoogleAnalyticsAdminV1betaCustomMetric $postBody, $optParams = [])
|
---|
| 61 | {
|
---|
| 62 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 63 | $params = array_merge($params, $optParams);
|
---|
| 64 | return $this->call('create', [$params], GoogleAnalyticsAdminV1betaCustomMetric::class);
|
---|
| 65 | }
|
---|
| 66 | /**
|
---|
| 67 | * Lookup for a single CustomMetric. (customMetrics.get)
|
---|
| 68 | *
|
---|
| 69 | * @param string $name Required. The name of the CustomMetric to get. Example
|
---|
| 70 | * format: properties/1234/customMetrics/5678
|
---|
| 71 | * @param array $optParams Optional parameters.
|
---|
| 72 | * @return GoogleAnalyticsAdminV1betaCustomMetric
|
---|
| 73 | * @throws \Google\Service\Exception
|
---|
| 74 | */
|
---|
| 75 | public function get($name, $optParams = [])
|
---|
| 76 | {
|
---|
| 77 | $params = ['name' => $name];
|
---|
| 78 | $params = array_merge($params, $optParams);
|
---|
| 79 | return $this->call('get', [$params], GoogleAnalyticsAdminV1betaCustomMetric::class);
|
---|
| 80 | }
|
---|
| 81 | /**
|
---|
| 82 | * Lists CustomMetrics on a property.
|
---|
| 83 | * (customMetrics.listPropertiesCustomMetrics)
|
---|
| 84 | *
|
---|
| 85 | * @param string $parent Required. Example format: properties/1234
|
---|
| 86 | * @param array $optParams Optional parameters.
|
---|
| 87 | *
|
---|
| 88 | * @opt_param int pageSize The maximum number of resources to return. If
|
---|
| 89 | * unspecified, at most 50 resources will be returned. The maximum value is 200
|
---|
| 90 | * (higher values will be coerced to the maximum).
|
---|
| 91 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 92 | * `ListCustomMetrics` call. Provide this to retrieve the subsequent page. When
|
---|
| 93 | * paginating, all other parameters provided to `ListCustomMetrics` must match
|
---|
| 94 | * the call that provided the page token.
|
---|
| 95 | * @return GoogleAnalyticsAdminV1betaListCustomMetricsResponse
|
---|
| 96 | * @throws \Google\Service\Exception
|
---|
| 97 | */
|
---|
| 98 | public function listPropertiesCustomMetrics($parent, $optParams = [])
|
---|
| 99 | {
|
---|
| 100 | $params = ['parent' => $parent];
|
---|
| 101 | $params = array_merge($params, $optParams);
|
---|
| 102 | return $this->call('list', [$params], GoogleAnalyticsAdminV1betaListCustomMetricsResponse::class);
|
---|
| 103 | }
|
---|
| 104 | /**
|
---|
| 105 | * Updates a CustomMetric on a property. (customMetrics.patch)
|
---|
| 106 | *
|
---|
| 107 | * @param string $name Output only. Resource name for this CustomMetric
|
---|
| 108 | * resource. Format: properties/{property}/customMetrics/{customMetric}
|
---|
| 109 | * @param GoogleAnalyticsAdminV1betaCustomMetric $postBody
|
---|
| 110 | * @param array $optParams Optional parameters.
|
---|
| 111 | *
|
---|
| 112 | * @opt_param string updateMask Required. The list of fields to be updated.
|
---|
| 113 | * Omitted fields will not be updated. To replace the entire entity, use one
|
---|
| 114 | * path with the string "*" to match all fields.
|
---|
| 115 | * @return GoogleAnalyticsAdminV1betaCustomMetric
|
---|
| 116 | * @throws \Google\Service\Exception
|
---|
| 117 | */
|
---|
| 118 | public function patch($name, GoogleAnalyticsAdminV1betaCustomMetric $postBody, $optParams = [])
|
---|
| 119 | {
|
---|
| 120 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 121 | $params = array_merge($params, $optParams);
|
---|
| 122 | return $this->call('patch', [$params], GoogleAnalyticsAdminV1betaCustomMetric::class);
|
---|
| 123 | }
|
---|
| 124 | }
|
---|
| 125 |
|
---|
| 126 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 127 | class_alias(PropertiesCustomMetrics::class, 'Google_Service_GoogleAnalyticsAdmin_Resource_PropertiesCustomMetrics');
|
---|