[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\Analytics\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Analytics\CustomDimension;
|
---|
| 21 | use Google\Service\Analytics\CustomDimensions;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "customDimensions" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $analyticsService = new Google\Service\Analytics(...);
|
---|
| 28 | * $customDimensions = $analyticsService->management_customDimensions;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class ManagementCustomDimensions extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Get a custom dimension to which the user has access. (customDimensions.get)
|
---|
| 35 | *
|
---|
| 36 | * @param string $accountId Account ID for the custom dimension to retrieve.
|
---|
| 37 | * @param string $webPropertyId Web property ID for the custom dimension to
|
---|
| 38 | * retrieve.
|
---|
| 39 | * @param string $customDimensionId The ID of the custom dimension to retrieve.
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | * @return CustomDimension
|
---|
| 42 | * @throws \Google\Service\Exception
|
---|
| 43 | */
|
---|
| 44 | public function get($accountId, $webPropertyId, $customDimensionId, $optParams = [])
|
---|
| 45 | {
|
---|
| 46 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDimensionId' => $customDimensionId];
|
---|
| 47 | $params = array_merge($params, $optParams);
|
---|
| 48 | return $this->call('get', [$params], CustomDimension::class);
|
---|
| 49 | }
|
---|
| 50 | /**
|
---|
| 51 | * Create a new custom dimension. (customDimensions.insert)
|
---|
| 52 | *
|
---|
| 53 | * @param string $accountId Account ID for the custom dimension to create.
|
---|
| 54 | * @param string $webPropertyId Web property ID for the custom dimension to
|
---|
| 55 | * create.
|
---|
| 56 | * @param CustomDimension $postBody
|
---|
| 57 | * @param array $optParams Optional parameters.
|
---|
| 58 | * @return CustomDimension
|
---|
| 59 | * @throws \Google\Service\Exception
|
---|
| 60 | */
|
---|
| 61 | public function insert($accountId, $webPropertyId, CustomDimension $postBody, $optParams = [])
|
---|
| 62 | {
|
---|
| 63 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'postBody' => $postBody];
|
---|
| 64 | $params = array_merge($params, $optParams);
|
---|
| 65 | return $this->call('insert', [$params], CustomDimension::class);
|
---|
| 66 | }
|
---|
| 67 | /**
|
---|
| 68 | * Lists custom dimensions to which the user has access.
|
---|
| 69 | * (customDimensions.listManagementCustomDimensions)
|
---|
| 70 | *
|
---|
| 71 | * @param string $accountId Account ID for the custom dimensions to retrieve.
|
---|
| 72 | * @param string $webPropertyId Web property ID for the custom dimensions to
|
---|
| 73 | * retrieve.
|
---|
| 74 | * @param array $optParams Optional parameters.
|
---|
| 75 | *
|
---|
| 76 | * @opt_param int max-results The maximum number of custom dimensions to include
|
---|
| 77 | * in this response.
|
---|
| 78 | * @opt_param int start-index An index of the first entity to retrieve. Use this
|
---|
| 79 | * parameter as a pagination mechanism along with the max-results parameter.
|
---|
| 80 | * @return CustomDimensions
|
---|
| 81 | * @throws \Google\Service\Exception
|
---|
| 82 | */
|
---|
| 83 | public function listManagementCustomDimensions($accountId, $webPropertyId, $optParams = [])
|
---|
| 84 | {
|
---|
| 85 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId];
|
---|
| 86 | $params = array_merge($params, $optParams);
|
---|
| 87 | return $this->call('list', [$params], CustomDimensions::class);
|
---|
| 88 | }
|
---|
| 89 | /**
|
---|
| 90 | * Updates an existing custom dimension. This method supports patch semantics.
|
---|
| 91 | * (customDimensions.patch)
|
---|
| 92 | *
|
---|
| 93 | * @param string $accountId Account ID for the custom dimension to update.
|
---|
| 94 | * @param string $webPropertyId Web property ID for the custom dimension to
|
---|
| 95 | * update.
|
---|
| 96 | * @param string $customDimensionId Custom dimension ID for the custom dimension
|
---|
| 97 | * to update.
|
---|
| 98 | * @param CustomDimension $postBody
|
---|
| 99 | * @param array $optParams Optional parameters.
|
---|
| 100 | *
|
---|
| 101 | * @opt_param bool ignoreCustomDataSourceLinks Force the update and ignore any
|
---|
| 102 | * warnings related to the custom dimension being linked to a custom data source
|
---|
| 103 | * / data set.
|
---|
| 104 | * @return CustomDimension
|
---|
| 105 | * @throws \Google\Service\Exception
|
---|
| 106 | */
|
---|
| 107 | public function patch($accountId, $webPropertyId, $customDimensionId, CustomDimension $postBody, $optParams = [])
|
---|
| 108 | {
|
---|
| 109 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDimensionId' => $customDimensionId, 'postBody' => $postBody];
|
---|
| 110 | $params = array_merge($params, $optParams);
|
---|
| 111 | return $this->call('patch', [$params], CustomDimension::class);
|
---|
| 112 | }
|
---|
| 113 | /**
|
---|
| 114 | * Updates an existing custom dimension. (customDimensions.update)
|
---|
| 115 | *
|
---|
| 116 | * @param string $accountId Account ID for the custom dimension to update.
|
---|
| 117 | * @param string $webPropertyId Web property ID for the custom dimension to
|
---|
| 118 | * update.
|
---|
| 119 | * @param string $customDimensionId Custom dimension ID for the custom dimension
|
---|
| 120 | * to update.
|
---|
| 121 | * @param CustomDimension $postBody
|
---|
| 122 | * @param array $optParams Optional parameters.
|
---|
| 123 | *
|
---|
| 124 | * @opt_param bool ignoreCustomDataSourceLinks Force the update and ignore any
|
---|
| 125 | * warnings related to the custom dimension being linked to a custom data source
|
---|
| 126 | * / data set.
|
---|
| 127 | * @return CustomDimension
|
---|
| 128 | * @throws \Google\Service\Exception
|
---|
| 129 | */
|
---|
| 130 | public function update($accountId, $webPropertyId, $customDimensionId, CustomDimension $postBody, $optParams = [])
|
---|
| 131 | {
|
---|
| 132 | $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDimensionId' => $customDimensionId, 'postBody' => $postBody];
|
---|
| 133 | $params = array_merge($params, $optParams);
|
---|
| 134 | return $this->call('update', [$params], CustomDimension::class);
|
---|
| 135 | }
|
---|
| 136 | }
|
---|
| 137 |
|
---|
| 138 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 139 | class_alias(ManagementCustomDimensions::class, 'Google_Service_Analytics_Resource_ManagementCustomDimensions');
|
---|