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 "filters" collection of methods.
20 * Typical usage is:
21 *  <code>
22 *   $analyticsService = new Google_Service_Analytics(...);
23 *   $filters = $analyticsService->filters;
24 *  </code>
25 */
26class Google_Service_Analytics_Resource_ManagementFilters extends Google_Service_Resource
27{
28  /**
29   * Delete a filter. (filters.delete)
30   *
31   * @param string $accountId Account ID to delete the filter for.
32   * @param string $filterId ID of the filter to be deleted.
33   * @param array $optParams Optional parameters.
34   * @return Google_Service_Analytics_Filter
35   */
36  public function delete($accountId, $filterId, $optParams = array())
37  {
38    $params = array('accountId' => $accountId, 'filterId' => $filterId);
39    $params = array_merge($params, $optParams);
40    return $this->call('delete', array($params), "Google_Service_Analytics_Filter");
41  }
42  /**
43   * Returns filters to which the user has access. (filters.get)
44   *
45   * @param string $accountId Account ID to retrieve filters for.
46   * @param string $filterId Filter ID to retrieve filters for.
47   * @param array $optParams Optional parameters.
48   * @return Google_Service_Analytics_Filter
49   */
50  public function get($accountId, $filterId, $optParams = array())
51  {
52    $params = array('accountId' => $accountId, 'filterId' => $filterId);
53    $params = array_merge($params, $optParams);
54    return $this->call('get', array($params), "Google_Service_Analytics_Filter");
55  }
56  /**
57   * Create a new filter. (filters.insert)
58   *
59   * @param string $accountId Account ID to create filter for.
60   * @param Google_Service_Analytics_Filter $postBody
61   * @param array $optParams Optional parameters.
62   * @return Google_Service_Analytics_Filter
63   */
64  public function insert($accountId, Google_Service_Analytics_Filter $postBody, $optParams = array())
65  {
66    $params = array('accountId' => $accountId, 'postBody' => $postBody);
67    $params = array_merge($params, $optParams);
68    return $this->call('insert', array($params), "Google_Service_Analytics_Filter");
69  }
70  /**
71   * Lists all filters for an account (filters.listManagementFilters)
72   *
73   * @param string $accountId Account ID to retrieve filters for.
74   * @param array $optParams Optional parameters.
75   *
76   * @opt_param int max-results The maximum number of filters to include in this
77   * 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 Google_Service_Analytics_Filters
81   */
82  public function listManagementFilters($accountId, $optParams = array())
83  {
84    $params = array('accountId' => $accountId);
85    $params = array_merge($params, $optParams);
86    return $this->call('list', array($params), "Google_Service_Analytics_Filters");
87  }
88  /**
89   * Updates an existing filter. This method supports patch semantics.
90   * (filters.patch)
91   *
92   * @param string $accountId Account ID to which the filter belongs.
93   * @param string $filterId ID of the filter to be updated.
94   * @param Google_Service_Analytics_Filter $postBody
95   * @param array $optParams Optional parameters.
96   * @return Google_Service_Analytics_Filter
97   */
98  public function patch($accountId, $filterId, Google_Service_Analytics_Filter $postBody, $optParams = array())
99  {
100    $params = array('accountId' => $accountId, 'filterId' => $filterId, 'postBody' => $postBody);
101    $params = array_merge($params, $optParams);
102    return $this->call('patch', array($params), "Google_Service_Analytics_Filter");
103  }
104  /**
105   * Updates an existing filter. (filters.update)
106   *
107   * @param string $accountId Account ID to which the filter belongs.
108   * @param string $filterId ID of the filter to be updated.
109   * @param Google_Service_Analytics_Filter $postBody
110   * @param array $optParams Optional parameters.
111   * @return Google_Service_Analytics_Filter
112   */
113  public function update($accountId, $filterId, Google_Service_Analytics_Filter $postBody, $optParams = array())
114  {
115    $params = array('accountId' => $accountId, 'filterId' => $filterId, 'postBody' => $postBody);
116    $params = array_merge($params, $optParams);
117    return $this->call('update', array($params), "Google_Service_Analytics_Filter");
118  }
119}
120