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\Drive\Resource;
19
20use Google\Service\Drive\TeamDrive;
21use Google\Service\Drive\TeamDriveList;
22
23/**
24 * The "teamdrives" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $driveService = new Google\Service\Drive(...);
28 *   $teamdrives = $driveService->teamdrives;
29 *  </code>
30 */
31class Teamdrives extends \Google\Service\Resource
32{
33  /**
34   * Deprecated use drives.create instead. (teamdrives.create)
35   *
36   * @param string $requestId An ID, such as a random UUID, which uniquely
37   * identifies this user's request for idempotent creation of a Team Drive. A
38   * repeated request by the same user and with the same request ID will avoid
39   * creating duplicates by attempting to create the same Team Drive. If the Team
40   * Drive already exists a 409 error will be returned.
41   * @param TeamDrive $postBody
42   * @param array $optParams Optional parameters.
43   * @return TeamDrive
44   */
45  public function create($requestId, TeamDrive $postBody, $optParams = [])
46  {
47    $params = ['requestId' => $requestId, 'postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('create', [$params], TeamDrive::class);
50  }
51  /**
52   * Deprecated use drives.delete instead. (teamdrives.delete)
53   *
54   * @param string $teamDriveId The ID of the Team Drive
55   * @param array $optParams Optional parameters.
56   */
57  public function delete($teamDriveId, $optParams = [])
58  {
59    $params = ['teamDriveId' => $teamDriveId];
60    $params = array_merge($params, $optParams);
61    return $this->call('delete', [$params]);
62  }
63  /**
64   * Deprecated use drives.get instead. (teamdrives.get)
65   *
66   * @param string $teamDriveId The ID of the Team Drive
67   * @param array $optParams Optional parameters.
68   *
69   * @opt_param bool useDomainAdminAccess Issue the request as a domain
70   * administrator; if set to true, then the requester will be granted access if
71   * they are an administrator of the domain to which the Team Drive belongs.
72   * @return TeamDrive
73   */
74  public function get($teamDriveId, $optParams = [])
75  {
76    $params = ['teamDriveId' => $teamDriveId];
77    $params = array_merge($params, $optParams);
78    return $this->call('get', [$params], TeamDrive::class);
79  }
80  /**
81   * Deprecated use drives.list instead. (teamdrives.listTeamdrives)
82   *
83   * @param array $optParams Optional parameters.
84   *
85   * @opt_param int pageSize Maximum number of Team Drives to return.
86   * @opt_param string pageToken Page token for Team Drives.
87   * @opt_param string q Query string for searching Team Drives.
88   * @opt_param bool useDomainAdminAccess Issue the request as a domain
89   * administrator; if set to true, then all Team Drives of the domain in which
90   * the requester is an administrator are returned.
91   * @return TeamDriveList
92   */
93  public function listTeamdrives($optParams = [])
94  {
95    $params = [];
96    $params = array_merge($params, $optParams);
97    return $this->call('list', [$params], TeamDriveList::class);
98  }
99  /**
100   * Deprecated use drives.update instead (teamdrives.update)
101   *
102   * @param string $teamDriveId The ID of the Team Drive
103   * @param TeamDrive $postBody
104   * @param array $optParams Optional parameters.
105   *
106   * @opt_param bool useDomainAdminAccess Issue the request as a domain
107   * administrator; if set to true, then the requester will be granted access if
108   * they are an administrator of the domain to which the Team Drive belongs.
109   * @return TeamDrive
110   */
111  public function update($teamDriveId, TeamDrive $postBody, $optParams = [])
112  {
113    $params = ['teamDriveId' => $teamDriveId, 'postBody' => $postBody];
114    $params = array_merge($params, $optParams);
115    return $this->call('update', [$params], TeamDrive::class);
116  }
117}
118
119// Adding a class alias for backwards compatibility with the previous class name.
120class_alias(Teamdrives::class, 'Google_Service_Drive_Resource_Teamdrives');
121