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\ChangeList;
21use Google\Service\Drive\Channel;
22use Google\Service\Drive\StartPageToken;
23
24/**
25 * The "changes" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $driveService = new Google\Service\Drive(...);
29 *   $changes = $driveService->changes;
30 *  </code>
31 */
32class Changes extends \Google\Service\Resource
33{
34  /**
35   * Gets the starting pageToken for listing future changes.
36   * (changes.getStartPageToken)
37   *
38   * @param array $optParams Optional parameters.
39   *
40   * @opt_param string driveId The ID of the shared drive for which the starting
41   * pageToken for listing future changes from that shared drive is returned.
42   * @opt_param bool supportsAllDrives Whether the requesting application supports
43   * both My Drives and shared drives.
44   * @opt_param bool supportsTeamDrives Deprecated use supportsAllDrives instead.
45   * @opt_param string teamDriveId Deprecated use driveId instead.
46   * @return StartPageToken
47   */
48  public function getStartPageToken($optParams = [])
49  {
50    $params = [];
51    $params = array_merge($params, $optParams);
52    return $this->call('getStartPageToken', [$params], StartPageToken::class);
53  }
54  /**
55   * Lists the changes for a user or shared drive. (changes.listChanges)
56   *
57   * @param string $pageToken The token for continuing a previous list request on
58   * the next page. This should be set to the value of 'nextPageToken' from the
59   * previous response or to the response from the getStartPageToken method.
60   * @param array $optParams Optional parameters.
61   *
62   * @opt_param string driveId The shared drive from which changes are returned.
63   * If specified the change IDs will be reflective of the shared drive; use the
64   * combined drive ID and change ID as an identifier.
65   * @opt_param bool includeCorpusRemovals Whether changes should include the file
66   * resource if the file is still accessible by the user at the time of the
67   * request, even when a file was removed from the list of changes and there will
68   * be no further change entries for this file.
69   * @opt_param bool includeItemsFromAllDrives Whether both My Drive and shared
70   * drive items should be included in results.
71   * @opt_param string includePermissionsForView Specifies which additional view's
72   * permissions to include in the response. Only 'published' is supported.
73   * @opt_param bool includeRemoved Whether to include changes indicating that
74   * items have been removed from the list of changes, for example by deletion or
75   * loss of access.
76   * @opt_param bool includeTeamDriveItems Deprecated use
77   * includeItemsFromAllDrives instead.
78   * @opt_param int pageSize The maximum number of changes to return per page.
79   * @opt_param bool restrictToMyDrive Whether to restrict the results to changes
80   * inside the My Drive hierarchy. This omits changes to files such as those in
81   * the Application Data folder or shared files which have not been added to My
82   * Drive.
83   * @opt_param string spaces A comma-separated list of spaces to query within the
84   * user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
85   * @opt_param bool supportsAllDrives Whether the requesting application supports
86   * both My Drives and shared drives.
87   * @opt_param bool supportsTeamDrives Deprecated use supportsAllDrives instead.
88   * @opt_param string teamDriveId Deprecated use driveId instead.
89   * @return ChangeList
90   */
91  public function listChanges($pageToken, $optParams = [])
92  {
93    $params = ['pageToken' => $pageToken];
94    $params = array_merge($params, $optParams);
95    return $this->call('list', [$params], ChangeList::class);
96  }
97  /**
98   * Subscribes to changes for a user. (changes.watch)
99   *
100   * @param string $pageToken The token for continuing a previous list request on
101   * the next page. This should be set to the value of 'nextPageToken' from the
102   * previous response or to the response from the getStartPageToken method.
103   * @param Channel $postBody
104   * @param array $optParams Optional parameters.
105   *
106   * @opt_param string driveId The shared drive from which changes are returned.
107   * If specified the change IDs will be reflective of the shared drive; use the
108   * combined drive ID and change ID as an identifier.
109   * @opt_param bool includeCorpusRemovals Whether changes should include the file
110   * resource if the file is still accessible by the user at the time of the
111   * request, even when a file was removed from the list of changes and there will
112   * be no further change entries for this file.
113   * @opt_param bool includeItemsFromAllDrives Whether both My Drive and shared
114   * drive items should be included in results.
115   * @opt_param string includePermissionsForView Specifies which additional view's
116   * permissions to include in the response. Only 'published' is supported.
117   * @opt_param bool includeRemoved Whether to include changes indicating that
118   * items have been removed from the list of changes, for example by deletion or
119   * loss of access.
120   * @opt_param bool includeTeamDriveItems Deprecated use
121   * includeItemsFromAllDrives instead.
122   * @opt_param int pageSize The maximum number of changes to return per page.
123   * @opt_param bool restrictToMyDrive Whether to restrict the results to changes
124   * inside the My Drive hierarchy. This omits changes to files such as those in
125   * the Application Data folder or shared files which have not been added to My
126   * Drive.
127   * @opt_param string spaces A comma-separated list of spaces to query within the
128   * user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
129   * @opt_param bool supportsAllDrives Whether the requesting application supports
130   * both My Drives and shared drives.
131   * @opt_param bool supportsTeamDrives Deprecated use supportsAllDrives instead.
132   * @opt_param string teamDriveId Deprecated use driveId instead.
133   * @return Channel
134   */
135  public function watch($pageToken, Channel $postBody, $optParams = [])
136  {
137    $params = ['pageToken' => $pageToken, 'postBody' => $postBody];
138    $params = array_merge($params, $optParams);
139    return $this->call('watch', [$params], Channel::class);
140  }
141}
142
143// Adding a class alias for backwards compatibility with the previous class name.
144class_alias(Changes::class, 'Google_Service_Drive_Resource_Changes');
145