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
18namespace Google\Service\Vault\Resource;
19
20use Google\Service\Vault\ListSavedQueriesResponse;
21use Google\Service\Vault\SavedQuery;
22use Google\Service\Vault\VaultEmpty;
23
24/**
25 * The "savedQueries" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $vaultService = new Google\Service\Vault(...);
29 *   $savedQueries = $vaultService->savedQueries;
30 *  </code>
31 */
32class MattersSavedQueries extends \Google\Service\Resource
33{
34  /**
35   * Creates a saved query. (savedQueries.create)
36   *
37   * @param string $matterId The ID of the matter to create the saved query in.
38   * @param SavedQuery $postBody
39   * @param array $optParams Optional parameters.
40   * @return SavedQuery
41   */
42  public function create($matterId, SavedQuery $postBody, $optParams = [])
43  {
44    $params = ['matterId' => $matterId, 'postBody' => $postBody];
45    $params = array_merge($params, $optParams);
46    return $this->call('create', [$params], SavedQuery::class);
47  }
48  /**
49   * Deletes the specified saved query. (savedQueries.delete)
50   *
51   * @param string $matterId The ID of the matter to delete the saved query from.
52   * @param string $savedQueryId ID of the saved query to delete.
53   * @param array $optParams Optional parameters.
54   * @return VaultEmpty
55   */
56  public function delete($matterId, $savedQueryId, $optParams = [])
57  {
58    $params = ['matterId' => $matterId, 'savedQueryId' => $savedQueryId];
59    $params = array_merge($params, $optParams);
60    return $this->call('delete', [$params], VaultEmpty::class);
61  }
62  /**
63   * Retrieves the specified saved query. (savedQueries.get)
64   *
65   * @param string $matterId The ID of the matter to get the saved query from.
66   * @param string $savedQueryId ID of the saved query to retrieve.
67   * @param array $optParams Optional parameters.
68   * @return SavedQuery
69   */
70  public function get($matterId, $savedQueryId, $optParams = [])
71  {
72    $params = ['matterId' => $matterId, 'savedQueryId' => $savedQueryId];
73    $params = array_merge($params, $optParams);
74    return $this->call('get', [$params], SavedQuery::class);
75  }
76  /**
77   * Lists the saved queries in a matter. (savedQueries.listMattersSavedQueries)
78   *
79   * @param string $matterId The ID of the matter to get the saved queries for.
80   * @param array $optParams Optional parameters.
81   *
82   * @opt_param int pageSize The maximum number of saved queries to return.
83   * @opt_param string pageToken The pagination token as returned in the previous
84   * response. An empty token means start from the beginning.
85   * @return ListSavedQueriesResponse
86   */
87  public function listMattersSavedQueries($matterId, $optParams = [])
88  {
89    $params = ['matterId' => $matterId];
90    $params = array_merge($params, $optParams);
91    return $this->call('list', [$params], ListSavedQueriesResponse::class);
92  }
93}
94
95// Adding a class alias for backwards compatibility with the previous class name.
96class_alias(MattersSavedQueries::class, 'Google_Service_Vault_Resource_MattersSavedQueries');
97