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