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