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;
19
20use Google\Client;
21
22/**
23 * Service definition for Vault (v1).
24 *
25 * <p>
26 * Retention and eDiscovery for Google Workspace. To work with Vault resources,
27 * the account must have the [required Vault
28 * privileges](https://support.google.com/vault/answer/2799699) and access to
29 * the matter. To access a matter, the account must have created the matter,
30 * have the matter shared with them, or have the **View All Matters** privilege.
31 * For example, to download an export, an account needs the **Manage Exports**
32 * privilege and the matter shared with them.</p>
33 *
34 * <p>
35 * For more information about this service, see the API
36 * <a href="https://developers.google.com/vault" target="_blank">Documentation</a>
37 * </p>
38 *
39 * @author Google, Inc.
40 */
41class Vault extends \Google\Service
42{
43  /** Manage your eDiscovery data. */
44  const EDISCOVERY =
45      "https://www.googleapis.com/auth/ediscovery";
46  /** View your eDiscovery data. */
47  const EDISCOVERY_READONLY =
48      "https://www.googleapis.com/auth/ediscovery.readonly";
49
50  public $matters;
51  public $matters_exports;
52  public $matters_holds;
53  public $matters_holds_accounts;
54  public $matters_savedQueries;
55  public $operations;
56
57  /**
58   * Constructs the internal representation of the Vault service.
59   *
60   * @param Client|array $clientOrConfig The client used to deliver requests, or a
61   *                                     config array to pass to a new Client instance.
62   * @param string $rootUrl The root URL used for requests to the service.
63   */
64  public function __construct($clientOrConfig = [], $rootUrl = null)
65  {
66    parent::__construct($clientOrConfig);
67    $this->rootUrl = $rootUrl ?: 'https://vault.googleapis.com/';
68    $this->servicePath = '';
69    $this->batchPath = 'batch';
70    $this->version = 'v1';
71    $this->serviceName = 'vault';
72
73    $this->matters = new Vault\Resource\Matters(
74        $this,
75        $this->serviceName,
76        'matters',
77        [
78          'methods' => [
79            'addPermissions' => [
80              'path' => 'v1/matters/{matterId}:addPermissions',
81              'httpMethod' => 'POST',
82              'parameters' => [
83                'matterId' => [
84                  'location' => 'path',
85                  'type' => 'string',
86                  'required' => true,
87                ],
88              ],
89            ],'close' => [
90              'path' => 'v1/matters/{matterId}:close',
91              'httpMethod' => 'POST',
92              'parameters' => [
93                'matterId' => [
94                  'location' => 'path',
95                  'type' => 'string',
96                  'required' => true,
97                ],
98              ],
99            ],'count' => [
100              'path' => 'v1/matters/{matterId}:count',
101              'httpMethod' => 'POST',
102              'parameters' => [
103                'matterId' => [
104                  'location' => 'path',
105                  'type' => 'string',
106                  'required' => true,
107                ],
108              ],
109            ],'create' => [
110              'path' => 'v1/matters',
111              'httpMethod' => 'POST',
112              'parameters' => [],
113            ],'delete' => [
114              'path' => 'v1/matters/{matterId}',
115              'httpMethod' => 'DELETE',
116              'parameters' => [
117                'matterId' => [
118                  'location' => 'path',
119                  'type' => 'string',
120                  'required' => true,
121                ],
122              ],
123            ],'get' => [
124              'path' => 'v1/matters/{matterId}',
125              'httpMethod' => 'GET',
126              'parameters' => [
127                'matterId' => [
128                  'location' => 'path',
129                  'type' => 'string',
130                  'required' => true,
131                ],
132                'view' => [
133                  'location' => 'query',
134                  'type' => 'string',
135                ],
136              ],
137            ],'list' => [
138              'path' => 'v1/matters',
139              'httpMethod' => 'GET',
140              'parameters' => [
141                'pageSize' => [
142                  'location' => 'query',
143                  'type' => 'integer',
144                ],
145                'pageToken' => [
146                  'location' => 'query',
147                  'type' => 'string',
148                ],
149                'state' => [
150                  'location' => 'query',
151                  'type' => 'string',
152                ],
153                'view' => [
154                  'location' => 'query',
155                  'type' => 'string',
156                ],
157              ],
158            ],'removePermissions' => [
159              'path' => 'v1/matters/{matterId}:removePermissions',
160              'httpMethod' => 'POST',
161              'parameters' => [
162                'matterId' => [
163                  'location' => 'path',
164                  'type' => 'string',
165                  'required' => true,
166                ],
167              ],
168            ],'reopen' => [
169              'path' => 'v1/matters/{matterId}:reopen',
170              'httpMethod' => 'POST',
171              'parameters' => [
172                'matterId' => [
173                  'location' => 'path',
174                  'type' => 'string',
175                  'required' => true,
176                ],
177              ],
178            ],'undelete' => [
179              'path' => 'v1/matters/{matterId}:undelete',
180              'httpMethod' => 'POST',
181              'parameters' => [
182                'matterId' => [
183                  'location' => 'path',
184                  'type' => 'string',
185                  'required' => true,
186                ],
187              ],
188            ],'update' => [
189              'path' => 'v1/matters/{matterId}',
190              'httpMethod' => 'PUT',
191              'parameters' => [
192                'matterId' => [
193                  'location' => 'path',
194                  'type' => 'string',
195                  'required' => true,
196                ],
197              ],
198            ],
199          ]
200        ]
201    );
202    $this->matters_exports = new Vault\Resource\MattersExports(
203        $this,
204        $this->serviceName,
205        'exports',
206        [
207          'methods' => [
208            'create' => [
209              'path' => 'v1/matters/{matterId}/exports',
210              'httpMethod' => 'POST',
211              'parameters' => [
212                'matterId' => [
213                  'location' => 'path',
214                  'type' => 'string',
215                  'required' => true,
216                ],
217              ],
218            ],'delete' => [
219              'path' => 'v1/matters/{matterId}/exports/{exportId}',
220              'httpMethod' => 'DELETE',
221              'parameters' => [
222                'matterId' => [
223                  'location' => 'path',
224                  'type' => 'string',
225                  'required' => true,
226                ],
227                'exportId' => [
228                  'location' => 'path',
229                  'type' => 'string',
230                  'required' => true,
231                ],
232              ],
233            ],'get' => [
234              'path' => 'v1/matters/{matterId}/exports/{exportId}',
235              'httpMethod' => 'GET',
236              'parameters' => [
237                'matterId' => [
238                  'location' => 'path',
239                  'type' => 'string',
240                  'required' => true,
241                ],
242                'exportId' => [
243                  'location' => 'path',
244                  'type' => 'string',
245                  'required' => true,
246                ],
247              ],
248            ],'list' => [
249              'path' => 'v1/matters/{matterId}/exports',
250              'httpMethod' => 'GET',
251              'parameters' => [
252                'matterId' => [
253                  'location' => 'path',
254                  'type' => 'string',
255                  'required' => true,
256                ],
257                'pageSize' => [
258                  'location' => 'query',
259                  'type' => 'integer',
260                ],
261                'pageToken' => [
262                  'location' => 'query',
263                  'type' => 'string',
264                ],
265              ],
266            ],
267          ]
268        ]
269    );
270    $this->matters_holds = new Vault\Resource\MattersHolds(
271        $this,
272        $this->serviceName,
273        'holds',
274        [
275          'methods' => [
276            'addHeldAccounts' => [
277              'path' => 'v1/matters/{matterId}/holds/{holdId}:addHeldAccounts',
278              'httpMethod' => 'POST',
279              'parameters' => [
280                'matterId' => [
281                  'location' => 'path',
282                  'type' => 'string',
283                  'required' => true,
284                ],
285                'holdId' => [
286                  'location' => 'path',
287                  'type' => 'string',
288                  'required' => true,
289                ],
290              ],
291            ],'create' => [
292              'path' => 'v1/matters/{matterId}/holds',
293              'httpMethod' => 'POST',
294              'parameters' => [
295                'matterId' => [
296                  'location' => 'path',
297                  'type' => 'string',
298                  'required' => true,
299                ],
300              ],
301            ],'delete' => [
302              'path' => 'v1/matters/{matterId}/holds/{holdId}',
303              'httpMethod' => 'DELETE',
304              'parameters' => [
305                'matterId' => [
306                  'location' => 'path',
307                  'type' => 'string',
308                  'required' => true,
309                ],
310                'holdId' => [
311                  'location' => 'path',
312                  'type' => 'string',
313                  'required' => true,
314                ],
315              ],
316            ],'get' => [
317              'path' => 'v1/matters/{matterId}/holds/{holdId}',
318              'httpMethod' => 'GET',
319              'parameters' => [
320                'matterId' => [
321                  'location' => 'path',
322                  'type' => 'string',
323                  'required' => true,
324                ],
325                'holdId' => [
326                  'location' => 'path',
327                  'type' => 'string',
328                  'required' => true,
329                ],
330                'view' => [
331                  'location' => 'query',
332                  'type' => 'string',
333                ],
334              ],
335            ],'list' => [
336              'path' => 'v1/matters/{matterId}/holds',
337              'httpMethod' => 'GET',
338              'parameters' => [
339                'matterId' => [
340                  'location' => 'path',
341                  'type' => 'string',
342                  'required' => true,
343                ],
344                'pageSize' => [
345                  'location' => 'query',
346                  'type' => 'integer',
347                ],
348                'pageToken' => [
349                  'location' => 'query',
350                  'type' => 'string',
351                ],
352                'view' => [
353                  'location' => 'query',
354                  'type' => 'string',
355                ],
356              ],
357            ],'removeHeldAccounts' => [
358              'path' => 'v1/matters/{matterId}/holds/{holdId}:removeHeldAccounts',
359              'httpMethod' => 'POST',
360              'parameters' => [
361                'matterId' => [
362                  'location' => 'path',
363                  'type' => 'string',
364                  'required' => true,
365                ],
366                'holdId' => [
367                  'location' => 'path',
368                  'type' => 'string',
369                  'required' => true,
370                ],
371              ],
372            ],'update' => [
373              'path' => 'v1/matters/{matterId}/holds/{holdId}',
374              'httpMethod' => 'PUT',
375              'parameters' => [
376                'matterId' => [
377                  'location' => 'path',
378                  'type' => 'string',
379                  'required' => true,
380                ],
381                'holdId' => [
382                  'location' => 'path',
383                  'type' => 'string',
384                  'required' => true,
385                ],
386              ],
387            ],
388          ]
389        ]
390    );
391    $this->matters_holds_accounts = new Vault\Resource\MattersHoldsAccounts(
392        $this,
393        $this->serviceName,
394        'accounts',
395        [
396          'methods' => [
397            'create' => [
398              'path' => 'v1/matters/{matterId}/holds/{holdId}/accounts',
399              'httpMethod' => 'POST',
400              'parameters' => [
401                'matterId' => [
402                  'location' => 'path',
403                  'type' => 'string',
404                  'required' => true,
405                ],
406                'holdId' => [
407                  'location' => 'path',
408                  'type' => 'string',
409                  'required' => true,
410                ],
411              ],
412            ],'delete' => [
413              'path' => 'v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}',
414              'httpMethod' => 'DELETE',
415              'parameters' => [
416                'matterId' => [
417                  'location' => 'path',
418                  'type' => 'string',
419                  'required' => true,
420                ],
421                'holdId' => [
422                  'location' => 'path',
423                  'type' => 'string',
424                  'required' => true,
425                ],
426                'accountId' => [
427                  'location' => 'path',
428                  'type' => 'string',
429                  'required' => true,
430                ],
431              ],
432            ],'list' => [
433              'path' => 'v1/matters/{matterId}/holds/{holdId}/accounts',
434              'httpMethod' => 'GET',
435              'parameters' => [
436                'matterId' => [
437                  'location' => 'path',
438                  'type' => 'string',
439                  'required' => true,
440                ],
441                'holdId' => [
442                  'location' => 'path',
443                  'type' => 'string',
444                  'required' => true,
445                ],
446              ],
447            ],
448          ]
449        ]
450    );
451    $this->matters_savedQueries = new Vault\Resource\MattersSavedQueries(
452        $this,
453        $this->serviceName,
454        'savedQueries',
455        [
456          'methods' => [
457            'create' => [
458              'path' => 'v1/matters/{matterId}/savedQueries',
459              'httpMethod' => 'POST',
460              'parameters' => [
461                'matterId' => [
462                  'location' => 'path',
463                  'type' => 'string',
464                  'required' => true,
465                ],
466              ],
467            ],'delete' => [
468              'path' => 'v1/matters/{matterId}/savedQueries/{savedQueryId}',
469              'httpMethod' => 'DELETE',
470              'parameters' => [
471                'matterId' => [
472                  'location' => 'path',
473                  'type' => 'string',
474                  'required' => true,
475                ],
476                'savedQueryId' => [
477                  'location' => 'path',
478                  'type' => 'string',
479                  'required' => true,
480                ],
481              ],
482            ],'get' => [
483              'path' => 'v1/matters/{matterId}/savedQueries/{savedQueryId}',
484              'httpMethod' => 'GET',
485              'parameters' => [
486                'matterId' => [
487                  'location' => 'path',
488                  'type' => 'string',
489                  'required' => true,
490                ],
491                'savedQueryId' => [
492                  'location' => 'path',
493                  'type' => 'string',
494                  'required' => true,
495                ],
496              ],
497            ],'list' => [
498              'path' => 'v1/matters/{matterId}/savedQueries',
499              'httpMethod' => 'GET',
500              'parameters' => [
501                'matterId' => [
502                  'location' => 'path',
503                  'type' => 'string',
504                  'required' => true,
505                ],
506                'pageSize' => [
507                  'location' => 'query',
508                  'type' => 'integer',
509                ],
510                'pageToken' => [
511                  'location' => 'query',
512                  'type' => 'string',
513                ],
514              ],
515            ],
516          ]
517        ]
518    );
519    $this->operations = new Vault\Resource\Operations(
520        $this,
521        $this->serviceName,
522        'operations',
523        [
524          'methods' => [
525            'cancel' => [
526              'path' => 'v1/{+name}:cancel',
527              'httpMethod' => 'POST',
528              'parameters' => [
529                'name' => [
530                  'location' => 'path',
531                  'type' => 'string',
532                  'required' => true,
533                ],
534              ],
535            ],'delete' => [
536              'path' => 'v1/{+name}',
537              'httpMethod' => 'DELETE',
538              'parameters' => [
539                'name' => [
540                  'location' => 'path',
541                  'type' => 'string',
542                  'required' => true,
543                ],
544              ],
545            ],'get' => [
546              'path' => 'v1/{+name}',
547              'httpMethod' => 'GET',
548              'parameters' => [
549                'name' => [
550                  'location' => 'path',
551                  'type' => 'string',
552                  'required' => true,
553                ],
554              ],
555            ],'list' => [
556              'path' => 'v1/{+name}',
557              'httpMethod' => 'GET',
558              'parameters' => [
559                'name' => [
560                  'location' => 'path',
561                  'type' => 'string',
562                  'required' => true,
563                ],
564                'filter' => [
565                  'location' => 'query',
566                  'type' => 'string',
567                ],
568                'pageSize' => [
569                  'location' => 'query',
570                  'type' => 'integer',
571                ],
572                'pageToken' => [
573                  'location' => 'query',
574                  'type' => 'string',
575                ],
576              ],
577            ],
578          ]
579        ]
580    );
581  }
582}
583
584// Adding a class alias for backwards compatibility with the previous class name.
585class_alias(Vault::class, 'Google_Service_Vault');
586