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\HeldAccount;
21use Google\Service\Vault\ListHeldAccountsResponse;
22use Google\Service\Vault\VaultEmpty;
23
24/**
25 * The "accounts" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $vaultService = new Google\Service\Vault(...);
29 *   $accounts = $vaultService->accounts;
30 *  </code>
31 */
32class MattersHoldsAccounts extends \Google\Service\Resource
33{
34  /**
35   * Adds an account to a hold. Accounts can be added only to a hold that does not
36   * have an organizational unit set. If you try to add an account to an
37   * organizational unit-based hold, an error is returned. (accounts.create)
38   *
39   * @param string $matterId The matter ID.
40   * @param string $holdId The hold ID.
41   * @param HeldAccount $postBody
42   * @param array $optParams Optional parameters.
43   * @return HeldAccount
44   */
45  public function create($matterId, $holdId, HeldAccount $postBody, $optParams = [])
46  {
47    $params = ['matterId' => $matterId, 'holdId' => $holdId, 'postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('create', [$params], HeldAccount::class);
50  }
51  /**
52   * Removes an account from a hold. (accounts.delete)
53   *
54   * @param string $matterId The matter ID.
55   * @param string $holdId The hold ID.
56   * @param string $accountId The ID of the account to remove from the hold.
57   * @param array $optParams Optional parameters.
58   * @return VaultEmpty
59   */
60  public function delete($matterId, $holdId, $accountId, $optParams = [])
61  {
62    $params = ['matterId' => $matterId, 'holdId' => $holdId, 'accountId' => $accountId];
63    $params = array_merge($params, $optParams);
64    return $this->call('delete', [$params], VaultEmpty::class);
65  }
66  /**
67   * Lists the accounts covered by a hold. This can list only individually-
68   * specified accounts covered by the hold. If the hold covers an organizational
69   * unit, use the [Admin SDK](https://developers.google.com/admin-sdk/). to list
70   * the members of the organizational unit on hold.
71   * (accounts.listMattersHoldsAccounts)
72   *
73   * @param string $matterId The matter ID.
74   * @param string $holdId The hold ID.
75   * @param array $optParams Optional parameters.
76   * @return ListHeldAccountsResponse
77   */
78  public function listMattersHoldsAccounts($matterId, $holdId, $optParams = [])
79  {
80    $params = ['matterId' => $matterId, 'holdId' => $holdId];
81    $params = array_merge($params, $optParams);
82    return $this->call('list', [$params], ListHeldAccountsResponse::class);
83  }
84}
85
86// Adding a class alias for backwards compatibility with the previous class name.
87class_alias(MattersHoldsAccounts::class, 'Google_Service_Vault_Resource_MattersHoldsAccounts');
88