google-apis-drive_v3 0.51.0 → 0.63.0

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.
@@ -30,7 +30,7 @@ module Google
30
30
  # Drive = Google::Apis::DriveV3 # Alias the module
31
31
  # service = Drive::DriveService.new
32
32
  #
33
- # @see https://developers.google.com/drive/
33
+ # @see https://developers.google.com/workspace/drive/
34
34
  class DriveService < Google::Apis::Core::BaseService
35
35
  DEFAULT_ENDPOINT_TEMPLATE = "https://www.$UNIVERSE_DOMAIN$/"
36
36
 
@@ -52,6 +52,10 @@ module Google
52
52
  end
53
53
 
54
54
  # Gets information about the user, the user's Drive, and system capabilities.
55
+ # For more information, see [Return user info](https://developers.google.com/
56
+ # workspace/drive/api/guides/user-info). Required: The `fields` parameter must
57
+ # be set. To return the exact fields you need, see [Return specific fields](
58
+ # https://developers.google.com/workspace/drive/api/guides/fields-parameter).
55
59
  # @param [String] fields
56
60
  # Selector specifying which fields to include in a partial response.
57
61
  # @param [String] quota_user
@@ -78,7 +82,112 @@ module Google
78
82
  execute_or_queue_command(command, &block)
79
83
  end
80
84
 
81
- # Gets a specific app.
85
+ # Retrieves an AccessProposal by ID.
86
+ # @param [String] file_id
87
+ # Required. The id of the item the request is on.
88
+ # @param [String] proposal_id
89
+ # Required. The id of the access proposal to resolve.
90
+ # @param [String] fields
91
+ # Selector specifying which fields to include in a partial response.
92
+ # @param [String] quota_user
93
+ # Available to use for quota purposes for server-side applications. Can be any
94
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
95
+ # @param [Google::Apis::RequestOptions] options
96
+ # Request-specific options
97
+ #
98
+ # @yield [result, err] Result & error if block supplied
99
+ # @yieldparam result [Google::Apis::DriveV3::AccessProposal] parsed result object
100
+ # @yieldparam err [StandardError] error object if request failed
101
+ #
102
+ # @return [Google::Apis::DriveV3::AccessProposal]
103
+ #
104
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
105
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
106
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
107
+ def get_accessproposal(file_id, proposal_id, fields: nil, quota_user: nil, options: nil, &block)
108
+ command = make_simple_command(:get, 'files/{fileId}/accessproposals/{proposalId}', options)
109
+ command.response_representation = Google::Apis::DriveV3::AccessProposal::Representation
110
+ command.response_class = Google::Apis::DriveV3::AccessProposal
111
+ command.params['fileId'] = file_id unless file_id.nil?
112
+ command.params['proposalId'] = proposal_id unless proposal_id.nil?
113
+ command.query['fields'] = fields unless fields.nil?
114
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
115
+ execute_or_queue_command(command, &block)
116
+ end
117
+
118
+ # List the AccessProposals on a file. Note: Only approvers are able to list
119
+ # AccessProposals on a file. If the user is not an approver, returns a 403.
120
+ # @param [String] file_id
121
+ # Required. The id of the item the request is on.
122
+ # @param [Fixnum] page_size
123
+ # Optional. The number of results per page
124
+ # @param [String] page_token
125
+ # Optional. The continuation token on the list of access requests.
126
+ # @param [String] fields
127
+ # Selector specifying which fields to include in a partial response.
128
+ # @param [String] quota_user
129
+ # Available to use for quota purposes for server-side applications. Can be any
130
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
131
+ # @param [Google::Apis::RequestOptions] options
132
+ # Request-specific options
133
+ #
134
+ # @yield [result, err] Result & error if block supplied
135
+ # @yieldparam result [Google::Apis::DriveV3::ListAccessProposalsResponse] parsed result object
136
+ # @yieldparam err [StandardError] error object if request failed
137
+ #
138
+ # @return [Google::Apis::DriveV3::ListAccessProposalsResponse]
139
+ #
140
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
141
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
142
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
143
+ def list_accessproposals(file_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
144
+ command = make_simple_command(:get, 'files/{fileId}/accessproposals', options)
145
+ command.response_representation = Google::Apis::DriveV3::ListAccessProposalsResponse::Representation
146
+ command.response_class = Google::Apis::DriveV3::ListAccessProposalsResponse
147
+ command.params['fileId'] = file_id unless file_id.nil?
148
+ command.query['pageSize'] = page_size unless page_size.nil?
149
+ command.query['pageToken'] = page_token unless page_token.nil?
150
+ command.query['fields'] = fields unless fields.nil?
151
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
152
+ execute_or_queue_command(command, &block)
153
+ end
154
+
155
+ # Used to approve or deny an Access Proposal.
156
+ # @param [String] file_id
157
+ # Required. The id of the item the request is on.
158
+ # @param [String] proposal_id
159
+ # Required. The id of the access proposal to resolve.
160
+ # @param [Google::Apis::DriveV3::ResolveAccessProposalRequest] resolve_access_proposal_request_object
161
+ # @param [String] fields
162
+ # Selector specifying which fields to include in a partial response.
163
+ # @param [String] quota_user
164
+ # Available to use for quota purposes for server-side applications. Can be any
165
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
166
+ # @param [Google::Apis::RequestOptions] options
167
+ # Request-specific options
168
+ #
169
+ # @yield [result, err] Result & error if block supplied
170
+ # @yieldparam result [NilClass] No result returned for this method
171
+ # @yieldparam err [StandardError] error object if request failed
172
+ #
173
+ # @return [void]
174
+ #
175
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
176
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
177
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
178
+ def resolve_accessproposal_access_proposal(file_id, proposal_id, resolve_access_proposal_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
179
+ command = make_simple_command(:post, 'files/{fileId}/accessproposals/{proposalId}:resolve', options)
180
+ command.request_representation = Google::Apis::DriveV3::ResolveAccessProposalRequest::Representation
181
+ command.request_object = resolve_access_proposal_request_object
182
+ command.params['fileId'] = file_id unless file_id.nil?
183
+ command.params['proposalId'] = proposal_id unless proposal_id.nil?
184
+ command.query['fields'] = fields unless fields.nil?
185
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
186
+ execute_or_queue_command(command, &block)
187
+ end
188
+
189
+ # Gets a specific app. For more information, see [Return user info](https://
190
+ # developers.google.com/workspace/drive/api/guides/user-info).
82
191
  # @param [String] app_id
83
192
  # The ID of the app.
84
193
  # @param [String] fields
@@ -108,7 +217,8 @@ module Google
108
217
  execute_or_queue_command(command, &block)
109
218
  end
110
219
 
111
- # Lists a user's installed apps.
220
+ # Lists a user's installed apps. For more information, see [Return user info](
221
+ # https://developers.google.com/workspace/drive/api/guides/user-info).
112
222
  # @param [String] app_filter_extensions
113
223
  # A comma-separated list of file extensions to limit returned results. All
114
224
  # results within the given app query scope which can open any of the given file
@@ -151,7 +261,9 @@ module Google
151
261
  execute_or_queue_command(command, &block)
152
262
  end
153
263
 
154
- # Gets the starting pageToken for listing future changes.
264
+ # Gets the starting pageToken for listing future changes. For more information,
265
+ # see [Retrieve changes](https://developers.google.com/workspace/drive/api/
266
+ # guides/manage-changes).
155
267
  # @param [String] drive_id
156
268
  # The ID of the shared drive for which the starting pageToken for listing future
157
269
  # changes from that shared drive will be returned.
@@ -191,7 +303,9 @@ module Google
191
303
  execute_or_queue_command(command, &block)
192
304
  end
193
305
 
194
- # Lists the changes for a user or shared drive.
306
+ # Lists the changes for a user or shared drive. For more information, see [
307
+ # Retrieve changes](https://developers.google.com/workspace/drive/api/guides/
308
+ # manage-changes).
195
309
  # @param [String] page_token
196
310
  # The token for continuing a previous list request on the next page. This should
197
311
  # be set to the value of 'nextPageToken' from the previous response or to the
@@ -273,7 +387,9 @@ module Google
273
387
  execute_or_queue_command(command, &block)
274
388
  end
275
389
 
276
- # Subscribes to changes for a user.
390
+ # Subscribes to changes for a user. For more information, see [Notifications for
391
+ # resource changes](https://developers.google.com/workspace/drive/api/guides/
392
+ # push).
277
393
  # @param [String] page_token
278
394
  # The token for continuing a previous list request on the next page. This should
279
395
  # be set to the value of 'nextPageToken' from the previous response or to the
@@ -358,7 +474,9 @@ module Google
358
474
  execute_or_queue_command(command, &block)
359
475
  end
360
476
 
361
- # Stops watching resources through this channel.
477
+ # Stops watching resources through this channel. For more information, see [
478
+ # Notifications for resource changes](https://developers.google.com/workspace/
479
+ # drive/api/guides/push).
362
480
  # @param [Google::Apis::DriveV3::Channel] channel_object
363
481
  # @param [String] fields
364
482
  # Selector specifying which fields to include in a partial response.
@@ -386,7 +504,11 @@ module Google
386
504
  execute_or_queue_command(command, &block)
387
505
  end
388
506
 
389
- # Creates a comment on a file.
507
+ # Creates a comment on a file. For more information, see [Manage comments and
508
+ # replies](https://developers.google.com/workspace/drive/api/guides/manage-
509
+ # comments). Required: The `fields` parameter must be set. To return the exact
510
+ # fields you need, see [Return specific fields](https://developers.google.com/
511
+ # workspace/drive/api/guides/fields-parameter).
390
512
  # @param [String] file_id
391
513
  # The ID of the file.
392
514
  # @param [Google::Apis::DriveV3::Comment] comment_object
@@ -419,7 +541,11 @@ module Google
419
541
  execute_or_queue_command(command, &block)
420
542
  end
421
543
 
422
- # Deletes a comment.
544
+ # Deletes a comment. For more information, see [Manage comments and replies](
545
+ # https://developers.google.com/workspace/drive/api/guides/manage-comments).
546
+ # Required: The `fields` parameter must be set. To return the exact fields you
547
+ # need, see [Return specific fields](https://developers.google.com/workspace/
548
+ # drive/api/guides/fields-parameter).
423
549
  # @param [String] file_id
424
550
  # The ID of the file.
425
551
  # @param [String] comment_id
@@ -450,7 +576,11 @@ module Google
450
576
  execute_or_queue_command(command, &block)
451
577
  end
452
578
 
453
- # Gets a comment by ID.
579
+ # Gets a comment by ID. For more information, see [Manage comments and replies](
580
+ # https://developers.google.com/workspace/drive/api/guides/manage-comments).
581
+ # Required: The `fields` parameter must be set. To return the exact fields you
582
+ # need, see [Return specific fields](https://developers.google.com/workspace/
583
+ # drive/api/guides/fields-parameter).
454
584
  # @param [String] file_id
455
585
  # The ID of the file.
456
586
  # @param [String] comment_id
@@ -487,7 +617,11 @@ module Google
487
617
  execute_or_queue_command(command, &block)
488
618
  end
489
619
 
490
- # Lists a file's comments.
620
+ # Lists a file's comments. For more information, see [Manage comments and
621
+ # replies](https://developers.google.com/workspace/drive/api/guides/manage-
622
+ # comments). Required: The `fields` parameter must be set. To return the exact
623
+ # fields you need, see [Return specific fields](https://developers.google.com/
624
+ # workspace/drive/api/guides/fields-parameter).
491
625
  # @param [String] file_id
492
626
  # The ID of the file.
493
627
  # @param [Boolean] include_deleted
@@ -532,7 +666,11 @@ module Google
532
666
  execute_or_queue_command(command, &block)
533
667
  end
534
668
 
535
- # Updates a comment with patch semantics.
669
+ # Updates a comment with patch semantics. For more information, see [Manage
670
+ # comments and replies](https://developers.google.com/workspace/drive/api/guides/
671
+ # manage-comments). Required: The `fields` parameter must be set. To return the
672
+ # exact fields you need, see [Return specific fields](https://developers.google.
673
+ # com/workspace/drive/api/guides/fields-parameter).
536
674
  # @param [String] file_id
537
675
  # The ID of the file.
538
676
  # @param [String] comment_id
@@ -710,8 +848,8 @@ module Google
710
848
 
711
849
  # Lists the user's shared drives. This method accepts the `q` parameter, which
712
850
  # is a search query combining one or more search terms. For more information,
713
- # see the [Search for shared drives](/drive/api/guides/search-shareddrives)
714
- # guide.
851
+ # see the [Search for shared drives](/workspace/drive/api/guides/search-
852
+ # shareddrives) guide.
715
853
  # @param [Fixnum] page_size
716
854
  # Maximum number of shared drives to return per page.
717
855
  # @param [String] page_token
@@ -891,18 +1029,18 @@ module Google
891
1029
  # 120 GB - *Accepted Media MIME types:*`*/*` Note: Specify a valid MIME type,
892
1030
  # rather than the literal `*/*` value. The literal `*/*` is only used to
893
1031
  # indicate that any valid MIME type can be uploaded. For more information on
894
- # uploading files, see [Upload file data](/drive/api/guides/manage-uploads).
895
- # Apps creating shortcuts with `files.create` must specify the MIME type `
896
- # application/vnd.google-apps.shortcut`. Apps should specify a file extension in
897
- # the `name` property when inserting files with the API. For example, an
898
- # operation to insert a JPEG file should specify something like `"name": "cat.
899
- # jpg"` in the metadata. Subsequent `GET` requests include the read-only `
900
- # fileExtension` property populated with the extension originally specified in
901
- # the `title` property. When a Google Drive user requests to download a file, or
902
- # when the file is downloaded through the sync client, Drive builds a full
903
- # filename (with extension) based on the title. In cases where the extension is
904
- # missing, Drive attempts to determine the extension based on the file's MIME
905
- # type.
1032
+ # uploading files, see [Upload file data](/workspace/drive/api/guides/manage-
1033
+ # uploads). Apps creating shortcuts with `files.create` must specify the MIME
1034
+ # type `application/vnd.google-apps.shortcut`. Apps should specify a file
1035
+ # extension in the `name` property when inserting files with the API. For
1036
+ # example, an operation to insert a JPEG file should specify something like `"
1037
+ # name": "cat.jpg"` in the metadata. Subsequent `GET` requests include the read-
1038
+ # only `fileExtension` property populated with the extension originally
1039
+ # specified in the `title` property. When a Google Drive user requests to
1040
+ # download a file, or when the file is downloaded through the sync client, Drive
1041
+ # builds a full filename (with extension) based on the title. In cases where the
1042
+ # extension is missing, Drive attempts to determine the extension based on the
1043
+ # file's MIME type.
906
1044
  # @param [Google::Apis::DriveV3::File] file_object
907
1045
  # @param [Boolean] enforce_single_parent
908
1046
  # Deprecated. Creating files in multiple folders is no longer supported.
@@ -1018,6 +1156,50 @@ module Google
1018
1156
  execute_or_queue_command(command, &block)
1019
1157
  end
1020
1158
 
1159
+ # Downloads content of a file. Operations are valid for 24 hours from the time
1160
+ # of creation.
1161
+ # @param [String] file_id
1162
+ # Required. The ID of the file to download.
1163
+ # @param [String] mime_type
1164
+ # Optional. The MIME type the file should be downloaded as. This field can only
1165
+ # be set when downloading Google Workspace documents. See [Export MIME types for
1166
+ # Google Workspace documents](/drive/api/guides/ref-export-formats) for the list
1167
+ # of supported MIME types. If not set, a Google Workspace document is downloaded
1168
+ # with a default MIME type. The default MIME type might change in the future.
1169
+ # @param [String] revision_id
1170
+ # Optional. The revision ID of the file to download. This field can only be set
1171
+ # when downloading blob files, Google Docs, and Google Sheets. Returns `
1172
+ # INVALID_ARGUMENT` if downloading a specific revision on the file is
1173
+ # unsupported.
1174
+ # @param [String] fields
1175
+ # Selector specifying which fields to include in a partial response.
1176
+ # @param [String] quota_user
1177
+ # Available to use for quota purposes for server-side applications. Can be any
1178
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1179
+ # @param [Google::Apis::RequestOptions] options
1180
+ # Request-specific options
1181
+ #
1182
+ # @yield [result, err] Result & error if block supplied
1183
+ # @yieldparam result [Google::Apis::DriveV3::Operation] parsed result object
1184
+ # @yieldparam err [StandardError] error object if request failed
1185
+ #
1186
+ # @return [Google::Apis::DriveV3::Operation]
1187
+ #
1188
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1189
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1190
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1191
+ def download_file(file_id, mime_type: nil, revision_id: nil, fields: nil, quota_user: nil, options: nil, &block)
1192
+ command = make_simple_command(:post, 'files/{fileId}/download', options)
1193
+ command.response_representation = Google::Apis::DriveV3::Operation::Representation
1194
+ command.response_class = Google::Apis::DriveV3::Operation
1195
+ command.params['fileId'] = file_id unless file_id.nil?
1196
+ command.query['mimeType'] = mime_type unless mime_type.nil?
1197
+ command.query['revisionId'] = revision_id unless revision_id.nil?
1198
+ command.query['fields'] = fields unless fields.nil?
1199
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1200
+ execute_or_queue_command(command, &block)
1201
+ end
1202
+
1021
1203
  # Permanently deletes all of the user's trashed files.
1022
1204
  # @param [String] drive_id
1023
1205
  # If set, empties the trash of the provided shared drive.
@@ -1131,14 +1313,16 @@ module Google
1131
1313
  # Gets a file's metadata or content by ID. If you provide the URL parameter `
1132
1314
  # alt=media`, then the response includes the file contents in the response body.
1133
1315
  # Downloading content with `alt=media` only works if the file is stored in Drive.
1134
- # To download Google Docs, Sheets, and Slides use [`files.export`](/drive/api/
1135
- # reference/rest/v3/files/export) instead. For more information, see [Download &
1136
- # export files](/drive/api/guides/manage-downloads).
1316
+ # To download Google Docs, Sheets, and Slides use [`files.export`](/workspace/
1317
+ # drive/api/reference/rest/v3/files/export) instead. For more information, see [
1318
+ # Download & export files](/workspace/drive/api/guides/manage-downloads).
1137
1319
  # @param [String] file_id
1138
1320
  # The ID of the file.
1139
1321
  # @param [Boolean] acknowledge_abuse
1140
1322
  # Whether the user is acknowledging the risk of downloading known malware or
1141
- # other abusive files. This is only applicable when alt=media.
1323
+ # other abusive files. This is only applicable when the `alt` parameter is set
1324
+ # to `media` and the user is the owner of the file or an organizer of the shared
1325
+ # drive in which the file resides.
1142
1326
  # @param [String] include_labels
1143
1327
  # A comma-separated list of IDs of labels to include in the `labelInfo` part of
1144
1328
  # the response.
@@ -1190,10 +1374,10 @@ module Google
1190
1374
 
1191
1375
  # Lists the user's files. This method accepts the `q` parameter, which is a
1192
1376
  # search query combining one or more search terms. For more information, see the
1193
- # [Search for files & folders](/drive/api/guides/search-files) guide. *Note:*
1194
- # This method returns *all* files by default, including trashed files. If you
1195
- # don't want trashed files to appear in the list, use the `trashed=false` query
1196
- # parameter to remove trashed files from the results.
1377
+ # [Search for files & folders](/workspace/drive/api/guides/search-files) guide. *
1378
+ # Note:* This method returns *all* files by default, including trashed files. If
1379
+ # you don't want trashed files to appear in the list, use the `trashed=false`
1380
+ # query parameter to remove trashed files from the results.
1197
1381
  # @param [String] corpora
1198
1382
  # Bodies of items (files/documents) to which the query applies. Supported bodies
1199
1383
  # are 'user', 'domain', 'drive', and 'allDrives'. Prefer 'user' or 'drive' to '
@@ -1214,11 +1398,20 @@ module Google
1214
1398
  # @param [Boolean] include_team_drive_items
1215
1399
  # Deprecated: Use `includeItemsFromAllDrives` instead.
1216
1400
  # @param [String] order_by
1217
- # A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', '
1218
- # modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', '
1219
- # recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts
1220
- # ascending by default, but can be reversed with the 'desc' modifier. Example
1221
- # usage: ?orderBy=folder,modifiedTime desc,name.
1401
+ # A comma-separated list of sort keys. Valid keys are: * `createdTime`: When the
1402
+ # file was created. * `folder`: The folder ID. This field is sorted using
1403
+ # alphabetical ordering. * `modifiedByMeTime`: The last time the file was
1404
+ # modified by the user. * `modifiedTime`: The last time the file was modified by
1405
+ # anyone. * `name`: The name of the file. This field is sorted using
1406
+ # alphabetical ordering, so 1, 12, 2, 22. * `name_natural`: The name of the file.
1407
+ # This field is sorted using natural sort ordering, so 1, 2, 12, 22. * `
1408
+ # quotaBytesUsed`: The number of storage quota bytes used by the file. * `
1409
+ # recency`: The most recent timestamp from the file's date-time fields. * `
1410
+ # sharedWithMeTime`: When the file was shared with the user, if applicable. * `
1411
+ # starred`: Whether the user has starred the file. * `viewedByMeTime`: The last
1412
+ # time the file was viewed by the user. Each key sorts ascending by default, but
1413
+ # can be reversed with the 'desc' modifier. Example usage: `?orderBy=folder,
1414
+ # modifiedTime desc,name`.
1222
1415
  # @param [Fixnum] page_size
1223
1416
  # The maximum number of files to return per page. Partial or empty result pages
1224
1417
  # are possible even before the end of the files list has been reached.
@@ -1357,7 +1550,8 @@ module Google
1357
1550
  # size:* 5,120 GB - *Accepted Media MIME types:*`*/*` Note: Specify a valid MIME
1358
1551
  # type, rather than the literal `*/*` value. The literal `*/*` is only used to
1359
1552
  # indicate that any valid MIME type can be uploaded. For more information on
1360
- # uploading files, see [Upload file data](/drive/api/guides/manage-uploads).
1553
+ # uploading files, see [Upload file data](/workspace/drive/api/guides/manage-
1554
+ # uploads).
1361
1555
  # @param [String] file_id
1362
1556
  # The ID of the file.
1363
1557
  # @param [Google::Apis::DriveV3::File] file_object
@@ -1442,7 +1636,9 @@ module Google
1442
1636
  # @param [Google::Apis::DriveV3::Channel] channel_object
1443
1637
  # @param [Boolean] acknowledge_abuse
1444
1638
  # Whether the user is acknowledging the risk of downloading known malware or
1445
- # other abusive files. This is only applicable when alt=media.
1639
+ # other abusive files. This is only applicable when the `alt` parameter is set
1640
+ # to `media` and the user is the owner of the file or an organizer of the shared
1641
+ # drive in which the file resides.
1446
1642
  # @param [String] include_labels
1447
1643
  # A comma-separated list of IDs of labels to include in the `labelInfo` part of
1448
1644
  # the response.
@@ -1487,6 +1683,143 @@ module Google
1487
1683
  execute_or_queue_command(command, &block)
1488
1684
  end
1489
1685
 
1686
+ # Starts asynchronous cancellation on a long-running operation. The server makes
1687
+ # a best effort to cancel the operation, but success is not guaranteed. If the
1688
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
1689
+ # Clients can use Operations.GetOperation or other methods to check whether the
1690
+ # cancellation succeeded or whether the operation completed despite cancellation.
1691
+ # On successful cancellation, the operation is not deleted; instead, it becomes
1692
+ # an operation with an Operation.error value with a google.rpc.Status.code of `1`
1693
+ # , corresponding to `Code.CANCELLED`.
1694
+ # @param [String] name
1695
+ # The name of the operation resource to be cancelled.
1696
+ # @param [String] fields
1697
+ # Selector specifying which fields to include in a partial response.
1698
+ # @param [String] quota_user
1699
+ # Available to use for quota purposes for server-side applications. Can be any
1700
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1701
+ # @param [Google::Apis::RequestOptions] options
1702
+ # Request-specific options
1703
+ #
1704
+ # @yield [result, err] Result & error if block supplied
1705
+ # @yieldparam result [NilClass] No result returned for this method
1706
+ # @yieldparam err [StandardError] error object if request failed
1707
+ #
1708
+ # @return [void]
1709
+ #
1710
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1711
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1712
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1713
+ def cancel_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1714
+ command = make_simple_command(:post, 'operations/{name}:cancel', options)
1715
+ command.params['name'] = name unless name.nil?
1716
+ command.query['fields'] = fields unless fields.nil?
1717
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1718
+ execute_or_queue_command(command, &block)
1719
+ end
1720
+
1721
+ # Deletes a long-running operation. This method indicates that the client is no
1722
+ # longer interested in the operation result. It does not cancel the operation.
1723
+ # If the server doesn't support this method, it returns `google.rpc.Code.
1724
+ # UNIMPLEMENTED`.
1725
+ # @param [String] name
1726
+ # The name of the operation resource to be deleted.
1727
+ # @param [String] fields
1728
+ # Selector specifying which fields to include in a partial response.
1729
+ # @param [String] quota_user
1730
+ # Available to use for quota purposes for server-side applications. Can be any
1731
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1732
+ # @param [Google::Apis::RequestOptions] options
1733
+ # Request-specific options
1734
+ #
1735
+ # @yield [result, err] Result & error if block supplied
1736
+ # @yieldparam result [NilClass] No result returned for this method
1737
+ # @yieldparam err [StandardError] error object if request failed
1738
+ #
1739
+ # @return [void]
1740
+ #
1741
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1742
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1743
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1744
+ def delete_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1745
+ command = make_simple_command(:delete, 'operations/{name}', options)
1746
+ command.params['name'] = name unless name.nil?
1747
+ command.query['fields'] = fields unless fields.nil?
1748
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1749
+ execute_or_queue_command(command, &block)
1750
+ end
1751
+
1752
+ # Gets the latest state of a long-running operation. Clients can use this method
1753
+ # to poll the operation result at intervals as recommended by the API service.
1754
+ # @param [String] name
1755
+ # The name of the operation resource.
1756
+ # @param [String] fields
1757
+ # Selector specifying which fields to include in a partial response.
1758
+ # @param [String] quota_user
1759
+ # Available to use for quota purposes for server-side applications. Can be any
1760
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1761
+ # @param [Google::Apis::RequestOptions] options
1762
+ # Request-specific options
1763
+ #
1764
+ # @yield [result, err] Result & error if block supplied
1765
+ # @yieldparam result [Google::Apis::DriveV3::Operation] parsed result object
1766
+ # @yieldparam err [StandardError] error object if request failed
1767
+ #
1768
+ # @return [Google::Apis::DriveV3::Operation]
1769
+ #
1770
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1771
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1772
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1773
+ def get_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1774
+ command = make_simple_command(:get, 'operations/{name}', options)
1775
+ command.response_representation = Google::Apis::DriveV3::Operation::Representation
1776
+ command.response_class = Google::Apis::DriveV3::Operation
1777
+ command.params['name'] = name unless name.nil?
1778
+ command.query['fields'] = fields unless fields.nil?
1779
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1780
+ execute_or_queue_command(command, &block)
1781
+ end
1782
+
1783
+ # Lists operations that match the specified filter in the request. If the server
1784
+ # doesn't support this method, it returns `UNIMPLEMENTED`.
1785
+ # @param [String] filter
1786
+ # The standard list filter.
1787
+ # @param [String] name
1788
+ # The name of the operation's parent resource.
1789
+ # @param [Fixnum] page_size
1790
+ # The standard list page size.
1791
+ # @param [String] page_token
1792
+ # The standard list page token.
1793
+ # @param [String] fields
1794
+ # Selector specifying which fields to include in a partial response.
1795
+ # @param [String] quota_user
1796
+ # Available to use for quota purposes for server-side applications. Can be any
1797
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1798
+ # @param [Google::Apis::RequestOptions] options
1799
+ # Request-specific options
1800
+ #
1801
+ # @yield [result, err] Result & error if block supplied
1802
+ # @yieldparam result [Google::Apis::DriveV3::ListOperationsResponse] parsed result object
1803
+ # @yieldparam err [StandardError] error object if request failed
1804
+ #
1805
+ # @return [Google::Apis::DriveV3::ListOperationsResponse]
1806
+ #
1807
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1808
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1809
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1810
+ def list_operations(filter: nil, name: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1811
+ command = make_simple_command(:get, 'operations', options)
1812
+ command.response_representation = Google::Apis::DriveV3::ListOperationsResponse::Representation
1813
+ command.response_class = Google::Apis::DriveV3::ListOperationsResponse
1814
+ command.query['filter'] = filter unless filter.nil?
1815
+ command.query['name'] = name unless name.nil?
1816
+ command.query['pageSize'] = page_size unless page_size.nil?
1817
+ command.query['pageToken'] = page_token unless page_token.nil?
1818
+ command.query['fields'] = fields unless fields.nil?
1819
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1820
+ execute_or_queue_command(command, &block)
1821
+ end
1822
+
1490
1823
  # Creates a permission for a file or shared drive. **Warning:** Concurrent
1491
1824
  # permissions operations on the same file are not supported; only the last
1492
1825
  # update is applied.
@@ -1562,6 +1895,8 @@ module Google
1562
1895
  # The ID of the file or shared drive.
1563
1896
  # @param [String] permission_id
1564
1897
  # The ID of the permission.
1898
+ # @param [Boolean] enforce_expansive_access
1899
+ # Whether the request should enforce expansive access rules.
1565
1900
  # @param [Boolean] supports_all_drives
1566
1901
  # Whether the requesting application supports both My Drives and shared drives.
1567
1902
  # @param [Boolean] supports_team_drives
@@ -1588,10 +1923,11 @@ module Google
1588
1923
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1589
1924
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1590
1925
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1591
- def delete_permission(file_id, permission_id, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
1926
+ def delete_permission(file_id, permission_id, enforce_expansive_access: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
1592
1927
  command = make_simple_command(:delete, 'files/{fileId}/permissions/{permissionId}', options)
1593
1928
  command.params['fileId'] = file_id unless file_id.nil?
1594
1929
  command.params['permissionId'] = permission_id unless permission_id.nil?
1930
+ command.query['enforceExpansiveAccess'] = enforce_expansive_access unless enforce_expansive_access.nil?
1595
1931
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
1596
1932
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
1597
1933
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
@@ -1707,6 +2043,8 @@ module Google
1707
2043
  # @param [String] permission_id
1708
2044
  # The ID of the permission.
1709
2045
  # @param [Google::Apis::DriveV3::Permission] permission_object
2046
+ # @param [Boolean] enforce_expansive_access
2047
+ # Whether the request should enforce expansive access rules.
1710
2048
  # @param [Boolean] remove_expiration
1711
2049
  # Whether to remove the expiration date.
1712
2050
  # @param [Boolean] supports_all_drives
@@ -1739,7 +2077,7 @@ module Google
1739
2077
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1740
2078
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1741
2079
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1742
- def update_permission(file_id, permission_id, permission_object = nil, remove_expiration: nil, supports_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
2080
+ def update_permission(file_id, permission_id, permission_object = nil, enforce_expansive_access: nil, remove_expiration: nil, supports_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
1743
2081
  command = make_simple_command(:patch, 'files/{fileId}/permissions/{permissionId}', options)
1744
2082
  command.request_representation = Google::Apis::DriveV3::Permission::Representation
1745
2083
  command.request_object = permission_object
@@ -1747,6 +2085,7 @@ module Google
1747
2085
  command.response_class = Google::Apis::DriveV3::Permission
1748
2086
  command.params['fileId'] = file_id unless file_id.nil?
1749
2087
  command.params['permissionId'] = permission_id unless permission_id.nil?
2088
+ command.query['enforceExpansiveAccess'] = enforce_expansive_access unless enforce_expansive_access.nil?
1750
2089
  command.query['removeExpiration'] = remove_expiration unless remove_expiration.nil?
1751
2090
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
1752
2091
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
@@ -1991,7 +2330,9 @@ module Google
1991
2330
  # The ID of the revision.
1992
2331
  # @param [Boolean] acknowledge_abuse
1993
2332
  # Whether the user is acknowledging the risk of downloading known malware or
1994
- # other abusive files. This is only applicable when alt=media.
2333
+ # other abusive files. This is only applicable when the `alt` parameter is set
2334
+ # to `media` and the user is the owner of the file or an organizer of the shared
2335
+ # drive in which the file resides.
1995
2336
  # @param [String] fields
1996
2337
  # Selector specifying which fields to include in a partial response.
1997
2338
  # @param [String] quota_user
@@ -23,7 +23,7 @@ module Google
23
23
  #
24
24
  # The Google Drive API allows clients to access resources from Google Drive.
25
25
  #
26
- # @see https://developers.google.com/drive/
26
+ # @see https://developers.google.com/workspace/drive/
27
27
  module DriveV3
28
28
  # Version of the Google Drive API this client connects to.
29
29
  # This is NOT the gem version.