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\AddHeldAccountsRequest;
21use Google\Service\Vault\AddHeldAccountsResponse;
22use Google\Service\Vault\Hold;
23use Google\Service\Vault\ListHoldsResponse;
24use Google\Service\Vault\RemoveHeldAccountsRequest;
25use Google\Service\Vault\RemoveHeldAccountsResponse;
26use Google\Service\Vault\VaultEmpty;
27
28/**
29 * The "holds" collection of methods.
30 * Typical usage is:
31 *  <code>
32 *   $vaultService = new Google\Service\Vault(...);
33 *   $holds = $vaultService->holds;
34 *  </code>
35 */
36class MattersHolds extends \Google\Service\Resource
37{
38  /**
39   * Adds accounts to a hold. Returns a list of accounts that have been
40   * successfully added. Accounts can be added only to an existing account-based
41   * hold. (holds.addHeldAccounts)
42   *
43   * @param string $matterId The matter ID.
44   * @param string $holdId The hold ID.
45   * @param AddHeldAccountsRequest $postBody
46   * @param array $optParams Optional parameters.
47   * @return AddHeldAccountsResponse
48   */
49  public function addHeldAccounts($matterId, $holdId, AddHeldAccountsRequest $postBody, $optParams = [])
50  {
51    $params = ['matterId' => $matterId, 'holdId' => $holdId, 'postBody' => $postBody];
52    $params = array_merge($params, $optParams);
53    return $this->call('addHeldAccounts', [$params], AddHeldAccountsResponse::class);
54  }
55  /**
56   * Creates a hold in the specified matter. (holds.create)
57   *
58   * @param string $matterId The matter ID.
59   * @param Hold $postBody
60   * @param array $optParams Optional parameters.
61   * @return Hold
62   */
63  public function create($matterId, Hold $postBody, $optParams = [])
64  {
65    $params = ['matterId' => $matterId, 'postBody' => $postBody];
66    $params = array_merge($params, $optParams);
67    return $this->call('create', [$params], Hold::class);
68  }
69  /**
70   * Removes the specified hold and releases the accounts or organizational unit
71   * covered by the hold. If the data is not preserved by another hold or
72   * retention rule, it might be purged. (holds.delete)
73   *
74   * @param string $matterId The matter ID.
75   * @param string $holdId The hold ID.
76   * @param array $optParams Optional parameters.
77   * @return VaultEmpty
78   */
79  public function delete($matterId, $holdId, $optParams = [])
80  {
81    $params = ['matterId' => $matterId, 'holdId' => $holdId];
82    $params = array_merge($params, $optParams);
83    return $this->call('delete', [$params], VaultEmpty::class);
84  }
85  /**
86   * Gets the specified hold. (holds.get)
87   *
88   * @param string $matterId The matter ID.
89   * @param string $holdId The hold ID.
90   * @param array $optParams Optional parameters.
91   *
92   * @opt_param string view The amount of detail to return for a hold.
93   * @return Hold
94   */
95  public function get($matterId, $holdId, $optParams = [])
96  {
97    $params = ['matterId' => $matterId, 'holdId' => $holdId];
98    $params = array_merge($params, $optParams);
99    return $this->call('get', [$params], Hold::class);
100  }
101  /**
102   * Lists the holds in a matter. (holds.listMattersHolds)
103   *
104   * @param string $matterId The matter ID.
105   * @param array $optParams Optional parameters.
106   *
107   * @opt_param int pageSize The number of holds to return in the response,
108   * between 0 and 100 inclusive. Leaving this empty, or as 0, is the same as
109   * **page_size** = 100.
110   * @opt_param string pageToken The pagination token as returned in the response.
111   * An empty token means start from the beginning.
112   * @opt_param string view The amount of detail to return for a hold.
113   * @return ListHoldsResponse
114   */
115  public function listMattersHolds($matterId, $optParams = [])
116  {
117    $params = ['matterId' => $matterId];
118    $params = array_merge($params, $optParams);
119    return $this->call('list', [$params], ListHoldsResponse::class);
120  }
121  /**
122   * Removes the specified accounts from a hold. Returns a list of statuses in the
123   * same order as the request. (holds.removeHeldAccounts)
124   *
125   * @param string $matterId The matter ID.
126   * @param string $holdId The hold ID.
127   * @param RemoveHeldAccountsRequest $postBody
128   * @param array $optParams Optional parameters.
129   * @return RemoveHeldAccountsResponse
130   */
131  public function removeHeldAccounts($matterId, $holdId, RemoveHeldAccountsRequest $postBody, $optParams = [])
132  {
133    $params = ['matterId' => $matterId, 'holdId' => $holdId, 'postBody' => $postBody];
134    $params = array_merge($params, $optParams);
135    return $this->call('removeHeldAccounts', [$params], RemoveHeldAccountsResponse::class);
136  }
137  /**
138   * Updates the scope (organizational unit or accounts) and query parameters of a
139   * hold. You cannot add accounts to a hold that covers an organizational unit,
140   * nor can you add organizational units to a hold that covers individual
141   * accounts. If you try, the unsupported values are ignored. (holds.update)
142   *
143   * @param string $matterId The matter ID.
144   * @param string $holdId The ID of the hold.
145   * @param Hold $postBody
146   * @param array $optParams Optional parameters.
147   * @return Hold
148   */
149  public function update($matterId, $holdId, Hold $postBody, $optParams = [])
150  {
151    $params = ['matterId' => $matterId, 'holdId' => $holdId, 'postBody' => $postBody];
152    $params = array_merge($params, $optParams);
153    return $this->call('update', [$params], Hold::class);
154  }
155}
156
157// Adding a class alias for backwards compatibility with the previous class name.
158class_alias(MattersHolds::class, 'Google_Service_Vault_Resource_MattersHolds');
159