universal-mcp-applications 0.1.13__py3-none-any.whl → 0.1.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of universal-mcp-applications might be problematic. Click here for more details.
- universal_mcp/applications/aws_s3/app.py +71 -71
- universal_mcp/applications/calendly/app.py +199 -199
- universal_mcp/applications/canva/app.py +189 -189
- universal_mcp/applications/domain_checker/app.py +31 -24
- universal_mcp/applications/e2b/app.py +6 -7
- universal_mcp/applications/elevenlabs/app.py +24 -20
- universal_mcp/applications/exa/app.py +25 -20
- universal_mcp/applications/falai/app.py +44 -41
- universal_mcp/applications/file_system/app.py +20 -12
- universal_mcp/applications/firecrawl/app.py +46 -47
- universal_mcp/applications/fireflies/app.py +79 -79
- universal_mcp/applications/fpl/app.py +83 -74
- universal_mcp/applications/github/README.md +0 -1028
- universal_mcp/applications/github/app.py +55 -50227
- universal_mcp/applications/google_calendar/app.py +63 -65
- universal_mcp/applications/google_docs/app.py +78 -78
- universal_mcp/applications/google_drive/app.py +361 -440
- universal_mcp/applications/google_gemini/app.py +34 -17
- universal_mcp/applications/google_mail/app.py +117 -117
- universal_mcp/applications/google_searchconsole/app.py +41 -47
- universal_mcp/applications/google_sheet/app.py +157 -164
- universal_mcp/applications/http_tools/app.py +16 -16
- universal_mcp/applications/linkedin/app.py +26 -31
- universal_mcp/applications/ms_teams/app.py +190 -190
- universal_mcp/applications/openai/app.py +55 -56
- universal_mcp/applications/outlook/app.py +71 -71
- universal_mcp/applications/perplexity/app.py +17 -17
- universal_mcp/applications/reddit/app.py +225 -4053
- universal_mcp/applications/replicate/app.py +40 -42
- universal_mcp/applications/resend/app.py +157 -154
- universal_mcp/applications/scraper/app.py +24 -24
- universal_mcp/applications/serpapi/app.py +18 -20
- universal_mcp/applications/sharepoint/app.py +46 -36
- universal_mcp/applications/slack/app.py +66 -66
- universal_mcp/applications/tavily/app.py +7 -7
- universal_mcp/applications/twitter/api_segments/compliance_api.py +17 -20
- universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +35 -40
- universal_mcp/applications/twitter/api_segments/dm_events_api.py +18 -21
- universal_mcp/applications/twitter/api_segments/likes_api.py +19 -22
- universal_mcp/applications/twitter/api_segments/lists_api.py +59 -68
- universal_mcp/applications/twitter/api_segments/spaces_api.py +36 -42
- universal_mcp/applications/twitter/api_segments/trends_api.py +7 -8
- universal_mcp/applications/twitter/api_segments/tweets_api.py +159 -185
- universal_mcp/applications/twitter/api_segments/usage_api.py +5 -6
- universal_mcp/applications/twitter/api_segments/users_api.py +230 -264
- universal_mcp/applications/unipile/app.py +99 -105
- universal_mcp/applications/whatsapp/app.py +86 -82
- universal_mcp/applications/whatsapp_business/app.py +147 -147
- universal_mcp/applications/youtube/app.py +290 -290
- universal_mcp/applications/zenquotes/app.py +6 -6
- {universal_mcp_applications-0.1.13.dist-info → universal_mcp_applications-0.1.15.dist-info}/METADATA +2 -2
- {universal_mcp_applications-0.1.13.dist-info → universal_mcp_applications-0.1.15.dist-info}/RECORD +54 -54
- {universal_mcp_applications-0.1.13.dist-info → universal_mcp_applications-0.1.15.dist-info}/WHEEL +0 -0
- {universal_mcp_applications-0.1.13.dist-info → universal_mcp_applications-0.1.15.dist-info}/licenses/LICENSE +0 -0
|
@@ -17,25 +17,25 @@ class GoogleDriveApp(APIApplication):
|
|
|
17
17
|
super().__init__(name="google_drive", integration=integration)
|
|
18
18
|
self.base_url = "https://www.googleapis.com/drive/v3"
|
|
19
19
|
|
|
20
|
-
def
|
|
20
|
+
def move_file(
|
|
21
21
|
self, file_id: str, add_parents: str, remove_parents: str
|
|
22
22
|
) -> dict[str, Any]:
|
|
23
23
|
"""
|
|
24
|
-
Moves a file
|
|
25
|
-
|
|
24
|
+
Moves a specified file to a new folder in Google Drive by updating its parent references. It adds the file to a destination folder and removes it from the source, returning the updated file metadata.
|
|
25
|
+
|
|
26
26
|
Args:
|
|
27
27
|
file_id: The ID of the file to move
|
|
28
28
|
add_parents: The ID of the destination folder (new parent)
|
|
29
29
|
remove_parents: The ID of the source folder (old parent to remove)
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
Returns:
|
|
32
32
|
A dictionary containing the updated file information
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
Raises:
|
|
35
35
|
HTTPError: If the API request fails or returns an error status code
|
|
36
36
|
ConnectionError: If there are network connectivity issues
|
|
37
37
|
AuthenticationError: If the authentication credentials are invalid or expired
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
Tags:
|
|
40
40
|
move, file, folder, parent, patch, api, important
|
|
41
41
|
"""
|
|
@@ -48,16 +48,16 @@ class GoogleDriveApp(APIApplication):
|
|
|
48
48
|
|
|
49
49
|
def get_drive_info(self) -> dict[str, Any]:
|
|
50
50
|
"""
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
Fetches key user and storage quota information for the authenticated Google Drive account. This streamlined function provides a focused alternative to `information_about_user_and_drive`, which queries the same endpoint but exposes all available API parameters.
|
|
52
|
+
|
|
53
53
|
Returns:
|
|
54
54
|
A dictionary containing Drive information including storage quota (usage, limit) and user details (name, email, etc.).
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
Raises:
|
|
57
57
|
HTTPError: If the API request fails or returns an error status code
|
|
58
58
|
ConnectionError: If there are network connectivity issues
|
|
59
59
|
AuthenticationError: If the authentication credentials are invalid or expired
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
Tags:
|
|
62
62
|
get, info, storage, drive, quota, user, api, important
|
|
63
63
|
"""
|
|
@@ -66,24 +66,24 @@ class GoogleDriveApp(APIApplication):
|
|
|
66
66
|
response = self._get(url, params=params)
|
|
67
67
|
return response.json()
|
|
68
68
|
|
|
69
|
-
def
|
|
69
|
+
def search_files(
|
|
70
70
|
self, page_size: int = 10, query: str | None = None, order_by: str | None = None
|
|
71
71
|
) -> dict[str, Any]:
|
|
72
72
|
"""
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
Searches for files in Google Drive, allowing for powerful filtering, sorting, and pagination. This curated function offers a more user-friendly alternative to the comprehensive `list_user_sfiles` method, making it ideal for targeted queries like finding files by name or type.
|
|
74
|
+
|
|
75
75
|
Args:
|
|
76
76
|
page_size: Maximum number of files to return per page (default: 10)
|
|
77
77
|
query: Optional search query string using Google Drive query syntax (e.g., "mimeType='image/jpeg'")
|
|
78
78
|
order_by: Optional field name to sort results by, with optional direction (e.g., "modifiedTime desc")
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
Returns:
|
|
81
81
|
Dictionary containing a list of files and metadata, including 'files' array and optional 'nextPageToken' for pagination
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
Raises:
|
|
84
84
|
HTTPError: Raised when the API request fails or returns an error status code
|
|
85
85
|
RequestException: Raised when network connectivity issues occur during the API request
|
|
86
|
-
|
|
86
|
+
|
|
87
87
|
Tags:
|
|
88
88
|
list, files, search, google-drive, pagination, important
|
|
89
89
|
"""
|
|
@@ -99,20 +99,20 @@ class GoogleDriveApp(APIApplication):
|
|
|
99
99
|
response.raise_for_status()
|
|
100
100
|
return response.json()
|
|
101
101
|
|
|
102
|
-
def
|
|
102
|
+
def get_file_details(self, file_id: str) -> dict[str, Any]:
|
|
103
103
|
"""
|
|
104
|
-
Retrieves
|
|
105
|
-
|
|
104
|
+
Retrieves all default metadata for a specific file from Google Drive using its ID. This is a simplified alternative to `get_file_metadata`, fetching complete file attributes without optional query parameters for customizing the response.
|
|
105
|
+
|
|
106
106
|
Args:
|
|
107
107
|
file_id: String identifier of the file whose metadata should be retrieved
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
Returns:
|
|
110
110
|
Dictionary containing the file's metadata including properties such as name, size, type, and other attributes
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
Raises:
|
|
113
113
|
HTTPError: When the API request fails due to invalid file_id or network issues
|
|
114
114
|
JSONDecodeError: When the API response cannot be parsed as JSON
|
|
115
|
-
|
|
115
|
+
|
|
116
116
|
Tags:
|
|
117
117
|
retrieve, file, metadata, get, api, important
|
|
118
118
|
"""
|
|
@@ -120,19 +120,19 @@ class GoogleDriveApp(APIApplication):
|
|
|
120
120
|
response = self._get(url)
|
|
121
121
|
return response.json()
|
|
122
122
|
|
|
123
|
-
def
|
|
123
|
+
def trash_file(self, file_id: str) -> dict[str, Any]:
|
|
124
124
|
"""
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
Moves a specified file to the trash using its ID. It provides simplified error handling by catching exceptions and returning a dictionary with a success or error message, unlike `delete_file_by_id` which raises exceptions on failure.
|
|
126
|
+
|
|
127
127
|
Args:
|
|
128
128
|
file_id: The unique identifier string of the file to be deleted from Google Drive
|
|
129
|
-
|
|
129
|
+
|
|
130
130
|
Returns:
|
|
131
131
|
A dictionary containing either a success message {'message': 'File deleted successfully'} or an error message {'error': 'error description'}
|
|
132
|
-
|
|
132
|
+
|
|
133
133
|
Raises:
|
|
134
134
|
Exception: When the DELETE request fails due to network issues, invalid file_id, insufficient permissions, or other API errors
|
|
135
|
-
|
|
135
|
+
|
|
136
136
|
Tags:
|
|
137
137
|
delete, file-management, google-drive, api, important
|
|
138
138
|
"""
|
|
@@ -143,7 +143,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
143
143
|
except Exception as e:
|
|
144
144
|
return {"error": str(e)}
|
|
145
145
|
|
|
146
|
-
def
|
|
146
|
+
def create_text_file(
|
|
147
147
|
self,
|
|
148
148
|
file_name: str,
|
|
149
149
|
text_content: str,
|
|
@@ -151,21 +151,21 @@ class GoogleDriveApp(APIApplication):
|
|
|
151
151
|
mime_type: str = "text/plain",
|
|
152
152
|
) -> dict[str, Any]:
|
|
153
153
|
"""
|
|
154
|
-
Creates a new file in Google Drive
|
|
155
|
-
|
|
154
|
+
Creates a new file in Google Drive from a given text string. The function first creates the file's metadata (name, parent folder), then uploads the provided string as its content, returning the new file's full metadata upon completion.
|
|
155
|
+
|
|
156
156
|
Args:
|
|
157
157
|
file_name: Name of the file to create on Google Drive
|
|
158
158
|
text_content: Plain text content to be written to the file
|
|
159
159
|
parent_id: Optional ID of the parent folder where the file will be created
|
|
160
160
|
mime_type: MIME type of the file (defaults to 'text/plain')
|
|
161
|
-
|
|
161
|
+
|
|
162
162
|
Returns:
|
|
163
163
|
Dictionary containing metadata of the created file including ID, name, and other Google Drive file properties
|
|
164
|
-
|
|
164
|
+
|
|
165
165
|
Raises:
|
|
166
166
|
HTTPStatusError: Raised when the API request fails during file creation or content upload
|
|
167
167
|
UnicodeEncodeError: Raised when the text_content cannot be encoded in UTF-8
|
|
168
|
-
|
|
168
|
+
|
|
169
169
|
Tags:
|
|
170
170
|
create, file, upload, drive, text, important, storage, document
|
|
171
171
|
"""
|
|
@@ -188,17 +188,17 @@ class GoogleDriveApp(APIApplication):
|
|
|
188
188
|
|
|
189
189
|
def find_folder_id_by_name(self, folder_name: str) -> str | None:
|
|
190
190
|
"""
|
|
191
|
-
Searches for and
|
|
192
|
-
|
|
191
|
+
Searches for a non-trashed folder by its exact name and returns the ID of the first match. This utility, used by `create_folder` to resolve parent names, logs errors and returns None if the folder is not found or the API request fails.
|
|
192
|
+
|
|
193
193
|
Args:
|
|
194
194
|
folder_name: The name of the folder to search for in Google Drive
|
|
195
|
-
|
|
195
|
+
|
|
196
196
|
Returns:
|
|
197
197
|
str | None: The folder's ID if a matching folder is found, None if no folder is found or if an error occurs
|
|
198
|
-
|
|
198
|
+
|
|
199
199
|
Raises:
|
|
200
200
|
Exception: Caught internally and logged when API requests fail or response parsing errors occur
|
|
201
|
-
|
|
201
|
+
|
|
202
202
|
Tags:
|
|
203
203
|
search, find, google-drive, folder, query, api, utility
|
|
204
204
|
"""
|
|
@@ -216,18 +216,18 @@ class GoogleDriveApp(APIApplication):
|
|
|
216
216
|
|
|
217
217
|
def create_folder(self, folder_name: str, parent_id: str = None) -> dict[str, Any]:
|
|
218
218
|
"""
|
|
219
|
-
Creates a new folder in Google Drive
|
|
220
|
-
|
|
219
|
+
Creates a new folder in Google Drive, optionally within a parent folder specified by its name or ID. If a name is provided for the parent, the function automatically resolves it to an ID. Returns the metadata for the newly created folder.
|
|
220
|
+
|
|
221
221
|
Args:
|
|
222
222
|
folder_name: Name of the folder to create
|
|
223
223
|
parent_id: ID or name of the parent folder. Can be either a folder ID string or a folder name that will be automatically looked up
|
|
224
|
-
|
|
224
|
+
|
|
225
225
|
Returns:
|
|
226
226
|
Dictionary containing the created folder's metadata including its ID, name, and other Drive-specific information
|
|
227
|
-
|
|
227
|
+
|
|
228
228
|
Raises:
|
|
229
229
|
ValueError: Raised when a parent folder name is provided but cannot be found in Google Drive
|
|
230
|
-
|
|
230
|
+
|
|
231
231
|
Tags:
|
|
232
232
|
create, folder, drive, storage, important, management
|
|
233
233
|
"""
|
|
@@ -253,7 +253,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
253
253
|
response = self._post(url, data=metadata, params=params)
|
|
254
254
|
return response.json()
|
|
255
255
|
|
|
256
|
-
def
|
|
256
|
+
def upload_file_from_path(
|
|
257
257
|
self,
|
|
258
258
|
file_name: str,
|
|
259
259
|
file_path: str,
|
|
@@ -261,22 +261,22 @@ class GoogleDriveApp(APIApplication):
|
|
|
261
261
|
mime_type: str = None,
|
|
262
262
|
) -> dict[str, Any]:
|
|
263
263
|
"""
|
|
264
|
-
Uploads a file to Google Drive by
|
|
265
|
-
|
|
264
|
+
Uploads a local file to Google Drive by reading its binary content from a path. It first creates the file's metadata entry, then uploads the content, returning the new file's metadata. This differs from `create_file_from_text` which uses in-memory string content instead of a local file.
|
|
265
|
+
|
|
266
266
|
Args:
|
|
267
267
|
file_name: Name to give the file on Google Drive
|
|
268
268
|
file_path: Path to the local file to upload
|
|
269
269
|
parent_id: Optional ID of the parent folder to create the file in
|
|
270
270
|
mime_type: MIME type of the file (e.g., 'image/jpeg', 'image/png', 'application/pdf')
|
|
271
|
-
|
|
271
|
+
|
|
272
272
|
Returns:
|
|
273
273
|
Dictionary containing the uploaded file's metadata from Google Drive
|
|
274
|
-
|
|
274
|
+
|
|
275
275
|
Raises:
|
|
276
276
|
FileNotFoundError: When the specified file_path does not exist or is not accessible
|
|
277
277
|
HTTPError: When the API request fails or returns an error status code
|
|
278
278
|
IOError: When there are issues reading the file content
|
|
279
|
-
|
|
279
|
+
|
|
280
280
|
Tags:
|
|
281
281
|
upload, file-handling, google-drive, api, important, binary, storage
|
|
282
282
|
"""
|
|
@@ -301,7 +301,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
301
301
|
response_data = upload_response.json()
|
|
302
302
|
return response_data
|
|
303
303
|
|
|
304
|
-
def
|
|
304
|
+
def list_installed_apps(
|
|
305
305
|
self,
|
|
306
306
|
appFilterExtensions: str | None = None,
|
|
307
307
|
appFilterMimeTypes: str | None = None,
|
|
@@ -319,8 +319,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
319
319
|
xgafv: str | None = None,
|
|
320
320
|
) -> dict[str, Any]:
|
|
321
321
|
"""
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
Retrieves a list of the user's installed Google Drive applications. Allows optional filtering by file extensions or MIME types to find apps capable of opening specific file formats, returning a detailed list of matching applications.
|
|
323
|
+
|
|
324
324
|
Args:
|
|
325
325
|
appFilterExtensions (string): A query parameter to filter applications based on extensions, allowing string values to be specified in the URL. Example: '<string>'.
|
|
326
326
|
appFilterMimeTypes (string): Filters the results to include only apps that can open any of the provided comma-separated list of MIME types[4][1]. Example: '<string>'.
|
|
@@ -336,14 +336,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
336
336
|
upload_protocol (string): Upload protocol for media (e.g. "raw", "multipart"). Example: '<string>'.
|
|
337
337
|
uploadType (string): Legacy upload protocol for media (e.g. "media", "multipart"). Example: '<string>'.
|
|
338
338
|
xgafv (string): V1 error format. Example: '<string>'.
|
|
339
|
-
|
|
339
|
+
|
|
340
340
|
Returns:
|
|
341
341
|
dict[str, Any]: Successful response
|
|
342
|
-
|
|
342
|
+
|
|
343
343
|
Raises:
|
|
344
344
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
345
345
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
346
|
-
|
|
346
|
+
|
|
347
347
|
Tags:
|
|
348
348
|
Apps
|
|
349
349
|
"""
|
|
@@ -381,7 +381,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
381
381
|
except ValueError:
|
|
382
382
|
return None
|
|
383
383
|
|
|
384
|
-
def
|
|
384
|
+
def get_app_by_id(
|
|
385
385
|
self,
|
|
386
386
|
appId: str,
|
|
387
387
|
access_token: str | None = None,
|
|
@@ -397,8 +397,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
397
397
|
xgafv: str | None = None,
|
|
398
398
|
) -> dict[str, Any]:
|
|
399
399
|
"""
|
|
400
|
-
|
|
401
|
-
|
|
400
|
+
Retrieves detailed information for a single installed Google Drive application using its unique ID. This function fetches one app, unlike `list_user_sinstalled_apps` which returns a complete list, allowing for targeted data retrieval about a specific application.
|
|
401
|
+
|
|
402
402
|
Args:
|
|
403
403
|
appId (string): appId
|
|
404
404
|
access_token (string): OAuth access token. Example: '{{accessToken}}'.
|
|
@@ -412,14 +412,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
412
412
|
upload_protocol (string): Upload protocol for media (e.g. "raw", "multipart"). Example: '<string>'.
|
|
413
413
|
uploadType (string): Legacy upload protocol for media (e.g. "media", "multipart"). Example: '<string>'.
|
|
414
414
|
xgafv (string): V1 error format. Example: '<string>'.
|
|
415
|
-
|
|
415
|
+
|
|
416
416
|
Returns:
|
|
417
417
|
dict[str, Any]: Successful response
|
|
418
|
-
|
|
418
|
+
|
|
419
419
|
Raises:
|
|
420
420
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
421
421
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
422
|
-
|
|
422
|
+
|
|
423
423
|
Tags:
|
|
424
424
|
Apps
|
|
425
425
|
"""
|
|
@@ -456,7 +456,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
456
456
|
except ValueError:
|
|
457
457
|
return None
|
|
458
458
|
|
|
459
|
-
def
|
|
459
|
+
def get_about_info(
|
|
460
460
|
self,
|
|
461
461
|
alt: str | None = None,
|
|
462
462
|
fields: str | None = None,
|
|
@@ -467,8 +467,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
467
467
|
userIp: str | None = None,
|
|
468
468
|
) -> dict[str, Any]:
|
|
469
469
|
"""
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
Retrieves information about the user's account and Google Drive settings from the API's `/about` endpoint. This generic function provides full parameter control, offering a more flexible alternative to the `get_drive_info` method, which requests specific predefined fields like storage quota and user details.
|
|
471
|
+
|
|
472
472
|
Args:
|
|
473
473
|
alt (string): Data format for the response. Example: 'json'.
|
|
474
474
|
fields (string): Selector specifying which fields to include in a partial response. Example: '<string>'.
|
|
@@ -477,14 +477,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
477
477
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
478
478
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
479
479
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
480
|
-
|
|
480
|
+
|
|
481
481
|
Returns:
|
|
482
482
|
dict[str, Any]: Successful response
|
|
483
|
-
|
|
483
|
+
|
|
484
484
|
Raises:
|
|
485
485
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
486
486
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
487
|
-
|
|
487
|
+
|
|
488
488
|
Tags:
|
|
489
489
|
Information
|
|
490
490
|
"""
|
|
@@ -515,7 +515,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
515
515
|
except ValueError:
|
|
516
516
|
return None
|
|
517
517
|
|
|
518
|
-
def
|
|
518
|
+
def list_drive_changes(
|
|
519
519
|
self,
|
|
520
520
|
pageToken: str | None = None,
|
|
521
521
|
driveId: str | None = None,
|
|
@@ -540,8 +540,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
540
540
|
userIp: str | None = None,
|
|
541
541
|
) -> dict[str, Any]:
|
|
542
542
|
"""
|
|
543
|
-
|
|
544
|
-
|
|
543
|
+
Fetches a paginated list of file changes for a user's account or a specific shared drive, using a required page token. Supports various filters to customize the change log, enabling tracking of file activity for synchronization or auditing.
|
|
544
|
+
|
|
545
545
|
Args:
|
|
546
546
|
pageToken (string): (Required) The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. Example: '{{pageToken}}'.
|
|
547
547
|
driveId (string): The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier. Example: '{{driveId}}'.
|
|
@@ -564,14 +564,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
564
564
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
565
565
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
566
566
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
567
|
-
|
|
567
|
+
|
|
568
568
|
Returns:
|
|
569
569
|
dict[str, Any]: Successful response
|
|
570
|
-
|
|
570
|
+
|
|
571
571
|
Raises:
|
|
572
572
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
573
573
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
574
|
-
|
|
574
|
+
|
|
575
575
|
Tags:
|
|
576
576
|
Changes
|
|
577
577
|
"""
|
|
@@ -616,7 +616,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
616
616
|
except ValueError:
|
|
617
617
|
return None
|
|
618
618
|
|
|
619
|
-
def
|
|
619
|
+
def get_changes_start_token(
|
|
620
620
|
self,
|
|
621
621
|
driveId: str | None = None,
|
|
622
622
|
supportsAllDrives: str | None = None,
|
|
@@ -631,8 +631,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
631
631
|
userIp: str | None = None,
|
|
632
632
|
) -> dict[str, Any]:
|
|
633
633
|
"""
|
|
634
|
-
|
|
635
|
-
|
|
634
|
+
Retrieves a starting page token representing the current state of a user's Drive or a shared drive. This token serves as a baseline for subsequent calls to list future file and folder changes, enabling efficient, incremental change tracking.
|
|
635
|
+
|
|
636
636
|
Args:
|
|
637
637
|
driveId (string): The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned. Example: '{{driveId}}'.
|
|
638
638
|
supportsAllDrives (string): Whether the requesting application supports both My Drives and shared drives. Example: '<boolean>'.
|
|
@@ -645,14 +645,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
645
645
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
646
646
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
647
647
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
648
|
-
|
|
648
|
+
|
|
649
649
|
Returns:
|
|
650
650
|
dict[str, Any]: Successful response
|
|
651
|
-
|
|
651
|
+
|
|
652
652
|
Raises:
|
|
653
653
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
654
654
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
655
|
-
|
|
655
|
+
|
|
656
656
|
Tags:
|
|
657
657
|
Changes
|
|
658
658
|
"""
|
|
@@ -687,7 +687,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
687
687
|
except ValueError:
|
|
688
688
|
return None
|
|
689
689
|
|
|
690
|
-
def
|
|
690
|
+
def watch_drive_changes(
|
|
691
691
|
self,
|
|
692
692
|
pageToken: str | None = None,
|
|
693
693
|
driveId: str | None = None,
|
|
@@ -722,8 +722,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
722
722
|
type: str | None = None,
|
|
723
723
|
) -> dict[str, Any]:
|
|
724
724
|
"""
|
|
725
|
-
|
|
726
|
-
|
|
725
|
+
Sets up a push notification channel to monitor changes across a user's Google Drive or a specific shared drive. This allows an external service to receive updates when files are modified, added, or deleted, based on specified filters.
|
|
726
|
+
|
|
727
727
|
Args:
|
|
728
728
|
pageToken (string): (Required) The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. Example: '{{pageToken}}'.
|
|
729
729
|
driveId (string): The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier. Example: '{{driveId}}'.
|
|
@@ -756,14 +756,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
756
756
|
resourceUri (string): resourceUri Example: '<string>'.
|
|
757
757
|
token (string): token Example: '<string>'.
|
|
758
758
|
type (string): type Example: '<string>'.
|
|
759
|
-
|
|
759
|
+
|
|
760
760
|
Returns:
|
|
761
761
|
dict[str, Any]: Successful response
|
|
762
|
-
|
|
762
|
+
|
|
763
763
|
Raises:
|
|
764
764
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
765
765
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
766
|
-
|
|
766
|
+
|
|
767
767
|
Tags:
|
|
768
768
|
Changes
|
|
769
769
|
"""
|
|
@@ -829,7 +829,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
829
829
|
except ValueError:
|
|
830
830
|
return None
|
|
831
831
|
|
|
832
|
-
def
|
|
832
|
+
def stop_watching_channel(
|
|
833
833
|
self,
|
|
834
834
|
alt: str | None = None,
|
|
835
835
|
fields: str | None = None,
|
|
@@ -850,8 +850,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
850
850
|
type: str | None = None,
|
|
851
851
|
) -> Any:
|
|
852
852
|
"""
|
|
853
|
-
|
|
854
|
-
|
|
853
|
+
Terminates an active push notification channel, ceasing the delivery of updates for a watched Google Drive resource. This requires the channel's ID and resource ID to identify and close the specific notification stream, effectively unsubscribing from real-time changes.
|
|
854
|
+
|
|
855
855
|
Args:
|
|
856
856
|
alt (string): Data format for the response. Example: 'json'.
|
|
857
857
|
fields (string): Selector specifying which fields to include in a partial response. Example: '<string>'.
|
|
@@ -870,14 +870,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
870
870
|
resourceUri (string): resourceUri Example: '<string>'.
|
|
871
871
|
token (string): token Example: '<string>'.
|
|
872
872
|
type (string): type Example: '<string>'.
|
|
873
|
-
|
|
873
|
+
|
|
874
874
|
Returns:
|
|
875
875
|
Any: Successful response
|
|
876
|
-
|
|
876
|
+
|
|
877
877
|
Raises:
|
|
878
878
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
879
879
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
880
|
-
|
|
880
|
+
|
|
881
881
|
Tags:
|
|
882
882
|
Channels
|
|
883
883
|
"""
|
|
@@ -929,7 +929,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
929
929
|
except ValueError:
|
|
930
930
|
return None
|
|
931
931
|
|
|
932
|
-
def
|
|
932
|
+
def list_file_comments(
|
|
933
933
|
self,
|
|
934
934
|
fileId: str,
|
|
935
935
|
includeDeleted: str | None = None,
|
|
@@ -945,8 +945,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
945
945
|
userIp: str | None = None,
|
|
946
946
|
) -> dict[str, Any]:
|
|
947
947
|
"""
|
|
948
|
-
|
|
949
|
-
|
|
948
|
+
Retrieves a list of comments for a specified file in Google Drive. Supports pagination and filtering options, such as including deleted comments or specifying a start time for modifications, to customize the results.
|
|
949
|
+
|
|
950
950
|
Args:
|
|
951
951
|
fileId (string): fileId
|
|
952
952
|
includeDeleted (string): Whether to include deleted comments. Deleted comments will not include their original content. Example: '<boolean>'.
|
|
@@ -960,14 +960,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
960
960
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
961
961
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
962
962
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
963
|
-
|
|
963
|
+
|
|
964
964
|
Returns:
|
|
965
965
|
dict[str, Any]: Successful response
|
|
966
|
-
|
|
966
|
+
|
|
967
967
|
Raises:
|
|
968
968
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
969
969
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
970
|
-
|
|
970
|
+
|
|
971
971
|
Tags:
|
|
972
972
|
Comments
|
|
973
973
|
"""
|
|
@@ -1004,7 +1004,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
1004
1004
|
except ValueError:
|
|
1005
1005
|
return None
|
|
1006
1006
|
|
|
1007
|
-
def
|
|
1007
|
+
def create_file_comment(
|
|
1008
1008
|
self,
|
|
1009
1009
|
fileId: str,
|
|
1010
1010
|
alt: str | None = None,
|
|
@@ -1028,8 +1028,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1028
1028
|
resolved: str | None = None,
|
|
1029
1029
|
) -> dict[str, Any]:
|
|
1030
1030
|
"""
|
|
1031
|
-
|
|
1032
|
-
|
|
1031
|
+
Creates a new comment on a specified Google Drive file. It requires a file ID and the comment's content, returning the new comment's metadata. This adds top-level comments, distinct from `create_areply_to_acomment` which replies to existing comments.
|
|
1032
|
+
|
|
1033
1033
|
Args:
|
|
1034
1034
|
fileId (string): fileId
|
|
1035
1035
|
alt (string): Data format for the response. Example: 'json'.
|
|
@@ -1051,14 +1051,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1051
1051
|
quotedFileContent (object): quotedFileContent Example: {'mimeType': '<string>', 'value': '<string>'}.
|
|
1052
1052
|
replies (array): replies Example: "[{'action': '<string>', 'author': {'displayName': '<string>', 'emailAddress': '<string>', 'kind': 'drive#user', 'me': '<boolean>', 'permissionId': '<string>', 'photoLink': '<string>'}, 'content': '<string>', 'createdTime': '<dateTime>', 'deleted': '<boolean>', 'htmlContent': '<string>', 'id': '<string>', 'kind': 'drive#reply', 'modifiedTime': '<dateTime>'}, {'action': '<string>', 'author': {'displayName': '<string>', 'emailAddress': '<string>', 'kind': 'drive#user', 'me': '<boolean>', 'permissionId': '<string>', 'photoLink': '<string>'}, 'content': '<string>', 'createdTime': '<dateTime>', 'deleted': '<boolean>', 'htmlContent': '<string>', 'id': '<string>', 'kind': 'drive#reply', 'modifiedTime': '<dateTime>'}]".
|
|
1053
1053
|
resolved (string): resolved Example: '<boolean>'.
|
|
1054
|
-
|
|
1054
|
+
|
|
1055
1055
|
Returns:
|
|
1056
1056
|
dict[str, Any]: Successful response
|
|
1057
|
-
|
|
1057
|
+
|
|
1058
1058
|
Raises:
|
|
1059
1059
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1060
1060
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1061
|
-
|
|
1061
|
+
|
|
1062
1062
|
Tags:
|
|
1063
1063
|
Comments
|
|
1064
1064
|
"""
|
|
@@ -1114,7 +1114,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
1114
1114
|
except ValueError:
|
|
1115
1115
|
return None
|
|
1116
1116
|
|
|
1117
|
-
def
|
|
1117
|
+
def get_file_comment_by_id(
|
|
1118
1118
|
self,
|
|
1119
1119
|
fileId: str,
|
|
1120
1120
|
commentId: str,
|
|
@@ -1128,8 +1128,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1128
1128
|
userIp: str | None = None,
|
|
1129
1129
|
) -> dict[str, Any]:
|
|
1130
1130
|
"""
|
|
1131
|
-
|
|
1132
|
-
|
|
1131
|
+
Retrieves the metadata for a specific comment on a file, identified by both the file ID and the comment ID. This function can optionally include deleted comments in the result, returning the comment's details.
|
|
1132
|
+
|
|
1133
1133
|
Args:
|
|
1134
1134
|
fileId (string): fileId
|
|
1135
1135
|
commentId (string): commentId
|
|
@@ -1141,14 +1141,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1141
1141
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
1142
1142
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
1143
1143
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
1144
|
-
|
|
1144
|
+
|
|
1145
1145
|
Returns:
|
|
1146
1146
|
dict[str, Any]: Successful response
|
|
1147
|
-
|
|
1147
|
+
|
|
1148
1148
|
Raises:
|
|
1149
1149
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1150
1150
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1151
|
-
|
|
1151
|
+
|
|
1152
1152
|
Tags:
|
|
1153
1153
|
Comments
|
|
1154
1154
|
"""
|
|
@@ -1184,7 +1184,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
1184
1184
|
except ValueError:
|
|
1185
1185
|
return None
|
|
1186
1186
|
|
|
1187
|
-
def
|
|
1187
|
+
def delete_comment(
|
|
1188
1188
|
self,
|
|
1189
1189
|
fileId: str,
|
|
1190
1190
|
commentId: str,
|
|
@@ -1197,8 +1197,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1197
1197
|
userIp: str | None = None,
|
|
1198
1198
|
) -> Any:
|
|
1199
1199
|
"""
|
|
1200
|
-
|
|
1201
|
-
|
|
1200
|
+
Permanently deletes a specific comment from a Google Drive file, identified by both the file ID and the comment ID. This action is irreversible and removes the comment from the associated file's history, distinct from deleting a reply.
|
|
1201
|
+
|
|
1202
1202
|
Args:
|
|
1203
1203
|
fileId (string): fileId
|
|
1204
1204
|
commentId (string): commentId
|
|
@@ -1209,14 +1209,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1209
1209
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
1210
1210
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
1211
1211
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
1212
|
-
|
|
1212
|
+
|
|
1213
1213
|
Returns:
|
|
1214
1214
|
Any: Successful response
|
|
1215
|
-
|
|
1215
|
+
|
|
1216
1216
|
Raises:
|
|
1217
1217
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1218
1218
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1219
|
-
|
|
1219
|
+
|
|
1220
1220
|
Tags:
|
|
1221
1221
|
Comments
|
|
1222
1222
|
"""
|
|
@@ -1276,8 +1276,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1276
1276
|
resolved: str | None = None,
|
|
1277
1277
|
) -> dict[str, Any]:
|
|
1278
1278
|
"""
|
|
1279
|
-
|
|
1280
|
-
|
|
1279
|
+
Updates an existing comment on a specified file using its unique ID. This function allows for partial modification of the comment's properties, such as its content or resolved status, and returns the updated comment's metadata.
|
|
1280
|
+
|
|
1281
1281
|
Args:
|
|
1282
1282
|
fileId (string): fileId
|
|
1283
1283
|
commentId (string): commentId
|
|
@@ -1300,14 +1300,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1300
1300
|
quotedFileContent (object): quotedFileContent Example: {'mimeType': '<string>', 'value': '<string>'}.
|
|
1301
1301
|
replies (array): replies Example: "[{'action': '<string>', 'author': {'displayName': '<string>', 'emailAddress': '<string>', 'kind': 'drive#user', 'me': '<boolean>', 'permissionId': '<string>', 'photoLink': '<string>'}, 'content': '<string>', 'createdTime': '<dateTime>', 'deleted': '<boolean>', 'htmlContent': '<string>', 'id': '<string>', 'kind': 'drive#reply', 'modifiedTime': '<dateTime>'}, {'action': '<string>', 'author': {'displayName': '<string>', 'emailAddress': '<string>', 'kind': 'drive#user', 'me': '<boolean>', 'permissionId': '<string>', 'photoLink': '<string>'}, 'content': '<string>', 'createdTime': '<dateTime>', 'deleted': '<boolean>', 'htmlContent': '<string>', 'id': '<string>', 'kind': 'drive#reply', 'modifiedTime': '<dateTime>'}]".
|
|
1302
1302
|
resolved (string): resolved Example: '<boolean>'.
|
|
1303
|
-
|
|
1303
|
+
|
|
1304
1304
|
Returns:
|
|
1305
1305
|
dict[str, Any]: Successful response
|
|
1306
|
-
|
|
1306
|
+
|
|
1307
1307
|
Raises:
|
|
1308
1308
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1309
1309
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1310
|
-
|
|
1310
|
+
|
|
1311
1311
|
Tags:
|
|
1312
1312
|
Comments
|
|
1313
1313
|
"""
|
|
@@ -1360,7 +1360,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
1360
1360
|
except ValueError:
|
|
1361
1361
|
return None
|
|
1362
1362
|
|
|
1363
|
-
def
|
|
1363
|
+
def list_shared_drives(
|
|
1364
1364
|
self,
|
|
1365
1365
|
pageSize: str | None = None,
|
|
1366
1366
|
pageToken: str | None = None,
|
|
@@ -1375,8 +1375,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1375
1375
|
userIp: str | None = None,
|
|
1376
1376
|
) -> dict[str, Any]:
|
|
1377
1377
|
"""
|
|
1378
|
-
|
|
1379
|
-
|
|
1378
|
+
Retrieves a paginated list of shared drives accessible to the user. Supports optional query-based filtering and can be executed with domain administrator privileges to list all shared drives within the domain. Returns a dictionary containing the list of drives and pagination details.
|
|
1379
|
+
|
|
1380
1380
|
Args:
|
|
1381
1381
|
pageSize (string): Maximum number of shared drives to return per page. Example: '<integer>'.
|
|
1382
1382
|
pageToken (string): Page token for shared drives. Example: '{{pageToken}}'.
|
|
@@ -1389,14 +1389,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1389
1389
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
1390
1390
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
1391
1391
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
1392
|
-
|
|
1392
|
+
|
|
1393
1393
|
Returns:
|
|
1394
1394
|
dict[str, Any]: Successful response
|
|
1395
|
-
|
|
1395
|
+
|
|
1396
1396
|
Raises:
|
|
1397
1397
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1398
1398
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1399
|
-
|
|
1399
|
+
|
|
1400
1400
|
Tags:
|
|
1401
1401
|
Shared Drive
|
|
1402
1402
|
"""
|
|
@@ -1431,7 +1431,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
1431
1431
|
except ValueError:
|
|
1432
1432
|
return None
|
|
1433
1433
|
|
|
1434
|
-
def
|
|
1434
|
+
def create_shared_drive(
|
|
1435
1435
|
self,
|
|
1436
1436
|
requestId: str | None = None,
|
|
1437
1437
|
alt: str | None = None,
|
|
@@ -1455,8 +1455,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1455
1455
|
themeId: str | None = None,
|
|
1456
1456
|
) -> dict[str, Any]:
|
|
1457
1457
|
"""
|
|
1458
|
-
|
|
1459
|
-
|
|
1458
|
+
Creates a new shared drive using a unique `requestId` for idempotency. This function allows specifying initial properties such as its name, background image, and access restrictions, returning the created drive's metadata on success.
|
|
1459
|
+
|
|
1460
1460
|
Args:
|
|
1461
1461
|
requestId (string): (Required) An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same shared drive. If the shared drive already exists a 409 error will be returned. Example: 'requestId'.
|
|
1462
1462
|
alt (string): Data format for the response. Example: 'json'.
|
|
@@ -1478,14 +1478,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1478
1478
|
orgUnitId (string): orgUnitId Example: '<string>'.
|
|
1479
1479
|
restrictions (object): restrictions Example: {'adminManagedRestrictions': '<boolean>', 'copyRequiresWriterPermission': '<boolean>', 'domainUsersOnly': '<boolean>', 'driveMembersOnly': '<boolean>', 'sharingFoldersRequiresOrganizerPermission': '<boolean>'}.
|
|
1480
1480
|
themeId (string): themeId Example: '<string>'.
|
|
1481
|
-
|
|
1481
|
+
|
|
1482
1482
|
Returns:
|
|
1483
1483
|
dict[str, Any]: Successful response
|
|
1484
|
-
|
|
1484
|
+
|
|
1485
1485
|
Raises:
|
|
1486
1486
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1487
1487
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1488
|
-
|
|
1488
|
+
|
|
1489
1489
|
Tags:
|
|
1490
1490
|
Shared Drive
|
|
1491
1491
|
"""
|
|
@@ -1540,7 +1540,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
1540
1540
|
except ValueError:
|
|
1541
1541
|
return None
|
|
1542
1542
|
|
|
1543
|
-
def
|
|
1543
|
+
def get_shared_drive_metadata(
|
|
1544
1544
|
self,
|
|
1545
1545
|
driveId: str,
|
|
1546
1546
|
useDomainAdminAccess: str | None = None,
|
|
@@ -1553,8 +1553,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1553
1553
|
userIp: str | None = None,
|
|
1554
1554
|
) -> dict[str, Any]:
|
|
1555
1555
|
"""
|
|
1556
|
-
|
|
1557
|
-
|
|
1556
|
+
Retrieves metadata for a specific shared drive using its ID. Supports domain administrator access and allows specifying fields for partial responses. Unlike `get_drive_info` which gets user account data, this function targets the properties of a single shared drive.
|
|
1557
|
+
|
|
1558
1558
|
Args:
|
|
1559
1559
|
driveId (string): driveId
|
|
1560
1560
|
useDomainAdminAccess (string): Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs. Example: '<boolean>'.
|
|
@@ -1565,14 +1565,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1565
1565
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
1566
1566
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
1567
1567
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
1568
|
-
|
|
1568
|
+
|
|
1569
1569
|
Returns:
|
|
1570
1570
|
dict[str, Any]: Successful response
|
|
1571
|
-
|
|
1571
|
+
|
|
1572
1572
|
Raises:
|
|
1573
1573
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1574
1574
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1575
|
-
|
|
1575
|
+
|
|
1576
1576
|
Tags:
|
|
1577
1577
|
Shared Drive
|
|
1578
1578
|
"""
|
|
@@ -1606,7 +1606,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
1606
1606
|
except ValueError:
|
|
1607
1607
|
return None
|
|
1608
1608
|
|
|
1609
|
-
def
|
|
1609
|
+
def delete_shared_drive(
|
|
1610
1610
|
self,
|
|
1611
1611
|
driveId: str,
|
|
1612
1612
|
allowItemDeletion: str | None = None,
|
|
@@ -1620,8 +1620,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1620
1620
|
userIp: str | None = None,
|
|
1621
1621
|
) -> Any:
|
|
1622
1622
|
"""
|
|
1623
|
-
Permanently
|
|
1624
|
-
|
|
1623
|
+
Permanently deletes a shared drive using its unique ID. This action is irreversible. An option is available for domain administrators to simultaneously delete all items contained within the specified drive, making it distinct from file deletion functions like `delete_file`.
|
|
1624
|
+
|
|
1625
1625
|
Args:
|
|
1626
1626
|
driveId (string): driveId
|
|
1627
1627
|
allowItemDeletion (string): Whether any items inside the shared drive should also be deleted. This option is only supported when useDomainAdminAccess is also set to true. Example: '<boolean>'.
|
|
@@ -1633,14 +1633,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1633
1633
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
1634
1634
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
1635
1635
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
1636
|
-
|
|
1636
|
+
|
|
1637
1637
|
Returns:
|
|
1638
1638
|
Any: Successful response
|
|
1639
|
-
|
|
1639
|
+
|
|
1640
1640
|
Raises:
|
|
1641
1641
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1642
1642
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1643
|
-
|
|
1643
|
+
|
|
1644
1644
|
Tags:
|
|
1645
1645
|
Shared Drive
|
|
1646
1646
|
"""
|
|
@@ -1675,7 +1675,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
1675
1675
|
except ValueError:
|
|
1676
1676
|
return None
|
|
1677
1677
|
|
|
1678
|
-
def
|
|
1678
|
+
def update_shared_drive(
|
|
1679
1679
|
self,
|
|
1680
1680
|
driveId: str,
|
|
1681
1681
|
useDomainAdminAccess: str | None = None,
|
|
@@ -1700,8 +1700,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1700
1700
|
themeId: str | None = None,
|
|
1701
1701
|
) -> dict[str, Any]:
|
|
1702
1702
|
"""
|
|
1703
|
-
|
|
1704
|
-
|
|
1703
|
+
Updates metadata properties for a specific shared drive using its ID. Modifiable attributes include name, theme, background, and color. This function sends a PATCH request to the Google Drive API and returns a dictionary containing the updated shared drive's full metadata.
|
|
1704
|
+
|
|
1705
1705
|
Args:
|
|
1706
1706
|
driveId (string): driveId
|
|
1707
1707
|
useDomainAdminAccess (string): Issue the request as a domain administrator. If set to true, then the requester is granted access if they're an administrator of the domain to which the shared drive belongs. Example: '<boolean>'.
|
|
@@ -1724,14 +1724,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1724
1724
|
orgUnitId (string): orgUnitId Example: '<string>'.
|
|
1725
1725
|
restrictions (object): restrictions Example: {'adminManagedRestrictions': '<boolean>', 'copyRequiresWriterPermission': '<boolean>', 'domainUsersOnly': '<boolean>', 'driveMembersOnly': '<boolean>', 'sharingFoldersRequiresOrganizerPermission': '<boolean>'}.
|
|
1726
1726
|
themeId (string): themeId Example: '<string>'.
|
|
1727
|
-
|
|
1727
|
+
|
|
1728
1728
|
Returns:
|
|
1729
1729
|
dict[str, Any]: Successful response
|
|
1730
|
-
|
|
1730
|
+
|
|
1731
1731
|
Raises:
|
|
1732
1732
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1733
1733
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1734
|
-
|
|
1734
|
+
|
|
1735
1735
|
Tags:
|
|
1736
1736
|
Shared Drive
|
|
1737
1737
|
"""
|
|
@@ -1783,7 +1783,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
1783
1783
|
except ValueError:
|
|
1784
1784
|
return None
|
|
1785
1785
|
|
|
1786
|
-
def
|
|
1786
|
+
def hide_drive(
|
|
1787
1787
|
self,
|
|
1788
1788
|
driveId: str,
|
|
1789
1789
|
alt: str | None = None,
|
|
@@ -1795,8 +1795,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1795
1795
|
userIp: str | None = None,
|
|
1796
1796
|
) -> dict[str, Any]:
|
|
1797
1797
|
"""
|
|
1798
|
-
|
|
1799
|
-
|
|
1798
|
+
Hides a specified shared drive from the user's default view using its ID. This function sends a POST request to the API's hide endpoint, returning updated drive metadata. It is the direct counterpart to the `unhide_drive` function, which restores visibility.
|
|
1799
|
+
|
|
1800
1800
|
Args:
|
|
1801
1801
|
driveId (string): driveId
|
|
1802
1802
|
alt (string): Data format for the response. Example: 'json'.
|
|
@@ -1806,14 +1806,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1806
1806
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
1807
1807
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
1808
1808
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
1809
|
-
|
|
1809
|
+
|
|
1810
1810
|
Returns:
|
|
1811
1811
|
dict[str, Any]: Successful response
|
|
1812
|
-
|
|
1812
|
+
|
|
1813
1813
|
Raises:
|
|
1814
1814
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1815
1815
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1816
|
-
|
|
1816
|
+
|
|
1817
1817
|
Tags:
|
|
1818
1818
|
Shared Drive
|
|
1819
1819
|
"""
|
|
@@ -1864,8 +1864,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1864
1864
|
userIp: str | None = None,
|
|
1865
1865
|
) -> dict[str, Any]:
|
|
1866
1866
|
"""
|
|
1867
|
-
|
|
1868
|
-
|
|
1867
|
+
Makes a hidden shared drive visible again in the user's default view by its ID. This function sends a POST request to the Google Drive API's `/unhide` endpoint, effectively reversing the action of the `hide_drive_by_id_post` function.
|
|
1868
|
+
|
|
1869
1869
|
Args:
|
|
1870
1870
|
driveId (string): driveId
|
|
1871
1871
|
alt (string): Data format for the response. Example: 'json'.
|
|
@@ -1875,14 +1875,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1875
1875
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
1876
1876
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
1877
1877
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
1878
|
-
|
|
1878
|
+
|
|
1879
1879
|
Returns:
|
|
1880
1880
|
dict[str, Any]: Successful response
|
|
1881
|
-
|
|
1881
|
+
|
|
1882
1882
|
Raises:
|
|
1883
1883
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1884
1884
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1885
|
-
|
|
1885
|
+
|
|
1886
1886
|
Tags:
|
|
1887
1887
|
Shared Drive
|
|
1888
1888
|
"""
|
|
@@ -1921,7 +1921,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
1921
1921
|
except ValueError:
|
|
1922
1922
|
return None
|
|
1923
1923
|
|
|
1924
|
-
def
|
|
1924
|
+
def search_files_advanced(
|
|
1925
1925
|
self,
|
|
1926
1926
|
corpora: str | None = None,
|
|
1927
1927
|
driveId: str | None = None,
|
|
@@ -1946,8 +1946,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
1946
1946
|
userIp: str | None = None,
|
|
1947
1947
|
) -> dict[str, Any]:
|
|
1948
1948
|
"""
|
|
1949
|
-
|
|
1950
|
-
|
|
1949
|
+
Exhaustively lists or searches for files, exposing numerous API parameters for advanced filtering, sorting, and pagination. This low-level function offers more granular control than the simplified `list_files` method by directly mapping to the Google Drive API's full capabilities for file retrieval.
|
|
1950
|
+
|
|
1951
1951
|
Args:
|
|
1952
1952
|
corpora (string): Groupings of files to which the query applies. Supported groupings are: 'user' (files created by, opened by, or shared directly with the user), 'drive' (files in the specified shared drive as indicated by the 'driveId'), 'domain' (files shared to the user's domain), and 'allDrives' (A combination of 'user' and 'drive' for all drives where the user is a member). When able, use 'user' or 'drive', instead of 'allDrives', for efficiency. Example: '<string>'.
|
|
1953
1953
|
driveId (string): ID of the shared drive to search. Example: '{{driveId}}'.
|
|
@@ -1970,14 +1970,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
1970
1970
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
1971
1971
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
1972
1972
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
1973
|
-
|
|
1973
|
+
|
|
1974
1974
|
Returns:
|
|
1975
1975
|
dict[str, Any]: Successful response
|
|
1976
|
-
|
|
1976
|
+
|
|
1977
1977
|
Raises:
|
|
1978
1978
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
1979
1979
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
1980
|
-
|
|
1980
|
+
|
|
1981
1981
|
Tags:
|
|
1982
1982
|
Files
|
|
1983
1983
|
"""
|
|
@@ -2022,7 +2022,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
2022
2022
|
except ValueError:
|
|
2023
2023
|
return None
|
|
2024
2024
|
|
|
2025
|
-
def
|
|
2025
|
+
def create_file_metadata(
|
|
2026
2026
|
self,
|
|
2027
2027
|
enforceSingleParent: str | None = None,
|
|
2028
2028
|
ignoreDefaultVisibility: str | None = None,
|
|
@@ -2104,8 +2104,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
2104
2104
|
writersCanShare: str | None = None,
|
|
2105
2105
|
) -> dict[str, Any]:
|
|
2106
2106
|
"""
|
|
2107
|
-
|
|
2108
|
-
|
|
2107
|
+
Creates a new file's metadata resource in Google Drive, allowing for detailed configuration of properties like name, MIME type, and parent folders. Unlike `upload_a_file` or `create_file_from_text`, this function only creates the metadata entry without uploading any actual file content.
|
|
2108
|
+
|
|
2109
2109
|
Args:
|
|
2110
2110
|
enforceSingleParent (string): Deprecated. Creating files in multiple folders is no longer supported. Example: '<boolean>'.
|
|
2111
2111
|
ignoreDefaultVisibility (string): Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. Example: '<boolean>'.
|
|
@@ -2185,14 +2185,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
2185
2185
|
webContentLink (string): webContentLink Example: '<string>'.
|
|
2186
2186
|
webViewLink (string): webViewLink Example: '<string>'.
|
|
2187
2187
|
writersCanShare (string): writersCanShare Example: '<boolean>'.
|
|
2188
|
-
|
|
2188
|
+
|
|
2189
2189
|
Returns:
|
|
2190
2190
|
dict[str, Any]: Successful response
|
|
2191
|
-
|
|
2191
|
+
|
|
2192
2192
|
Raises:
|
|
2193
2193
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
2194
2194
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
2195
|
-
|
|
2195
|
+
|
|
2196
2196
|
Tags:
|
|
2197
2197
|
Files
|
|
2198
2198
|
"""
|
|
@@ -2305,7 +2305,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
2305
2305
|
except ValueError:
|
|
2306
2306
|
return None
|
|
2307
2307
|
|
|
2308
|
-
def
|
|
2308
|
+
def generate_file_ids(
|
|
2309
2309
|
self,
|
|
2310
2310
|
count: str | None = None,
|
|
2311
2311
|
space: str | None = None,
|
|
@@ -2319,8 +2319,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
2319
2319
|
userIp: str | None = None,
|
|
2320
2320
|
) -> dict[str, Any]:
|
|
2321
2321
|
"""
|
|
2322
|
-
|
|
2323
|
-
|
|
2322
|
+
Pre-generates a specified number of unique IDs for future files or shortcuts from the Google Drive API. Allows specifying the quantity, storage space ('drive' or 'appDataFolder'), and item type, optimizing creation workflows by providing identifiers in advance.
|
|
2323
|
+
|
|
2324
2324
|
Args:
|
|
2325
2325
|
count (string): The number of IDs to return. Example: '<integer>'.
|
|
2326
2326
|
space (string): The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. (Default: 'drive') Example: '<string>'.
|
|
@@ -2332,14 +2332,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
2332
2332
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
2333
2333
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
2334
2334
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
2335
|
-
|
|
2335
|
+
|
|
2336
2336
|
Returns:
|
|
2337
2337
|
dict[str, Any]: Successful response
|
|
2338
|
-
|
|
2338
|
+
|
|
2339
2339
|
Raises:
|
|
2340
2340
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
2341
2341
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
2342
|
-
|
|
2342
|
+
|
|
2343
2343
|
Tags:
|
|
2344
2344
|
Files
|
|
2345
2345
|
"""
|
|
@@ -2373,7 +2373,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
2373
2373
|
except ValueError:
|
|
2374
2374
|
return None
|
|
2375
2375
|
|
|
2376
|
-
def
|
|
2376
|
+
def empty_trash(
|
|
2377
2377
|
self,
|
|
2378
2378
|
driveId: str | None = None,
|
|
2379
2379
|
enforceSingleParent: str | None = None,
|
|
@@ -2386,8 +2386,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
2386
2386
|
userIp: str | None = None,
|
|
2387
2387
|
) -> Any:
|
|
2388
2388
|
"""
|
|
2389
|
-
Permanently
|
|
2390
|
-
|
|
2389
|
+
Permanently deletes all files and folders from the trash. It can target the user's main trash or a specific shared drive's trash if a `driveId` is provided. This action is irreversible, differing from `delete_file` which only moves items to the trash.
|
|
2390
|
+
|
|
2391
2391
|
Args:
|
|
2392
2392
|
driveId (string): If set, empties the trash of the provided shared drive. Example: '{{driveId}}'.
|
|
2393
2393
|
enforceSingleParent (string): Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root. Example: '<boolean>'.
|
|
@@ -2398,14 +2398,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
2398
2398
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
2399
2399
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
2400
2400
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
2401
|
-
|
|
2401
|
+
|
|
2402
2402
|
Returns:
|
|
2403
2403
|
Any: Successful response
|
|
2404
|
-
|
|
2404
|
+
|
|
2405
2405
|
Raises:
|
|
2406
2406
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
2407
2407
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
2408
|
-
|
|
2408
|
+
|
|
2409
2409
|
Tags:
|
|
2410
2410
|
Files
|
|
2411
2411
|
"""
|
|
@@ -2438,85 +2438,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
2438
2438
|
except ValueError:
|
|
2439
2439
|
return None
|
|
2440
2440
|
|
|
2441
|
-
def
|
|
2442
|
-
self,
|
|
2443
|
-
fileId: str,
|
|
2444
|
-
acknowledgeAbuse: str | None = None,
|
|
2445
|
-
includeLabels: str | None = None,
|
|
2446
|
-
includePermissionsForView: str | None = None,
|
|
2447
|
-
supportsAllDrives: str | None = None,
|
|
2448
|
-
supportsTeamDrives: str | None = None,
|
|
2449
|
-
alt: str | None = None,
|
|
2450
|
-
fields: str | None = None,
|
|
2451
|
-
key: str | None = None,
|
|
2452
|
-
oauth_token: str | None = None,
|
|
2453
|
-
prettyPrint: str | None = None,
|
|
2454
|
-
quotaUser: str | None = None,
|
|
2455
|
-
userIp: str | None = None,
|
|
2456
|
-
) -> dict[str, Any]:
|
|
2457
|
-
"""
|
|
2458
|
-
Get a file's metadata. Use to it to get infromation like parents
|
|
2459
|
-
|
|
2460
|
-
Args:
|
|
2461
|
-
fileId (string): fileId
|
|
2462
|
-
acknowledgeAbuse (string): Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. Example: '<boolean>'.
|
|
2463
|
-
includeLabels (string): A comma-separated list of IDs of labels to include in the labelInfo part of the response. Example: '<string>'.
|
|
2464
|
-
includePermissionsForView (string): Specifies which additional view's permissions to include in the response. Only 'published' is supported. Example: '<string>'.
|
|
2465
|
-
supportsAllDrives (string): Whether the requesting application supports both My Drives and shared drives. Example: '<boolean>'.
|
|
2466
|
-
supportsTeamDrives (string): Deprecated use supportsAllDrives instead. Example: '<boolean>'.
|
|
2467
|
-
alt (string): Data format for the response. Example: 'json'.
|
|
2468
|
-
fields (string): Selector specifying which fields to include in a partial response. Example: "id","name","parents"
|
|
2469
|
-
key (string): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. Example: '{{key}}'.
|
|
2470
|
-
oauth_token (string): OAuth 2.0 token for the current user. Example: '{{oauthToken}}'.
|
|
2471
|
-
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
2472
|
-
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
2473
|
-
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
2474
|
-
|
|
2475
|
-
Returns:
|
|
2476
|
-
dict[str, Any]: Successful response
|
|
2477
|
-
|
|
2478
|
-
Raises:
|
|
2479
|
-
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
2480
|
-
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
2481
|
-
|
|
2482
|
-
Tags:
|
|
2483
|
-
Files
|
|
2484
|
-
"""
|
|
2485
|
-
if fileId is None:
|
|
2486
|
-
raise ValueError("Missing required parameter 'fileId'.")
|
|
2487
|
-
url = f"{self.base_url}/files/{fileId}"
|
|
2488
|
-
query_params = {
|
|
2489
|
-
k: v
|
|
2490
|
-
for k, v in [
|
|
2491
|
-
("acknowledgeAbuse", acknowledgeAbuse),
|
|
2492
|
-
("includeLabels", includeLabels),
|
|
2493
|
-
("includePermissionsForView", includePermissionsForView),
|
|
2494
|
-
("supportsAllDrives", supportsAllDrives),
|
|
2495
|
-
("supportsTeamDrives", supportsTeamDrives),
|
|
2496
|
-
("alt", alt),
|
|
2497
|
-
("fields", fields),
|
|
2498
|
-
("key", key),
|
|
2499
|
-
("oauth_token", oauth_token),
|
|
2500
|
-
("prettyPrint", prettyPrint),
|
|
2501
|
-
("quotaUser", quotaUser),
|
|
2502
|
-
("userIp", userIp),
|
|
2503
|
-
]
|
|
2504
|
-
if v is not None
|
|
2505
|
-
}
|
|
2506
|
-
response = self._get(url, params=query_params)
|
|
2507
|
-
response.raise_for_status()
|
|
2508
|
-
if (
|
|
2509
|
-
response.status_code == 204
|
|
2510
|
-
or not response.content
|
|
2511
|
-
or not response.text.strip()
|
|
2512
|
-
):
|
|
2513
|
-
return None
|
|
2514
|
-
try:
|
|
2515
|
-
return response.json()
|
|
2516
|
-
except ValueError:
|
|
2517
|
-
return None
|
|
2518
|
-
|
|
2519
|
-
def delete_file_by_id(
|
|
2441
|
+
def permanently_delete_file(
|
|
2520
2442
|
self,
|
|
2521
2443
|
fileId: str,
|
|
2522
2444
|
enforceSingleParent: str | None = None,
|
|
@@ -2531,8 +2453,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
2531
2453
|
userIp: str | None = None,
|
|
2532
2454
|
) -> Any:
|
|
2533
2455
|
"""
|
|
2534
|
-
Permanently
|
|
2535
|
-
|
|
2456
|
+
Permanently deletes a specific file by its ID, bypassing the trash. Unlike the simpler `delete_file` wrapper, this function exposes numerous optional API parameters for advanced control over the deletion process, such as handling files in shared drives.
|
|
2457
|
+
|
|
2536
2458
|
Args:
|
|
2537
2459
|
fileId (string): fileId
|
|
2538
2460
|
enforceSingleParent (string): Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root. Example: '<boolean>'.
|
|
@@ -2545,14 +2467,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
2545
2467
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
2546
2468
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
2547
2469
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
2548
|
-
|
|
2470
|
+
|
|
2549
2471
|
Returns:
|
|
2550
2472
|
Any: Successful response
|
|
2551
|
-
|
|
2473
|
+
|
|
2552
2474
|
Raises:
|
|
2553
2475
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
2554
2476
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
2555
|
-
|
|
2477
|
+
|
|
2556
2478
|
Tags:
|
|
2557
2479
|
Files
|
|
2558
2480
|
"""
|
|
@@ -2588,7 +2510,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
2588
2510
|
except ValueError:
|
|
2589
2511
|
return None
|
|
2590
2512
|
|
|
2591
|
-
def
|
|
2513
|
+
def update_file_metadata(
|
|
2592
2514
|
self,
|
|
2593
2515
|
fileId: str,
|
|
2594
2516
|
addParents: str | None = None,
|
|
@@ -2672,8 +2594,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
2672
2594
|
writersCanShare: str | None = None,
|
|
2673
2595
|
) -> dict[str, Any]:
|
|
2674
2596
|
"""
|
|
2675
|
-
|
|
2676
|
-
|
|
2597
|
+
Modifies a file's metadata properties, such as name, description, or trashed status, using its unique ID. It supports a wide range of updatable fields and can also move files between folders by changing parent attributes, acting as a comprehensive alternative to the `move_files` function.
|
|
2598
|
+
|
|
2677
2599
|
Args:
|
|
2678
2600
|
fileId (string): fileId
|
|
2679
2601
|
addParents (string): A comma-separated list of parent IDs to add. Example: '<string>'.
|
|
@@ -2755,14 +2677,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
2755
2677
|
webContentLink (string): webContentLink Example: '<string>'.
|
|
2756
2678
|
webViewLink (string): webViewLink Example: '<string>'.
|
|
2757
2679
|
writersCanShare (string): writersCanShare Example: '<boolean>'.
|
|
2758
|
-
|
|
2680
|
+
|
|
2759
2681
|
Returns:
|
|
2760
2682
|
dict[str, Any]: Successful response
|
|
2761
|
-
|
|
2683
|
+
|
|
2762
2684
|
Raises:
|
|
2763
2685
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
2764
2686
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
2765
|
-
|
|
2687
|
+
|
|
2766
2688
|
Tags:
|
|
2767
2689
|
Files
|
|
2768
2690
|
"""
|
|
@@ -2873,7 +2795,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
2873
2795
|
except ValueError:
|
|
2874
2796
|
return None
|
|
2875
2797
|
|
|
2876
|
-
def
|
|
2798
|
+
def copy_file(
|
|
2877
2799
|
self,
|
|
2878
2800
|
fileId: str,
|
|
2879
2801
|
enforceSingleParent: str | None = None,
|
|
@@ -2955,8 +2877,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
2955
2877
|
writersCanShare: str | None = None,
|
|
2956
2878
|
) -> dict[str, Any]:
|
|
2957
2879
|
"""
|
|
2958
|
-
|
|
2959
|
-
|
|
2880
|
+
Creates a copy of a file using its ID. This function can simultaneously apply metadata updates, such as a new name or parent folder, to the duplicate upon creation and returns the new file's metadata.
|
|
2881
|
+
|
|
2960
2882
|
Args:
|
|
2961
2883
|
fileId (string): fileId
|
|
2962
2884
|
enforceSingleParent (string): Deprecated. Copying files into multiple folders is no longer supported. Use shortcuts instead. Example: '<boolean>'.
|
|
@@ -3036,14 +2958,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
3036
2958
|
webContentLink (string): webContentLink Example: '<string>'.
|
|
3037
2959
|
webViewLink (string): webViewLink Example: '<string>'.
|
|
3038
2960
|
writersCanShare (string): writersCanShare Example: '<boolean>'.
|
|
3039
|
-
|
|
2961
|
+
|
|
3040
2962
|
Returns:
|
|
3041
2963
|
dict[str, Any]: Successful response
|
|
3042
|
-
|
|
2964
|
+
|
|
3043
2965
|
Raises:
|
|
3044
2966
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
3045
2967
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
3046
|
-
|
|
2968
|
+
|
|
3047
2969
|
Tags:
|
|
3048
2970
|
Files
|
|
3049
2971
|
"""
|
|
@@ -3157,7 +3079,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
3157
3079
|
except ValueError:
|
|
3158
3080
|
return None
|
|
3159
3081
|
|
|
3160
|
-
def
|
|
3082
|
+
def export_file(
|
|
3161
3083
|
self,
|
|
3162
3084
|
fileId: str,
|
|
3163
3085
|
mimeType: str | None = None,
|
|
@@ -3170,8 +3092,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
3170
3092
|
userIp: str | None = None,
|
|
3171
3093
|
) -> Any:
|
|
3172
3094
|
"""
|
|
3173
|
-
|
|
3174
|
-
|
|
3095
|
+
Exports a Google Workspace document (e.g., Google Doc) by its ID, converting it into a specified format like PDF or XLSX. The target format is determined by the `mimeType` argument. The function returns the raw content of the exported file, not JSON metadata.
|
|
3096
|
+
|
|
3175
3097
|
Args:
|
|
3176
3098
|
fileId (string): fileId
|
|
3177
3099
|
mimeType (string): (Required) The MIME type of the format requested for this export. Example: 'mimeType'.
|
|
@@ -3182,14 +3104,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
3182
3104
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
3183
3105
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
3184
3106
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
3185
|
-
|
|
3107
|
+
|
|
3186
3108
|
Returns:
|
|
3187
3109
|
Any: Successful response
|
|
3188
|
-
|
|
3110
|
+
|
|
3189
3111
|
Raises:
|
|
3190
3112
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
3191
3113
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
3192
|
-
|
|
3114
|
+
|
|
3193
3115
|
Tags:
|
|
3194
3116
|
Files
|
|
3195
3117
|
"""
|
|
@@ -3223,7 +3145,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
3223
3145
|
except ValueError:
|
|
3224
3146
|
return None
|
|
3225
3147
|
|
|
3226
|
-
def
|
|
3148
|
+
def list_file_labels(
|
|
3227
3149
|
self,
|
|
3228
3150
|
fileId: str,
|
|
3229
3151
|
maxResults: str | None = None,
|
|
@@ -3237,8 +3159,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
3237
3159
|
userIp: str | None = None,
|
|
3238
3160
|
) -> dict[str, Any]:
|
|
3239
3161
|
"""
|
|
3240
|
-
|
|
3241
|
-
|
|
3162
|
+
Retrieves a paginated list of all labels applied to a specific file in Google Drive, identified by its unique ID. It allows controlling the number of results per page and navigating through pages of labels.
|
|
3163
|
+
|
|
3242
3164
|
Args:
|
|
3243
3165
|
fileId (string): fileId
|
|
3244
3166
|
maxResults (string): The maximum number of labels to return per page. When not set, this defaults to 100. Example: '<integer>'.
|
|
@@ -3250,14 +3172,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
3250
3172
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
3251
3173
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
3252
3174
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
3253
|
-
|
|
3175
|
+
|
|
3254
3176
|
Returns:
|
|
3255
3177
|
dict[str, Any]: Successful response
|
|
3256
|
-
|
|
3178
|
+
|
|
3257
3179
|
Raises:
|
|
3258
3180
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
3259
3181
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
3260
|
-
|
|
3182
|
+
|
|
3261
3183
|
Tags:
|
|
3262
3184
|
Files
|
|
3263
3185
|
"""
|
|
@@ -3292,7 +3214,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
3292
3214
|
except ValueError:
|
|
3293
3215
|
return None
|
|
3294
3216
|
|
|
3295
|
-
def
|
|
3217
|
+
def modify_file_labels(
|
|
3296
3218
|
self,
|
|
3297
3219
|
fileId: str,
|
|
3298
3220
|
alt: str | None = None,
|
|
@@ -3306,8 +3228,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
3306
3228
|
labelModifications: list[dict[str, Any]] | None = None,
|
|
3307
3229
|
) -> dict[str, Any]:
|
|
3308
3230
|
"""
|
|
3309
|
-
|
|
3310
|
-
|
|
3231
|
+
Atomically modifies the set of labels on a specified file in Google Drive. It can add, update, or remove labels based on the provided list of modifications, returning the updated label metadata for the file.
|
|
3232
|
+
|
|
3311
3233
|
Args:
|
|
3312
3234
|
fileId (string): fileId
|
|
3313
3235
|
alt (string): Data format for the response. Example: 'json'.
|
|
@@ -3319,14 +3241,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
3319
3241
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
3320
3242
|
kind (string): kind Example: 'drive#modifyLabelsRequest'.
|
|
3321
3243
|
labelModifications (array): labelModifications Example: "[{'fieldModifications': [{'fieldId': '<string>', 'kind': 'drive#labelFieldModification', 'setDateValues': ['<date>', '<date>'], 'setIntegerValues': ['<int64>', '<int64>'], 'setSelectionValues': ['<string>', '<string>'], 'setTextValues': ['<string>', '<string>'], 'setUserValues': ['<string>', '<string>'], 'unsetValues': '<boolean>'}, {'fieldId': '<string>', 'kind': 'drive#labelFieldModification', 'setDateValues': ['<date>', '<date>'], 'setIntegerValues': ['<int64>', '<int64>'], 'setSelectionValues': ['<string>', '<string>'], 'setTextValues': ['<string>', '<string>'], 'setUserValues': ['<string>', '<string>'], 'unsetValues': '<boolean>'}], 'kind': 'drive#labelModification', 'labelId': '<string>', 'removeLabel': '<boolean>'}, {'fieldModifications': [{'fieldId': '<string>', 'kind': 'drive#labelFieldModification', 'setDateValues': ['<date>', '<date>'], 'setIntegerValues': ['<int64>', '<int64>'], 'setSelectionValues': ['<string>', '<string>'], 'setTextValues': ['<string>', '<string>'], 'setUserValues': ['<string>', '<string>'], 'unsetValues': '<boolean>'}, {'fieldId': '<string>', 'kind': 'drive#labelFieldModification', 'setDateValues': ['<date>', '<date>'], 'setIntegerValues': ['<int64>', '<int64>'], 'setSelectionValues': ['<string>', '<string>'], 'setTextValues': ['<string>', '<string>'], 'setUserValues': ['<string>', '<string>'], 'unsetValues': '<boolean>'}], 'kind': 'drive#labelModification', 'labelId': '<string>', 'removeLabel': '<boolean>'}]".
|
|
3322
|
-
|
|
3244
|
+
|
|
3323
3245
|
Returns:
|
|
3324
3246
|
dict[str, Any]: Successful response
|
|
3325
|
-
|
|
3247
|
+
|
|
3326
3248
|
Raises:
|
|
3327
3249
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
3328
3250
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
3329
|
-
|
|
3251
|
+
|
|
3330
3252
|
Tags:
|
|
3331
3253
|
Files
|
|
3332
3254
|
"""
|
|
@@ -3372,7 +3294,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
3372
3294
|
except ValueError:
|
|
3373
3295
|
return None
|
|
3374
3296
|
|
|
3375
|
-
def
|
|
3297
|
+
def watch_file_for_changes(
|
|
3376
3298
|
self,
|
|
3377
3299
|
fileId: str,
|
|
3378
3300
|
acknowledgeAbuse: str | None = None,
|
|
@@ -3399,8 +3321,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
3399
3321
|
type: str | None = None,
|
|
3400
3322
|
) -> dict[str, Any]:
|
|
3401
3323
|
"""
|
|
3402
|
-
|
|
3403
|
-
|
|
3324
|
+
Establishes a push notification channel to monitor a specific file in Google Drive. This function configures a webhook by sending a POST request to the file's 'watch' endpoint, enabling real-time notifications for any changes, such as content or metadata updates, to the specified file.
|
|
3325
|
+
|
|
3404
3326
|
Args:
|
|
3405
3327
|
fileId (string): fileId
|
|
3406
3328
|
acknowledgeAbuse (string): Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. Example: '<boolean>'.
|
|
@@ -3425,14 +3347,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
3425
3347
|
resourceUri (string): resourceUri Example: '<string>'.
|
|
3426
3348
|
token (string): token Example: '<string>'.
|
|
3427
3349
|
type (string): type Example: '<string>'.
|
|
3428
|
-
|
|
3350
|
+
|
|
3429
3351
|
Returns:
|
|
3430
3352
|
dict[str, Any]: Successful response
|
|
3431
|
-
|
|
3353
|
+
|
|
3432
3354
|
Raises:
|
|
3433
3355
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
3434
3356
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
3435
|
-
|
|
3357
|
+
|
|
3436
3358
|
Tags:
|
|
3437
3359
|
Files
|
|
3438
3360
|
"""
|
|
@@ -3509,8 +3431,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
3509
3431
|
userIp: str | None = None,
|
|
3510
3432
|
) -> dict[str, Any]:
|
|
3511
3433
|
"""
|
|
3512
|
-
|
|
3513
|
-
|
|
3434
|
+
Retrieves the list of permissions for a specified file or shared drive in Google Drive. This function supports pagination and various query parameters to customize the results for different access levels, such as domain administration.
|
|
3435
|
+
|
|
3514
3436
|
Args:
|
|
3515
3437
|
fileId (string): fileId
|
|
3516
3438
|
includePermissionsForView (string): Specifies which additional view's permissions to include in the response. Only 'published' is supported. Example: '<string>'.
|
|
@@ -3526,14 +3448,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
3526
3448
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
3527
3449
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
3528
3450
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
3529
|
-
|
|
3451
|
+
|
|
3530
3452
|
Returns:
|
|
3531
3453
|
dict[str, Any]: Successful response
|
|
3532
|
-
|
|
3454
|
+
|
|
3533
3455
|
Raises:
|
|
3534
3456
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
3535
3457
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
3536
|
-
|
|
3458
|
+
|
|
3537
3459
|
Tags:
|
|
3538
3460
|
Permissions
|
|
3539
3461
|
"""
|
|
@@ -3572,7 +3494,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
3572
3494
|
except ValueError:
|
|
3573
3495
|
return None
|
|
3574
3496
|
|
|
3575
|
-
def
|
|
3497
|
+
def create_file_permission(
|
|
3576
3498
|
self,
|
|
3577
3499
|
fileId: str,
|
|
3578
3500
|
emailMessage: str | None = None,
|
|
@@ -3607,8 +3529,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
3607
3529
|
view: str | None = None,
|
|
3608
3530
|
) -> dict[str, Any]:
|
|
3609
3531
|
"""
|
|
3610
|
-
|
|
3611
|
-
|
|
3532
|
+
Creates a new permission for a file or shared drive, assigning roles like 'reader' to a user, group, or domain. This comprehensive method supports options like notification emails and ownership transfer, distinguishing it from the simplified `grant_google_drive_access` function.
|
|
3533
|
+
|
|
3612
3534
|
Args:
|
|
3613
3535
|
fileId (string): fileId
|
|
3614
3536
|
emailMessage (string): A plain text custom message to include in the notification email. Example: '<string>'.
|
|
@@ -3641,14 +3563,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
3641
3563
|
teamDrivePermissionDetails (array): teamDrivePermissionDetails Example: "[{'inherited': '<boolean>', 'inheritedFrom': '<string>', 'role': '<string>', 'teamDrivePermissionType': '<string>'}, {'inherited': '<boolean>', 'inheritedFrom': '<string>', 'role': '<string>', 'teamDrivePermissionType': '<string>'}]".
|
|
3642
3564
|
type (string): type Example: '<string>'.
|
|
3643
3565
|
view (string): view Example: '<string>'.
|
|
3644
|
-
|
|
3566
|
+
|
|
3645
3567
|
Returns:
|
|
3646
3568
|
dict[str, Any]: Successful response
|
|
3647
|
-
|
|
3569
|
+
|
|
3648
3570
|
Raises:
|
|
3649
3571
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
3650
3572
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
3651
|
-
|
|
3573
|
+
|
|
3652
3574
|
Tags:
|
|
3653
3575
|
Permissions
|
|
3654
3576
|
"""
|
|
@@ -3731,8 +3653,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
3731
3653
|
userIp: str | None = None,
|
|
3732
3654
|
) -> dict[str, Any]:
|
|
3733
3655
|
"""
|
|
3734
|
-
|
|
3735
|
-
|
|
3656
|
+
Retrieves the metadata for a specific permission on a file or shared drive, identified by its unique permission ID. This provides targeted access information, unlike `list_file_permissions`, which fetches all permissions for a file or drive.
|
|
3657
|
+
|
|
3736
3658
|
Args:
|
|
3737
3659
|
fileId (string): fileId
|
|
3738
3660
|
permissionId (string): permissionId
|
|
@@ -3746,14 +3668,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
3746
3668
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
3747
3669
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
3748
3670
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
3749
|
-
|
|
3671
|
+
|
|
3750
3672
|
Returns:
|
|
3751
3673
|
dict[str, Any]: Successful response
|
|
3752
|
-
|
|
3674
|
+
|
|
3753
3675
|
Raises:
|
|
3754
3676
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
3755
3677
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
3756
|
-
|
|
3678
|
+
|
|
3757
3679
|
Tags:
|
|
3758
3680
|
Permissions
|
|
3759
3681
|
"""
|
|
@@ -3791,7 +3713,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
3791
3713
|
except ValueError:
|
|
3792
3714
|
return None
|
|
3793
3715
|
|
|
3794
|
-
def
|
|
3716
|
+
def delete_permission(
|
|
3795
3717
|
self,
|
|
3796
3718
|
fileId: str,
|
|
3797
3719
|
permissionId: str,
|
|
@@ -3807,8 +3729,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
3807
3729
|
userIp: str | None = None,
|
|
3808
3730
|
) -> Any:
|
|
3809
3731
|
"""
|
|
3810
|
-
|
|
3811
|
-
|
|
3732
|
+
Deletes a specific permission from a Google Drive file or shared drive, identified by their respective IDs. This action permanently revokes the access associated with that permission, with optional parameters for shared drives and domain administrator access.
|
|
3733
|
+
|
|
3812
3734
|
Args:
|
|
3813
3735
|
fileId (string): fileId
|
|
3814
3736
|
permissionId (string): permissionId
|
|
@@ -3822,14 +3744,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
3822
3744
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
3823
3745
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
3824
3746
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
3825
|
-
|
|
3747
|
+
|
|
3826
3748
|
Returns:
|
|
3827
3749
|
Any: Successful response
|
|
3828
|
-
|
|
3750
|
+
|
|
3829
3751
|
Raises:
|
|
3830
3752
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
3831
3753
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
3832
|
-
|
|
3754
|
+
|
|
3833
3755
|
Tags:
|
|
3834
3756
|
Permissions
|
|
3835
3757
|
"""
|
|
@@ -3867,7 +3789,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
3867
3789
|
except ValueError:
|
|
3868
3790
|
return None
|
|
3869
3791
|
|
|
3870
|
-
def
|
|
3792
|
+
def update_permission(
|
|
3871
3793
|
self,
|
|
3872
3794
|
fileId: str,
|
|
3873
3795
|
permissionId: str,
|
|
@@ -3900,8 +3822,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
3900
3822
|
view: str | None = None,
|
|
3901
3823
|
) -> dict[str, Any]:
|
|
3902
3824
|
"""
|
|
3903
|
-
|
|
3904
|
-
|
|
3825
|
+
Updates an existing permission for a file or shared drive using its permission ID. This function can modify a user's role (e.g., from reader to writer), transfer ownership, or change expiration settings, returning the updated permission object upon success.
|
|
3826
|
+
|
|
3905
3827
|
Args:
|
|
3906
3828
|
fileId (string): fileId
|
|
3907
3829
|
permissionId (string): permissionId
|
|
@@ -3932,14 +3854,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
3932
3854
|
teamDrivePermissionDetails (array): teamDrivePermissionDetails Example: "[{'inherited': '<boolean>', 'inheritedFrom': '<string>', 'role': '<string>', 'teamDrivePermissionType': '<string>'}, {'inherited': '<boolean>', 'inheritedFrom': '<string>', 'role': '<string>', 'teamDrivePermissionType': '<string>'}]".
|
|
3933
3855
|
type (string): type Example: '<string>'.
|
|
3934
3856
|
view (string): view Example: '<string>'.
|
|
3935
|
-
|
|
3857
|
+
|
|
3936
3858
|
Returns:
|
|
3937
3859
|
dict[str, Any]: Successful response
|
|
3938
|
-
|
|
3860
|
+
|
|
3939
3861
|
Raises:
|
|
3940
3862
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
3941
3863
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
3942
|
-
|
|
3864
|
+
|
|
3943
3865
|
Tags:
|
|
3944
3866
|
Permissions
|
|
3945
3867
|
"""
|
|
@@ -4000,7 +3922,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
4000
3922
|
except ValueError:
|
|
4001
3923
|
return None
|
|
4002
3924
|
|
|
4003
|
-
def
|
|
3925
|
+
def list_comment_replies(
|
|
4004
3926
|
self,
|
|
4005
3927
|
fileId: str,
|
|
4006
3928
|
commentId: str,
|
|
@@ -4016,8 +3938,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
4016
3938
|
userIp: str | None = None,
|
|
4017
3939
|
) -> dict[str, Any]:
|
|
4018
3940
|
"""
|
|
4019
|
-
|
|
4020
|
-
|
|
3941
|
+
Retrieves a paginated list of replies for a specific comment on a Google Drive file, requiring both file and comment IDs. It can optionally include deleted replies. This function targets replies to a single comment, distinguishing it from functions listing all top-level comments on a file.
|
|
3942
|
+
|
|
4021
3943
|
Args:
|
|
4022
3944
|
fileId (string): fileId
|
|
4023
3945
|
commentId (string): commentId
|
|
@@ -4031,14 +3953,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
4031
3953
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
4032
3954
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
4033
3955
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
4034
|
-
|
|
3956
|
+
|
|
4035
3957
|
Returns:
|
|
4036
3958
|
dict[str, Any]: Successful response
|
|
4037
|
-
|
|
3959
|
+
|
|
4038
3960
|
Raises:
|
|
4039
3961
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
4040
3962
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
4041
|
-
|
|
3963
|
+
|
|
4042
3964
|
Tags:
|
|
4043
3965
|
Replies
|
|
4044
3966
|
"""
|
|
@@ -4076,7 +3998,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
4076
3998
|
except ValueError:
|
|
4077
3999
|
return None
|
|
4078
4000
|
|
|
4079
|
-
def
|
|
4001
|
+
def create_comment_reply(
|
|
4080
4002
|
self,
|
|
4081
4003
|
fileId: str,
|
|
4082
4004
|
commentId: str,
|
|
@@ -4098,8 +4020,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
4098
4020
|
modifiedTime: str | None = None,
|
|
4099
4021
|
) -> dict[str, Any]:
|
|
4100
4022
|
"""
|
|
4101
|
-
|
|
4102
|
-
|
|
4023
|
+
Creates a reply to a specific comment on a Google Drive file. It requires the file ID and the parent comment ID, posting the new reply's content to the correct comment thread.
|
|
4024
|
+
|
|
4103
4025
|
Args:
|
|
4104
4026
|
fileId (string): fileId
|
|
4105
4027
|
commentId (string): commentId
|
|
@@ -4119,14 +4041,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
4119
4041
|
id (string): id Example: '<string>'.
|
|
4120
4042
|
kind (string): kind Example: 'drive#reply'.
|
|
4121
4043
|
modifiedTime (string): modifiedTime Example: '<dateTime>'.
|
|
4122
|
-
|
|
4044
|
+
|
|
4123
4045
|
Returns:
|
|
4124
4046
|
dict[str, Any]: Successful response
|
|
4125
|
-
|
|
4047
|
+
|
|
4126
4048
|
Raises:
|
|
4127
4049
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
4128
4050
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
4129
|
-
|
|
4051
|
+
|
|
4130
4052
|
Tags:
|
|
4131
4053
|
Replies
|
|
4132
4054
|
"""
|
|
@@ -4196,8 +4118,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
4196
4118
|
userIp: str | None = None,
|
|
4197
4119
|
) -> dict[str, Any]:
|
|
4198
4120
|
"""
|
|
4199
|
-
|
|
4200
|
-
|
|
4121
|
+
Retrieves a specific reply to a comment on a file, identified by the file, comment, and reply IDs. Unlike `list_acomment_sreplies`, this fetches a single reply's data. It can optionally include deleted replies in the response, returning a dictionary with the reply's metadata.
|
|
4122
|
+
|
|
4201
4123
|
Args:
|
|
4202
4124
|
fileId (string): fileId
|
|
4203
4125
|
commentId (string): commentId
|
|
@@ -4210,14 +4132,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
4210
4132
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
4211
4133
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
4212
4134
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
4213
|
-
|
|
4135
|
+
|
|
4214
4136
|
Returns:
|
|
4215
4137
|
dict[str, Any]: Successful response
|
|
4216
|
-
|
|
4138
|
+
|
|
4217
4139
|
Raises:
|
|
4218
4140
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
4219
4141
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
4220
|
-
|
|
4142
|
+
|
|
4221
4143
|
Tags:
|
|
4222
4144
|
Replies
|
|
4223
4145
|
"""
|
|
@@ -4255,7 +4177,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
4255
4177
|
except ValueError:
|
|
4256
4178
|
return None
|
|
4257
4179
|
|
|
4258
|
-
def
|
|
4180
|
+
def delete_reply(
|
|
4259
4181
|
self,
|
|
4260
4182
|
fileId: str,
|
|
4261
4183
|
commentId: str,
|
|
@@ -4269,8 +4191,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
4269
4191
|
userIp: str | None = None,
|
|
4270
4192
|
) -> Any:
|
|
4271
4193
|
"""
|
|
4272
|
-
|
|
4273
|
-
|
|
4194
|
+
Permanently deletes a specific reply associated with a comment on a Google Drive file. This operation requires the file ID, parent comment ID, and the specific reply ID to make a targeted DELETE request to the Google Drive API.
|
|
4195
|
+
|
|
4274
4196
|
Args:
|
|
4275
4197
|
fileId (string): fileId
|
|
4276
4198
|
commentId (string): commentId
|
|
@@ -4282,14 +4204,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
4282
4204
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
4283
4205
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
4284
4206
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
4285
|
-
|
|
4207
|
+
|
|
4286
4208
|
Returns:
|
|
4287
4209
|
Any: Successful response
|
|
4288
|
-
|
|
4210
|
+
|
|
4289
4211
|
Raises:
|
|
4290
4212
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
4291
4213
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
4292
|
-
|
|
4214
|
+
|
|
4293
4215
|
Tags:
|
|
4294
4216
|
Replies
|
|
4295
4217
|
"""
|
|
@@ -4326,7 +4248,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
4326
4248
|
except ValueError:
|
|
4327
4249
|
return None
|
|
4328
4250
|
|
|
4329
|
-
def
|
|
4251
|
+
def update_reply(
|
|
4330
4252
|
self,
|
|
4331
4253
|
fileId: str,
|
|
4332
4254
|
commentId: str,
|
|
@@ -4349,8 +4271,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
4349
4271
|
modifiedTime: str | None = None,
|
|
4350
4272
|
) -> dict[str, Any]:
|
|
4351
4273
|
"""
|
|
4352
|
-
|
|
4353
|
-
|
|
4274
|
+
Updates a specific reply to a comment on a file in Google Drive. It uses file, comment, and reply IDs to locate the reply, allowing modification of its properties like content. The function then returns the updated reply's metadata.
|
|
4275
|
+
|
|
4354
4276
|
Args:
|
|
4355
4277
|
fileId (string): fileId
|
|
4356
4278
|
commentId (string): commentId
|
|
@@ -4371,14 +4293,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
4371
4293
|
id (string): id Example: '<string>'.
|
|
4372
4294
|
kind (string): kind Example: 'drive#reply'.
|
|
4373
4295
|
modifiedTime (string): modifiedTime Example: '<dateTime>'.
|
|
4374
|
-
|
|
4296
|
+
|
|
4375
4297
|
Returns:
|
|
4376
4298
|
dict[str, Any]: Successful response
|
|
4377
|
-
|
|
4299
|
+
|
|
4378
4300
|
Raises:
|
|
4379
4301
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
4380
4302
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
4381
|
-
|
|
4303
|
+
|
|
4382
4304
|
Tags:
|
|
4383
4305
|
Replies
|
|
4384
4306
|
"""
|
|
@@ -4430,7 +4352,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
4430
4352
|
except ValueError:
|
|
4431
4353
|
return None
|
|
4432
4354
|
|
|
4433
|
-
def
|
|
4355
|
+
def list_file_revisions(
|
|
4434
4356
|
self,
|
|
4435
4357
|
fileId: str,
|
|
4436
4358
|
pageSize: str | None = None,
|
|
@@ -4444,8 +4366,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
4444
4366
|
userIp: str | None = None,
|
|
4445
4367
|
) -> dict[str, Any]:
|
|
4446
4368
|
"""
|
|
4447
|
-
|
|
4448
|
-
|
|
4369
|
+
Retrieves a paginated list of all historical versions (revisions) for a specific file in Google Drive. Supports page size and token parameters to navigate a file's change history, differentiating it from functions that get, update, or delete a single revision.
|
|
4370
|
+
|
|
4449
4371
|
Args:
|
|
4450
4372
|
fileId (string): fileId
|
|
4451
4373
|
pageSize (string): The maximum number of revisions to return per page. Example: '<integer>'.
|
|
@@ -4457,14 +4379,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
4457
4379
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
4458
4380
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
4459
4381
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
4460
|
-
|
|
4382
|
+
|
|
4461
4383
|
Returns:
|
|
4462
4384
|
dict[str, Any]: Successful response
|
|
4463
|
-
|
|
4385
|
+
|
|
4464
4386
|
Raises:
|
|
4465
4387
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
4466
4388
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
4467
|
-
|
|
4389
|
+
|
|
4468
4390
|
Tags:
|
|
4469
4391
|
Revisions
|
|
4470
4392
|
"""
|
|
@@ -4499,7 +4421,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
4499
4421
|
except ValueError:
|
|
4500
4422
|
return None
|
|
4501
4423
|
|
|
4502
|
-
def
|
|
4424
|
+
def get_revision(
|
|
4503
4425
|
self,
|
|
4504
4426
|
fileId: str,
|
|
4505
4427
|
revisionId: str,
|
|
@@ -4513,8 +4435,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
4513
4435
|
userIp: str | None = None,
|
|
4514
4436
|
) -> dict[str, Any]:
|
|
4515
4437
|
"""
|
|
4516
|
-
|
|
4517
|
-
|
|
4438
|
+
Retrieves the metadata for a single, specific revision of a file using its file ID and revision ID. This function is distinct from `list_afile_srevisions`, which returns a list of all revisions for a file, by targeting one historical version.
|
|
4439
|
+
|
|
4518
4440
|
Args:
|
|
4519
4441
|
fileId (string): fileId
|
|
4520
4442
|
revisionId (string): revisionId
|
|
@@ -4526,14 +4448,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
4526
4448
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
4527
4449
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
4528
4450
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
4529
|
-
|
|
4451
|
+
|
|
4530
4452
|
Returns:
|
|
4531
4453
|
dict[str, Any]: Successful response
|
|
4532
|
-
|
|
4454
|
+
|
|
4533
4455
|
Raises:
|
|
4534
4456
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
4535
4457
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
4536
|
-
|
|
4458
|
+
|
|
4537
4459
|
Tags:
|
|
4538
4460
|
Revisions
|
|
4539
4461
|
"""
|
|
@@ -4569,7 +4491,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
4569
4491
|
except ValueError:
|
|
4570
4492
|
return None
|
|
4571
4493
|
|
|
4572
|
-
def
|
|
4494
|
+
def delete_file_revision(
|
|
4573
4495
|
self,
|
|
4574
4496
|
fileId: str,
|
|
4575
4497
|
revisionId: str,
|
|
@@ -4582,8 +4504,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
4582
4504
|
userIp: str | None = None,
|
|
4583
4505
|
) -> Any:
|
|
4584
4506
|
"""
|
|
4585
|
-
Permanently
|
|
4586
|
-
|
|
4507
|
+
Permanently deletes a specific revision of a file, identified by its file and revision IDs. This action is irreversible and removes a single historical version, which is distinct from other functions in this class that delete the entire file or move it to the trash.
|
|
4508
|
+
|
|
4587
4509
|
Args:
|
|
4588
4510
|
fileId (string): fileId
|
|
4589
4511
|
revisionId (string): revisionId
|
|
@@ -4594,14 +4516,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
4594
4516
|
prettyPrint (string): Returns response with indentations and line breaks. Example: '<boolean>'.
|
|
4595
4517
|
quotaUser (string): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. Example: '<string>'.
|
|
4596
4518
|
userIp (string): Deprecated. Please use quotaUser instead. Example: '<string>'.
|
|
4597
|
-
|
|
4519
|
+
|
|
4598
4520
|
Returns:
|
|
4599
4521
|
Any: Successful response
|
|
4600
|
-
|
|
4522
|
+
|
|
4601
4523
|
Raises:
|
|
4602
4524
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
4603
4525
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
4604
|
-
|
|
4526
|
+
|
|
4605
4527
|
Tags:
|
|
4606
4528
|
Revisions
|
|
4607
4529
|
"""
|
|
@@ -4636,7 +4558,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
4636
4558
|
except ValueError:
|
|
4637
4559
|
return None
|
|
4638
4560
|
|
|
4639
|
-
def
|
|
4561
|
+
def update_revision(
|
|
4640
4562
|
self,
|
|
4641
4563
|
fileId: str,
|
|
4642
4564
|
revisionId: str,
|
|
@@ -4663,8 +4585,8 @@ class GoogleDriveApp(APIApplication):
|
|
|
4663
4585
|
size: str | None = None,
|
|
4664
4586
|
) -> dict[str, Any]:
|
|
4665
4587
|
"""
|
|
4666
|
-
|
|
4667
|
-
|
|
4588
|
+
Updates the metadata for a specific file revision using its file and revision IDs. It modifies properties such as pinning the revision (`keepForever`) or its publication status, and returns the updated revision metadata upon success.
|
|
4589
|
+
|
|
4668
4590
|
Args:
|
|
4669
4591
|
fileId (string): fileId
|
|
4670
4592
|
revisionId (string): revisionId
|
|
@@ -4689,14 +4611,14 @@ class GoogleDriveApp(APIApplication):
|
|
|
4689
4611
|
publishedLink (string): publishedLink Example: '<string>'.
|
|
4690
4612
|
publishedOutsideDomain (string): publishedOutsideDomain Example: '<boolean>'.
|
|
4691
4613
|
size (string): size Example: '<int64>'.
|
|
4692
|
-
|
|
4614
|
+
|
|
4693
4615
|
Returns:
|
|
4694
4616
|
dict[str, Any]: Successful response
|
|
4695
|
-
|
|
4617
|
+
|
|
4696
4618
|
Raises:
|
|
4697
4619
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
4698
4620
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
4699
|
-
|
|
4621
|
+
|
|
4700
4622
|
Tags:
|
|
4701
4623
|
Revisions
|
|
4702
4624
|
"""
|
|
@@ -4753,7 +4675,7 @@ class GoogleDriveApp(APIApplication):
|
|
|
4753
4675
|
|
|
4754
4676
|
|
|
4755
4677
|
|
|
4756
|
-
def
|
|
4678
|
+
def create_permission(
|
|
4757
4679
|
self,
|
|
4758
4680
|
fileId: str,
|
|
4759
4681
|
emailAddress: str | None = None,
|
|
@@ -4761,21 +4683,21 @@ class GoogleDriveApp(APIApplication):
|
|
|
4761
4683
|
type: str | None = None,
|
|
4762
4684
|
) -> dict[str, Any]:
|
|
4763
4685
|
"""
|
|
4764
|
-
|
|
4765
|
-
|
|
4686
|
+
Creates a new permission for a file, granting a specified role (e.g., 'reader') to a user, group, or domain. This is a simplified alternative to the more comprehensive `post_file_permission` function, focusing on core sharing functionality.
|
|
4687
|
+
|
|
4766
4688
|
Args:
|
|
4767
4689
|
fileId (string): fileId
|
|
4768
4690
|
emailAddress (string): emailAddress Example: '{{currentEmailId}}'.
|
|
4769
4691
|
role (string): role Example: 'reader'.
|
|
4770
4692
|
type (string): type Example: 'user'.
|
|
4771
|
-
|
|
4693
|
+
|
|
4772
4694
|
Returns:
|
|
4773
4695
|
dict[str, Any]: Grant Google Drive Access
|
|
4774
|
-
|
|
4696
|
+
|
|
4775
4697
|
Raises:
|
|
4776
4698
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
4777
4699
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
4778
|
-
|
|
4700
|
+
|
|
4779
4701
|
Tags:
|
|
4780
4702
|
Google Drive API Use Cases, Share file access to a slack channel
|
|
4781
4703
|
"""
|
|
@@ -4813,59 +4735,58 @@ class GoogleDriveApp(APIApplication):
|
|
|
4813
4735
|
def list_tools(self):
|
|
4814
4736
|
return [
|
|
4815
4737
|
self.get_drive_info,
|
|
4816
|
-
self.
|
|
4817
|
-
self.
|
|
4818
|
-
self.
|
|
4738
|
+
self.search_files,
|
|
4739
|
+
self.create_text_file,
|
|
4740
|
+
self.upload_file_from_path,
|
|
4819
4741
|
self.find_folder_id_by_name,
|
|
4820
4742
|
self.create_folder,
|
|
4821
|
-
self.
|
|
4822
|
-
self.
|
|
4743
|
+
self.get_file_details,
|
|
4744
|
+
self.trash_file,
|
|
4823
4745
|
# Auto generated from openapi spec
|
|
4824
|
-
self.
|
|
4825
|
-
self.
|
|
4826
|
-
self.
|
|
4827
|
-
self.
|
|
4828
|
-
self.
|
|
4829
|
-
self.
|
|
4830
|
-
self.
|
|
4831
|
-
self.
|
|
4832
|
-
self.
|
|
4833
|
-
self.
|
|
4834
|
-
self.
|
|
4746
|
+
self.list_installed_apps,
|
|
4747
|
+
self.get_app_by_id,
|
|
4748
|
+
self.get_about_info,
|
|
4749
|
+
self.list_drive_changes,
|
|
4750
|
+
self.get_changes_start_token,
|
|
4751
|
+
self.watch_drive_changes,
|
|
4752
|
+
self.stop_watching_channel,
|
|
4753
|
+
self.list_file_comments,
|
|
4754
|
+
self.create_file_comment,
|
|
4755
|
+
self.get_file_comment_by_id,
|
|
4756
|
+
self.delete_comment,
|
|
4835
4757
|
self.update_comment,
|
|
4836
|
-
self.
|
|
4837
|
-
self.
|
|
4838
|
-
self.
|
|
4839
|
-
self.
|
|
4840
|
-
self.
|
|
4841
|
-
self.
|
|
4758
|
+
self.list_shared_drives,
|
|
4759
|
+
self.create_shared_drive,
|
|
4760
|
+
self.get_shared_drive_metadata,
|
|
4761
|
+
self.delete_shared_drive,
|
|
4762
|
+
self.update_shared_drive,
|
|
4763
|
+
self.hide_drive,
|
|
4842
4764
|
self.unhide_drive,
|
|
4843
|
-
self.
|
|
4844
|
-
self.
|
|
4845
|
-
self.
|
|
4846
|
-
self.
|
|
4847
|
-
self.
|
|
4848
|
-
self.
|
|
4849
|
-
self.
|
|
4850
|
-
self.
|
|
4851
|
-
self.
|
|
4852
|
-
self.
|
|
4853
|
-
self.
|
|
4854
|
-
self.subscribe_to_changes_to_afile,
|
|
4765
|
+
self.search_files_advanced,
|
|
4766
|
+
self.create_file_metadata,
|
|
4767
|
+
self.generate_file_ids,
|
|
4768
|
+
self.empty_trash,
|
|
4769
|
+
self.permanently_delete_file,
|
|
4770
|
+
self.update_file_metadata,
|
|
4771
|
+
self.copy_file,
|
|
4772
|
+
self.export_file,
|
|
4773
|
+
self.list_file_labels,
|
|
4774
|
+
self.modify_file_labels,
|
|
4775
|
+
self.watch_file_for_changes,
|
|
4855
4776
|
self.list_file_permissions,
|
|
4856
|
-
self.
|
|
4777
|
+
self.create_file_permission,
|
|
4857
4778
|
self.get_permission_by_id,
|
|
4858
|
-
self.
|
|
4859
|
-
self.
|
|
4860
|
-
self.
|
|
4861
|
-
self.
|
|
4779
|
+
self.delete_permission,
|
|
4780
|
+
self.update_permission,
|
|
4781
|
+
self.list_comment_replies,
|
|
4782
|
+
self.create_comment_reply,
|
|
4862
4783
|
self.get_reply_by_id,
|
|
4863
|
-
self.
|
|
4864
|
-
self.
|
|
4865
|
-
self.
|
|
4866
|
-
self.
|
|
4867
|
-
self.
|
|
4868
|
-
self.
|
|
4869
|
-
self.
|
|
4870
|
-
self.
|
|
4784
|
+
self.delete_reply,
|
|
4785
|
+
self.update_reply,
|
|
4786
|
+
self.list_file_revisions,
|
|
4787
|
+
self.get_revision,
|
|
4788
|
+
self.delete_file_revision,
|
|
4789
|
+
self.update_revision,
|
|
4790
|
+
self.create_permission,
|
|
4791
|
+
self.move_file,
|
|
4871
4792
|
]
|