Class: Google::Apis::DriveV2::DriveService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
generated/google/apis/drive_v2/service.rb

Overview

Drive API

Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.

Examples:

require 'google/apis/drive_v2'

Drive = Google::Apis::DriveV2 # Alias the module
service = Drive::DriveService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDriveService

Returns a new instance of DriveService.



50
51
52
53
# File 'generated/google/apis/drive_v2/service.rb', line 50

def initialize
  super('https://www.googleapis.com/', 'drive/v2/')
  @batch_path = 'batch/drive/v2'
end

Instance Attribute Details

#keyString

Returns 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.

Returns:

  • (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.



39
40
41
# File 'generated/google/apis/drive_v2/service.rb', line 39

def key
  @key
end

#quota_userString

Returns An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Returns:

  • (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.



44
45
46
# File 'generated/google/apis/drive_v2/service.rb', line 44

def quota_user
  @quota_user
end

#user_ipString

Returns Deprecated. Please use quotaUser instead.

Returns:

  • (String)

    Deprecated. Please use quotaUser instead.



48
49
50
# File 'generated/google/apis/drive_v2/service.rb', line 48

def user_ip
  @user_ip
end

Instance Method Details

#copy_file(file_id, file_object = nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File

Creates a copy of the specified file. Folders cannot be copied.

Parameters:

  • file_id (String)

    The ID of the file to copy.

  • file_object (Google::Apis::DriveV2::File) (defaults to: nil)
  • convert (Boolean) (defaults to: nil)

    Whether to convert this file to the corresponding Docs Editors format.

  • enforce_single_parent (Boolean) (defaults to: nil)

    Deprecated. Copying files into multiple folders is no longer supported. Use shortcuts instead.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • ocr (Boolean) (defaults to: nil)

    Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.

  • ocr_language (String) (defaults to: nil)

    If ocr is true, hints at the language to use. Valid values are BCP 47 codes.

  • pinned (Boolean) (defaults to: nil)

    Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • timed_text_language (String) (defaults to: nil)

    The language of the timed text.

  • timed_text_track_name (String) (defaults to: nil)

    The timed text track name.

  • visibility (String) (defaults to: nil)

    The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
# File 'generated/google/apis/drive_v2/service.rb', line 1185

def copy_file(file_id, file_object = nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/copy', options)
  command.request_representation = Google::Apis::DriveV2::File::Representation
  command.request_object = file_object
  command.response_representation = Google::Apis::DriveV2::File::Representation
  command.response_class = Google::Apis::DriveV2::File
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['convert'] = convert unless convert.nil?
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['ocr'] = ocr unless ocr.nil?
  command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
  command.query['pinned'] = pinned unless pinned.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
  command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
  command.query['visibility'] = visibility unless visibility.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_child(folder_id, child_id, enforce_single_parent: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Removes a child from a folder.

Parameters:

  • folder_id (String)

    The ID of the folder.

  • child_id (String)

    The ID of the child.

  • enforce_single_parent (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



495
496
497
498
499
500
501
502
503
504
# File 'generated/google/apis/drive_v2/service.rb', line 495

def delete_child(folder_id, child_id, enforce_single_parent: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'files/{folderId}/children/{childId}', options)
  command.params['folderId'] = folder_id unless folder_id.nil?
  command.params['childId'] = child_id unless child_id.nil?
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_comment(file_id, comment_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deletes a comment.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



663
664
665
666
667
668
669
670
671
# File 'generated/google/apis/drive_v2/service.rb', line 663

def delete_comment(file_id, comment_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}', options)
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['commentId'] = comment_id unless comment_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_drive(drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.

Parameters:

  • drive_id (String)

    The ID of the shared drive.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



899
900
901
902
903
904
905
906
# File 'generated/google/apis/drive_v2/service.rb', line 899

def delete_drive(drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'drives/{driveId}', options)
  command.params['driveId'] = drive_id unless drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_file(file_id, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for shared drive files.

Parameters:

  • file_id (String)

    The ID of the file to delete.

  • enforce_single_parent (Boolean) (defaults to: nil)

    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.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
# File 'generated/google/apis/drive_v2/service.rb', line 1239

def delete_file(file_id, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'files/{fileId}', options)
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_parent(file_id, parent_id, enforce_single_parent: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Removes a parent from a file.

Parameters:

  • file_id (String)

    The ID of the file.

  • parent_id (String)

    The ID of the parent.

  • enforce_single_parent (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
# File 'generated/google/apis/drive_v2/service.rb', line 2042

def delete_parent(file_id, parent_id, enforce_single_parent: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'files/{fileId}/parents/{parentId}', options)
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['parentId'] = parent_id unless parent_id.nil?
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_permission(file_id, permission_id, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deletes a permission from a file or shared drive.

Parameters:

  • file_id (String)

    The ID for the file or shared drive.

  • permission_id (String)

    The ID for the permission.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
# File 'generated/google/apis/drive_v2/service.rb', line 2201

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, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'files/{fileId}/permissions/{permissionId}', options)
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['permissionId'] = permission_id unless permission_id.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deletes a property.

Parameters:

  • file_id (String)

    The ID of the file.

  • property_key (String)

    The key of the property.

  • visibility (String) (defaults to: nil)

    The visibility of the property.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
# File 'generated/google/apis/drive_v2/service.rb', line 2559

def delete_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'files/{fileId}/properties/{propertyKey}', options)
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['propertyKey'] = property_key unless property_key.nil?
  command.query['visibility'] = visibility unless visibility.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_reply(file_id, comment_id, reply_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deletes a reply.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • reply_id (String)

    The ID of the reply.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
# File 'generated/google/apis/drive_v2/service.rb', line 2790

def delete_reply(file_id, comment_id, reply_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['commentId'] = comment_id unless comment_id.nil?
  command.params['replyId'] = reply_id unless reply_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_revision(file_id, revision_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Permanently deletes a file version. You can only delete revisions for files with binary content, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.

Parameters:

  • file_id (String)

    The ID of the file.

  • revision_id (String)

    The ID of the revision.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



3040
3041
3042
3043
3044
3045
3046
3047
3048
# File 'generated/google/apis/drive_v2/service.rb', line 3040

def delete_revision(file_id, revision_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'files/{fileId}/revisions/{revisionId}', options)
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['revisionId'] = revision_id unless revision_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_teamdrive(team_drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deprecated use drives.delete instead.

Parameters:

  • team_drive_id (String)

    The ID of the Team Drive

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



3226
3227
3228
3229
3230
3231
3232
3233
# File 'generated/google/apis/drive_v2/service.rb', line 3226

def delete_teamdrive(team_drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'teamdrives/{teamDriveId}', options)
  command.params['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#empty_trash(enforce_single_parent: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Permanently deletes all of the user's trashed files.

Parameters:

  • enforce_single_parent (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1274
1275
1276
1277
1278
1279
1280
1281
# File 'generated/google/apis/drive_v2/service.rb', line 1274

def empty_trash(enforce_single_parent: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'files/trash', options)
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#export_file(file_id, mime_type, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.

Parameters:

  • file_id (String)

    The ID of the file.

  • mime_type (String)

    The MIME type of the format requested for this export.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • download_dest (IO, String) (defaults to: nil)

    IO stream or filename to receive content download

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
# File 'generated/google/apis/drive_v2/service.rb', line 1310

def export_file(file_id, mime_type, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
  if download_dest.nil?
    command = make_simple_command(:get, 'files/{fileId}/export', options)
  else
    command = make_download_command(:get, 'files/{fileId}/export', options)
    command.download_dest = download_dest
  end
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['mimeType'] = mime_type unless mime_type.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#generate_file_ids(max_results: nil, space: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::GeneratedIds

Generates a set of file IDs which can be provided in insert or copy requests.

Parameters:

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of IDs to return.

  • space (String) (defaults to: nil)

    The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
# File 'generated/google/apis/drive_v2/service.rb', line 1350

def generate_file_ids(max_results: nil, space: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/generateIds', options)
  command.response_representation = Google::Apis::DriveV2::GeneratedIds::Representation
  command.response_class = Google::Apis::DriveV2::GeneratedIds
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['space'] = space unless space.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_about(include_subscribed: nil, max_change_id_count: nil, start_change_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::About

Gets the information about the current user along with Drive API settings

Parameters:

  • include_subscribed (Boolean) (defaults to: nil)

    Whether to count changes outside the My Drive hierarchy. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive will be omitted from the maxChangeIdCount.

  • max_change_id_count (Fixnum) (defaults to: nil)

    Maximum number of remaining change IDs to count

  • start_change_id (Fixnum) (defaults to: nil)

    Change ID to start counting from when calculating number of remaining change IDs

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



85
86
87
88
89
90
91
92
93
94
95
96
# File 'generated/google/apis/drive_v2/service.rb', line 85

def get_about(include_subscribed: nil, max_change_id_count: nil, start_change_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'about', options)
  command.response_representation = Google::Apis::DriveV2::About::Representation
  command.response_class = Google::Apis::DriveV2::About
  command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil?
  command.query['maxChangeIdCount'] = max_change_id_count unless max_change_id_count.nil?
  command.query['startChangeId'] = start_change_id unless start_change_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_app(app_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::App

Gets a specific app.

Parameters:

  • app_id (String)

    The ID of the app.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



120
121
122
123
124
125
126
127
128
129
# File 'generated/google/apis/drive_v2/service.rb', line 120

def get_app(app_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'apps/{appId}', options)
  command.response_representation = Google::Apis::DriveV2::App::Representation
  command.response_class = Google::Apis::DriveV2::App
  command.params['appId'] = app_id unless app_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_change(change_id, drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Change

Deprecated - Use changes.getStartPageToken and changes.list to retrieve recent changes.

Parameters:

  • change_id (String)

    The ID of the change.

  • drive_id (String) (defaults to: nil)

    The shared drive from which the change is returned.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • team_drive_id (String) (defaults to: nil)

    Deprecated use driveId instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'generated/google/apis/drive_v2/service.rb', line 208

def get_change(change_id, drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'changes/{changeId}', options)
  command.response_representation = Google::Apis::DriveV2::Change::Representation
  command.response_class = Google::Apis::DriveV2::Change
  command.params['changeId'] = change_id unless change_id.nil?
  command.query['driveId'] = drive_id unless drive_id.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_change_start_page_token(drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::StartPageToken

Gets the starting pageToken for listing future changes.

Parameters:

  • drive_id (String) (defaults to: nil)

    The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • team_drive_id (String) (defaults to: nil)

    Deprecated use driveId instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'generated/google/apis/drive_v2/service.rb', line 252

def get_change_start_page_token(drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'changes/startPageToken', options)
  command.response_representation = Google::Apis::DriveV2::StartPageToken::Representation
  command.response_class = Google::Apis::DriveV2::StartPageToken
  command.query['driveId'] = drive_id unless drive_id.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_child(folder_id, child_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChildReference

Gets a specific child reference.

Parameters:

  • folder_id (String)

    The ID of the folder.

  • child_id (String)

    The ID of the child.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



530
531
532
533
534
535
536
537
538
539
540
# File 'generated/google/apis/drive_v2/service.rb', line 530

def get_child(folder_id, child_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{folderId}/children/{childId}', options)
  command.response_representation = Google::Apis::DriveV2::ChildReference::Representation
  command.response_class = Google::Apis::DriveV2::ChildReference
  command.params['folderId'] = folder_id unless folder_id.nil?
  command.params['childId'] = child_id unless child_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_comment(file_id, comment_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment

Gets a comment by ID.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • include_deleted (Boolean) (defaults to: nil)

    If set, this will succeed when retrieving a deleted comment, and will include any deleted replies.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



700
701
702
703
704
705
706
707
708
709
710
711
# File 'generated/google/apis/drive_v2/service.rb', line 700

def get_comment(file_id, comment_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}', options)
  command.response_representation = Google::Apis::DriveV2::Comment::Representation
  command.response_class = Google::Apis::DriveV2::Comment
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['commentId'] = comment_id unless comment_id.nil?
  command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_drive(drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive

Gets a shared drive's metadata by ID.

Parameters:

  • drive_id (String)

    The ID of the shared drive.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



934
935
936
937
938
939
940
941
942
943
944
# File 'generated/google/apis/drive_v2/service.rb', line 934

def get_drive(drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'drives/{driveId}', options)
  command.response_representation = Google::Apis::DriveV2::Drive::Representation
  command.response_class = Google::Apis::DriveV2::Drive
  command.params['driveId'] = drive_id unless drive_id.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_file(file_id, acknowledge_abuse: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File

Gets a file's metadata by ID.

Parameters:

  • file_id (String)

    The ID for the file in question.

  • acknowledge_abuse (Boolean) (defaults to: nil)

    Whether the user is acknowledging the risk of downloading known malware or other abusive files.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • projection (String) (defaults to: nil)

    This parameter is deprecated and has no function.

  • revision_id (String) (defaults to: nil)

    Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • update_viewed_date (Boolean) (defaults to: nil)

    Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • download_dest (IO, String) (defaults to: nil)

    IO stream or filename to receive content download

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
# File 'generated/google/apis/drive_v2/service.rb', line 1404

def get_file(file_id, acknowledge_abuse: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
  if download_dest.nil?
    command = make_simple_command(:get, 'files/{fileId}', options)
  else
    command = make_download_command(:get, 'files/{fileId}', options)
    command.download_dest = download_dest
  end
  command.response_representation = Google::Apis::DriveV2::File::Representation
  command.response_class = Google::Apis::DriveV2::File
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['revisionId'] = revision_id unless revision_id.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_parent(file_id, parent_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ParentReference

Gets a specific parent reference.

Parameters:

  • file_id (String)

    The ID of the file.

  • parent_id (String)

    The ID of the parent.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
# File 'generated/google/apis/drive_v2/service.rb', line 2077

def get_parent(file_id, parent_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/parents/{parentId}', options)
  command.response_representation = Google::Apis::DriveV2::ParentReference::Representation
  command.response_class = Google::Apis::DriveV2::ParentReference
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['parentId'] = parent_id unless parent_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_permission(file_id, permission_id, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission

Gets a permission by ID.

Parameters:

  • file_id (String)

    The ID for the file or shared drive.

  • permission_id (String)

    The ID for the permission.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
# File 'generated/google/apis/drive_v2/service.rb', line 2247

def get_permission(file_id, permission_id, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/permissions/{permissionId}', options)
  command.response_representation = Google::Apis::DriveV2::Permission::Representation
  command.response_class = Google::Apis::DriveV2::Permission
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['permissionId'] = permission_id unless permission_id.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_permission_id_for_email(email, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::PermissionId

Returns the permission ID for an email address.

Parameters:

  • email (String)

    The email address for which to return a permission ID

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
# File 'generated/google/apis/drive_v2/service.rb', line 2284

def get_permission_id_for_email(email, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'permissionIds/{email}', options)
  command.response_representation = Google::Apis::DriveV2::PermissionId::Representation
  command.response_class = Google::Apis::DriveV2::PermissionId
  command.params['email'] = email unless email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property

Gets a property by its key.

Parameters:

  • file_id (String)

    The ID of the file.

  • property_key (String)

    The key of the property.

  • visibility (String) (defaults to: nil)

    The visibility of the property.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
# File 'generated/google/apis/drive_v2/service.rb', line 2596

def get_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/properties/{propertyKey}', options)
  command.response_representation = Google::Apis::DriveV2::Property::Representation
  command.response_class = Google::Apis::DriveV2::Property
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['propertyKey'] = property_key unless property_key.nil?
  command.query['visibility'] = visibility unless visibility.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_reply(file_id, comment_id, reply_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply

Gets a reply.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • reply_id (String)

    The ID of the reply.

  • include_deleted (Boolean) (defaults to: nil)

    If set, this will succeed when retrieving a deleted reply.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
# File 'generated/google/apis/drive_v2/service.rb', line 2829

def get_reply(file_id, comment_id, reply_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
  command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
  command.response_class = Google::Apis::DriveV2::CommentReply
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['commentId'] = comment_id unless comment_id.nil?
  command.params['replyId'] = reply_id unless reply_id.nil?
  command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_revision(file_id, revision_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Revision

Gets a specific revision.

Parameters:

  • file_id (String)

    The ID of the file.

  • revision_id (String)

    The ID of the revision.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
# File 'generated/google/apis/drive_v2/service.rb', line 3074

def get_revision(file_id, revision_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/revisions/{revisionId}', options)
  command.response_representation = Google::Apis::DriveV2::Revision::Representation
  command.response_class = Google::Apis::DriveV2::Revision
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['revisionId'] = revision_id unless revision_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_teamdrive(team_drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDrive

Deprecated use drives.get instead.

Parameters:

  • team_drive_id (String)

    The ID of the Team Drive

  • use_domain_admin_access (Boolean) (defaults to: nil)

    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 Team Drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
# File 'generated/google/apis/drive_v2/service.rb', line 3261

def get_teamdrive(team_drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'teamdrives/{teamDriveId}', options)
  command.response_representation = Google::Apis::DriveV2::TeamDrive::Representation
  command.response_class = Google::Apis::DriveV2::TeamDrive
  command.params['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#hide_drive(drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive

Hides a shared drive from the default view.

Parameters:

  • drive_id (String)

    The ID of the shared drive.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



968
969
970
971
972
973
974
975
976
977
# File 'generated/google/apis/drive_v2/service.rb', line 968

def hide_drive(drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'drives/{driveId}/hide', options)
  command.response_representation = Google::Apis::DriveV2::Drive::Representation
  command.response_class = Google::Apis::DriveV2::Drive
  command.params['driveId'] = drive_id unless drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_child(folder_id, child_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChildReference

Inserts a file into a folder.

Parameters:

  • folder_id (String)

    The ID of the folder.

  • child_reference_object (Google::Apis::DriveV2::ChildReference) (defaults to: nil)
  • enforce_single_parent (Boolean) (defaults to: nil)

    Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# File 'generated/google/apis/drive_v2/service.rb', line 572

def insert_child(folder_id, child_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{folderId}/children', options)
  command.request_representation = Google::Apis::DriveV2::ChildReference::Representation
  command.request_object = child_reference_object
  command.response_representation = Google::Apis::DriveV2::ChildReference::Representation
  command.response_class = Google::Apis::DriveV2::ChildReference
  command.params['folderId'] = folder_id unless folder_id.nil?
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_comment(file_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment

Creates a new comment on the given file.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_object (Google::Apis::DriveV2::Comment) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



736
737
738
739
740
741
742
743
744
745
746
747
# File 'generated/google/apis/drive_v2/service.rb', line 736

def insert_comment(file_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/comments', options)
  command.request_representation = Google::Apis::DriveV2::Comment::Representation
  command.request_object = comment_object
  command.response_representation = Google::Apis::DriveV2::Comment::Representation
  command.response_class = Google::Apis::DriveV2::Comment
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_drive(request_id, drive_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive

Creates a new shared drive.

Parameters:

  • request_id (String)

    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.

  • drive_object (Google::Apis::DriveV2::Drive) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
# File 'generated/google/apis/drive_v2/service.rb', line 1006

def insert_drive(request_id, drive_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'drives', options)
  command.request_representation = Google::Apis::DriveV2::Drive::Representation
  command.request_object = drive_object
  command.response_representation = Google::Apis::DriveV2::Drive::Representation
  command.response_class = Google::Apis::DriveV2::Drive
  command.query['requestId'] = request_id unless request_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_file(file_object = nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, use_content_as_indexable_text: nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File

Insert a new file.

Parameters:

  • file_object (Google::Apis::DriveV2::File) (defaults to: nil)
  • convert (Boolean) (defaults to: nil)

    Whether to convert this file to the corresponding Docs Editors format.

  • enforce_single_parent (Boolean) (defaults to: nil)

    Deprecated. Creating files in multiple folders is no longer supported.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • ocr (Boolean) (defaults to: nil)

    Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.

  • ocr_language (String) (defaults to: nil)

    If ocr is true, hints at the language to use. Valid values are BCP 47 codes.

  • pinned (Boolean) (defaults to: nil)

    Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • timed_text_language (String) (defaults to: nil)

    The language of the timed text.

  • timed_text_track_name (String) (defaults to: nil)

    The timed text track name.

  • use_content_as_indexable_text (Boolean) (defaults to: nil)

    Whether to use the content as indexable text.

  • visibility (String) (defaults to: nil)

    The visibility of the new file. This parameter is only relevant when convert= false.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
# File 'generated/google/apis/drive_v2/service.rb', line 1479

def insert_file(file_object = nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, use_content_as_indexable_text: nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command = make_simple_command(:post, 'files', options)
  else
    command = make_upload_command(:post, 'files', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::DriveV2::File::Representation
  command.request_object = file_object
  command.response_representation = Google::Apis::DriveV2::File::Representation
  command.response_class = Google::Apis::DriveV2::File
  command.query['convert'] = convert unless convert.nil?
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['ocr'] = ocr unless ocr.nil?
  command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
  command.query['pinned'] = pinned unless pinned.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
  command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
  command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
  command.query['visibility'] = visibility unless visibility.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_parent(file_id, parent_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ParentReference

Adds a parent folder for a file.

Parameters:

  • file_id (String)

    The ID of the file.

  • parent_reference_object (Google::Apis::DriveV2::ParentReference) (defaults to: nil)
  • enforce_single_parent (Boolean) (defaults to: nil)

    Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
# File 'generated/google/apis/drive_v2/service.rb', line 2119

def insert_parent(file_id, parent_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/parents', options)
  command.request_representation = Google::Apis::DriveV2::ParentReference::Representation
  command.request_object = parent_reference_object
  command.response_representation = Google::Apis::DriveV2::ParentReference::Representation
  command.response_class = Google::Apis::DriveV2::ParentReference
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_permission(file_id, permission_object = nil, email_message: nil, enforce_single_parent: nil, move_to_new_owners_root: nil, send_notification_emails: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission

Inserts a permission for a file or shared drive.

Parameters:

  • file_id (String)

    The ID for the file or shared drive.

  • permission_object (Google::Apis::DriveV2::Permission) (defaults to: nil)
  • email_message (String) (defaults to: nil)

    A plain text custom message to include in notification emails.

  • enforce_single_parent (Boolean) (defaults to: nil)

    Deprecated. See moveToNewOwnersRoot for details.

  • move_to_new_owners_root (Boolean) (defaults to: nil)

    This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. If set to true, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to false, parents are not changed.

  • send_notification_emails (Boolean) (defaults to: nil)

    Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
# File 'generated/google/apis/drive_v2/service.rb', line 2339

def insert_permission(file_id, permission_object = nil, email_message: nil, enforce_single_parent: nil, move_to_new_owners_root: nil, send_notification_emails: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/permissions', options)
  command.request_representation = Google::Apis::DriveV2::Permission::Representation
  command.request_object = permission_object
  command.response_representation = Google::Apis::DriveV2::Permission::Representation
  command.response_class = Google::Apis::DriveV2::Permission
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['emailMessage'] = email_message unless email_message.nil?
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['moveToNewOwnersRoot'] = move_to_new_owners_root unless move_to_new_owners_root.nil?
  command.query['sendNotificationEmails'] = send_notification_emails unless send_notification_emails.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_property(file_id, property_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property

Adds a property to a file, or updates it if it already exists.

Parameters:

  • file_id (String)

    The ID of the file.

  • property_object (Google::Apis::DriveV2::Property) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
# File 'generated/google/apis/drive_v2/service.rb', line 2632

def insert_property(file_id, property_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/properties', options)
  command.request_representation = Google::Apis::DriveV2::Property::Representation
  command.request_object = property_object
  command.response_representation = Google::Apis::DriveV2::Property::Representation
  command.response_class = Google::Apis::DriveV2::Property
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_reply(file_id, comment_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply

Creates a new reply to the given comment.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • comment_reply_object (Google::Apis::DriveV2::CommentReply) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
# File 'generated/google/apis/drive_v2/service.rb', line 2868

def insert_reply(file_id, comment_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/comments/{commentId}/replies', options)
  command.request_representation = Google::Apis::DriveV2::CommentReply::Representation
  command.request_object = comment_reply_object
  command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
  command.response_class = Google::Apis::DriveV2::CommentReply
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['commentId'] = comment_id unless comment_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_teamdrive(request_id, team_drive_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDrive

Deprecated use drives.insert instead.

Parameters:

  • request_id (String)

    An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned.

  • team_drive_object (Google::Apis::DriveV2::TeamDrive) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
# File 'generated/google/apis/drive_v2/service.rb', line 3300

def insert_teamdrive(request_id, team_drive_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'teamdrives', options)
  command.request_representation = Google::Apis::DriveV2::TeamDrive::Representation
  command.request_object = team_drive_object
  command.response_representation = Google::Apis::DriveV2::TeamDrive::Representation
  command.response_class = Google::Apis::DriveV2::TeamDrive
  command.query['requestId'] = request_id unless request_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_apps(app_filter_extensions: nil, app_filter_mime_types: nil, language_code: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::AppList

Lists a user's installed apps.

Parameters:

  • app_filter_extensions (String) (defaults to: nil)

    A comma-separated list of file extensions for open with filtering. All apps within the given app query scope which can open any of the given file extensions will be included in the response. If appFilterMimeTypes are provided as well, the result is a union of the two resulting app lists.

  • app_filter_mime_types (String) (defaults to: nil)

    A comma-separated list of MIME types for open with filtering. All apps within the given app query scope which can open any of the given MIME types will be included in the response. If appFilterExtensions are provided as well, the result is a union of the two resulting app lists.

  • language_code (String) (defaults to: nil)

    A language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/).

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



164
165
166
167
168
169
170
171
172
173
174
175
# File 'generated/google/apis/drive_v2/service.rb', line 164

def list_apps(app_filter_extensions: nil, app_filter_mime_types: nil, language_code: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'apps', options)
  command.response_representation = Google::Apis::DriveV2::AppList::Representation
  command.response_class = Google::Apis::DriveV2::AppList
  command.query['appFilterExtensions'] = app_filter_extensions unless app_filter_extensions.nil?
  command.query['appFilterMimeTypes'] = app_filter_mime_types unless app_filter_mime_types.nil?
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_changes(drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChangeList

Lists the changes for a user or shared drive.

Parameters:

  • drive_id (String) (defaults to: nil)

    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.

  • include_corpus_removals (Boolean) (defaults to: nil)

    Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file.

  • include_deleted (Boolean) (defaults to: nil)

    Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.

  • include_items_from_all_drives (Boolean) (defaults to: nil)

    Whether both My Drive and shared drive items should be included in results.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • include_subscribed (Boolean) (defaults to: nil)

    Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive are omitted from the result.

  • include_team_drive_items (Boolean) (defaults to: nil)

    Deprecated use includeItemsFromAllDrives instead.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of changes to return.

  • page_token (String) (defaults to: nil)

    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.

  • spaces (String) (defaults to: nil)

    A comma-separated list of spaces to query. Supported values are 'drive', ' appDataFolder' and 'photos'.

  • start_change_id (Fixnum) (defaults to: nil)

    Deprecated - use pageToken instead.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • team_drive_id (String) (defaults to: nil)

    Deprecated use driveId instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'generated/google/apis/drive_v2/service.rb', line 326

def list_changes(drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'changes', options)
  command.response_representation = Google::Apis::DriveV2::ChangeList::Representation
  command.response_class = Google::Apis::DriveV2::ChangeList
  command.query['driveId'] = drive_id unless drive_id.nil?
  command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil?
  command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
  command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil?
  command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['spaces'] = spaces unless spaces.nil?
  command.query['startChangeId'] = start_change_id unless start_change_id.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_children(folder_id, max_results: nil, order_by: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChildList

Lists a folder's children.

Parameters:

  • folder_id (String)

    The ID of the folder.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of children to return.

  • order_by (String) (defaults to: nil)

    A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', ' lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', ' recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ? orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.

  • page_token (String) (defaults to: nil)

    Page token for children.

  • q (String) (defaults to: nil)

    Query string for searching children.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



624
625
626
627
628
629
630
631
632
633
634
635
636
637
# File 'generated/google/apis/drive_v2/service.rb', line 624

def list_children(folder_id, max_results: nil, order_by: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{folderId}/children', options)
  command.response_representation = Google::Apis::DriveV2::ChildList::Representation
  command.response_class = Google::Apis::DriveV2::ChildList
  command.params['folderId'] = folder_id unless folder_id.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['q'] = q unless q.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_comments(file_id, include_deleted: nil, max_results: nil, page_token: nil, updated_min: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentList

Lists a file's comments.

Parameters:

  • file_id (String)

    The ID of the file.

  • include_deleted (Boolean) (defaults to: nil)

    If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned.

  • max_results (Fixnum) (defaults to: nil)

    The maximum number of discussions to include in the response, used for paging.

  • page_token (String) (defaults to: nil)

    The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.

  • updated_min (String) (defaults to: nil)

    Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



783
784
785
786
787
788
789
790
791
792
793
794
795
796
# File 'generated/google/apis/drive_v2/service.rb', line 783

def list_comments(file_id, include_deleted: nil, max_results: nil, page_token: nil, updated_min: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/comments', options)
  command.response_representation = Google::Apis::DriveV2::CommentList::Representation
  command.response_class = Google::Apis::DriveV2::CommentList
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['updatedMin'] = updated_min unless updated_min.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_drives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::DriveList

Lists the user's shared drives.

Parameters:

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of shared drives to return.

  • page_token (String) (defaults to: nil)

    Page token for shared drives.

  • q (String) (defaults to: nil)

    Query string for searching shared drives.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then all shared drives of the domain in which the requester is an administrator are returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
# File 'generated/google/apis/drive_v2/service.rb', line 1048

def list_drives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'drives', options)
  command.response_representation = Google::Apis::DriveV2::DriveList::Representation
  command.response_class = Google::Apis::DriveV2::DriveList
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['q'] = q unless q.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_files(corpora: nil, corpus: nil, drive_id: nil, include_items_from_all_drives: nil, include_permissions_for_view: nil, include_team_drive_items: nil, max_results: nil, order_by: nil, page_token: nil, projection: nil, q: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::FileList

Lists the user's files.

Parameters:

  • corpora (String) (defaults to: nil)

    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.

  • corpus (String) (defaults to: nil)

    The body of items (files/documents) to which the query applies. Deprecated: use 'corpora' instead.

  • drive_id (String) (defaults to: nil)

    ID of the shared drive to search.

  • include_items_from_all_drives (Boolean) (defaults to: nil)

    Whether both My Drive and shared drive items should be included in results.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • include_team_drive_items (Boolean) (defaults to: nil)

    Deprecated use includeItemsFromAllDrives instead.

  • max_results (Fixnum) (defaults to: nil)

    The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached.

  • order_by (String) (defaults to: nil)

    A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', ' lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', ' recency', 'sharedWithMeDate', 'starred', 'title', and 'title_natural'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.

  • page_token (String) (defaults to: nil)

    Page token for files.

  • projection (String) (defaults to: nil)

    This parameter is deprecated and has no function.

  • q (String) (defaults to: nil)

    Query string for searching files.

  • spaces (String) (defaults to: nil)

    A comma-separated list of spaces to query. Supported values are 'drive', ' appDataFolder' and 'photos'.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • team_drive_id (String) (defaults to: nil)

    Deprecated use driveId instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
# File 'generated/google/apis/drive_v2/service.rb', line 1574

def list_files(corpora: nil, corpus: nil, drive_id: nil, include_items_from_all_drives: nil, include_permissions_for_view: nil, include_team_drive_items: nil, max_results: nil, order_by: nil, page_token: nil, projection: nil, q: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files', options)
  command.response_representation = Google::Apis::DriveV2::FileList::Representation
  command.response_class = Google::Apis::DriveV2::FileList
  command.query['corpora'] = corpora unless corpora.nil?
  command.query['corpus'] = corpus unless corpus.nil?
  command.query['driveId'] = drive_id unless drive_id.nil?
  command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['q'] = q unless q.nil?
  command.query['spaces'] = spaces unless spaces.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_parents(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ParentList

Lists a file's parents.

Parameters:

  • file_id (String)

    The ID of the file.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
# File 'generated/google/apis/drive_v2/service.rb', line 2157

def list_parents(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/parents', options)
  command.response_representation = Google::Apis::DriveV2::ParentList::Representation
  command.response_class = Google::Apis::DriveV2::ParentList
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_permissions(file_id, include_permissions_for_view: nil, max_results: nil, page_token: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::PermissionList

Lists a file's or shared drive's permissions.

Parameters:

  • file_id (String)

    The ID for the file or shared drive.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • max_results (Fixnum) (defaults to: nil)

    The maximum number of permissions to return per page. When not set for files in a shared drive, at most 100 results will be returned. When not set for files that are not in a shared drive, the entire list will be returned.

  • page_token (String) (defaults to: nil)

    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.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
# File 'generated/google/apis/drive_v2/service.rb', line 2400

def list_permissions(file_id, include_permissions_for_view: nil, max_results: nil, page_token: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/permissions', options)
  command.response_representation = Google::Apis::DriveV2::PermissionList::Representation
  command.response_class = Google::Apis::DriveV2::PermissionList
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_properties(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::PropertyList

Lists a file's properties.

Parameters:

  • file_id (String)

    The ID of the file.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
# File 'generated/google/apis/drive_v2/service.rb', line 2667

def list_properties(file_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/properties', options)
  command.response_representation = Google::Apis::DriveV2::PropertyList::Representation
  command.response_class = Google::Apis::DriveV2::PropertyList
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_replies(file_id, comment_id, include_deleted: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReplyList

Lists all of the replies to a comment.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • include_deleted (Boolean) (defaults to: nil)

    If set, all replies, including deleted replies (with content stripped) will be returned.

  • max_results (Fixnum) (defaults to: nil)

    The maximum number of replies to include in the response, used for paging.

  • page_token (String) (defaults to: nil)

    The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
# File 'generated/google/apis/drive_v2/service.rb', line 2915

def list_replies(file_id, comment_id, include_deleted: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}/replies', options)
  command.response_representation = Google::Apis::DriveV2::CommentReplyList::Representation
  command.response_class = Google::Apis::DriveV2::CommentReplyList
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['commentId'] = comment_id unless comment_id.nil?
  command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_revisions(file_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::RevisionList

Lists a file's revisions.

Parameters:

  • file_id (String)

    The ID of the file.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of revisions to return.

  • page_token (String) (defaults to: nil)

    Page token for revisions. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
# File 'generated/google/apis/drive_v2/service.rb', line 3113

def list_revisions(file_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files/{fileId}/revisions', options)
  command.response_representation = Google::Apis::DriveV2::RevisionList::Representation
  command.response_class = Google::Apis::DriveV2::RevisionList
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_teamdrives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDriveList

Deprecated use drives.list instead.

Parameters:

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of Team Drives to return.

  • page_token (String) (defaults to: nil)

    Page token for Team Drives.

  • q (String) (defaults to: nil)

    Query string for searching Team Drives.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
# File 'generated/google/apis/drive_v2/service.rb', line 3342

def list_teamdrives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'teamdrives', options)
  command.response_representation = Google::Apis::DriveV2::TeamDriveList::Representation
  command.response_class = Google::Apis::DriveV2::TeamDriveList
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['q'] = q unless q.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#patch_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment

Updates an existing comment.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • comment_object (Google::Apis::DriveV2::Comment) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



823
824
825
826
827
828
829
830
831
832
833
834
835
# File 'generated/google/apis/drive_v2/service.rb', line 823

def patch_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}', options)
  command.request_representation = Google::Apis::DriveV2::Comment::Representation
  command.request_object = comment_object
  command.response_representation = Google::Apis::DriveV2::Comment::Representation
  command.response_class = Google::Apis::DriveV2::Comment
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['commentId'] = comment_id unless comment_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#patch_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File

Updates file metadata and/or content. This method supports patch semantics.

Parameters:

  • file_id (String)

    The ID of the file to update.

  • file_object (Google::Apis::DriveV2::File) (defaults to: nil)
  • add_parents (String) (defaults to: nil)

    Comma-separated list of parent IDs to add.

  • convert (Boolean) (defaults to: nil)

    This parameter is deprecated and has no function.

  • enforce_single_parent (Boolean) (defaults to: nil)

    Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • modified_date_behavior (String) (defaults to: nil)

    Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.

  • new_revision (Boolean) (defaults to: nil)

    Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center. Note that this field is ignored if there is no payload in the request.

  • ocr (Boolean) (defaults to: nil)

    Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.

  • ocr_language (String) (defaults to: nil)

    If ocr is true, hints at the language to use. Valid values are BCP 47 codes.

  • pinned (Boolean) (defaults to: nil)

    Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. Note that this field is ignored if there is no payload in the request.

  • remove_parents (String) (defaults to: nil)

    Comma-separated list of parent IDs to remove.

  • set_modified_date (Boolean) (defaults to: nil)

    Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • timed_text_language (String) (defaults to: nil)

    The language of the timed text.

  • timed_text_track_name (String) (defaults to: nil)

    The timed text track name.

  • update_viewed_date (Boolean) (defaults to: nil)

    Whether to update the view date after successfully updating the file.

  • use_content_as_indexable_text (Boolean) (defaults to: nil)

    Whether to use the content as indexable text.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
# File 'generated/google/apis/drive_v2/service.rb', line 1670

def patch_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:patch, 'files/{fileId}', options)
  command.request_representation = Google::Apis::DriveV2::File::Representation
  command.request_object = file_object
  command.response_representation = Google::Apis::DriveV2::File::Representation
  command.response_class = Google::Apis::DriveV2::File
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['addParents'] = add_parents unless add_parents.nil?
  command.query['convert'] = convert unless convert.nil?
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['modifiedDateBehavior'] = modified_date_behavior unless modified_date_behavior.nil?
  command.query['newRevision'] = new_revision unless new_revision.nil?
  command.query['ocr'] = ocr unless ocr.nil?
  command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
  command.query['pinned'] = pinned unless pinned.nil?
  command.query['removeParents'] = remove_parents unless remove_parents.nil?
  command.query['setModifiedDate'] = set_modified_date unless set_modified_date.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
  command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
  command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
  command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#patch_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, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission

Updates a permission using patch semantics.

Parameters:

  • file_id (String)

    The ID for the file or shared drive.

  • permission_id (String)

    The ID for the permission.

  • permission_object (Google::Apis::DriveV2::Permission) (defaults to: nil)
  • remove_expiration (Boolean) (defaults to: nil)

    Whether to remove the expiration date.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • transfer_ownership (Boolean) (defaults to: nil)

    Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
# File 'generated/google/apis/drive_v2/service.rb', line 2456

def patch_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, user_ip: nil, options: nil, &block)
  command = make_simple_command(:patch, 'files/{fileId}/permissions/{permissionId}', options)
  command.request_representation = Google::Apis::DriveV2::Permission::Representation
  command.request_object = permission_object
  command.response_representation = Google::Apis::DriveV2::Permission::Representation
  command.response_class = Google::Apis::DriveV2::Permission
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['permissionId'] = permission_id unless permission_id.nil?
  command.query['removeExpiration'] = remove_expiration unless remove_expiration.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['transferOwnership'] = transfer_ownership unless transfer_ownership.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#patch_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property

Updates a property.

Parameters:

  • file_id (String)

    The ID of the file.

  • property_key (String)

    The key of the property.

  • property_object (Google::Apis::DriveV2::Property) (defaults to: nil)
  • visibility (String) (defaults to: nil)

    The visibility of the property. Allowed values are PRIVATE and PUBLIC. ( Default: PRIVATE)

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
# File 'generated/google/apis/drive_v2/service.rb', line 2706

def patch_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:patch, 'files/{fileId}/properties/{propertyKey}', options)
  command.request_representation = Google::Apis::DriveV2::Property::Representation
  command.request_object = property_object
  command.response_representation = Google::Apis::DriveV2::Property::Representation
  command.response_class = Google::Apis::DriveV2::Property
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['propertyKey'] = property_key unless property_key.nil?
  command.query['visibility'] = visibility unless visibility.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#patch_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply

Updates an existing reply.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • reply_id (String)

    The ID of the reply.

  • comment_reply_object (Google::Apis::DriveV2::CommentReply) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
# File 'generated/google/apis/drive_v2/service.rb', line 2957

def patch_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
  command.request_representation = Google::Apis::DriveV2::CommentReply::Representation
  command.request_object = comment_reply_object
  command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
  command.response_class = Google::Apis::DriveV2::CommentReply
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['commentId'] = comment_id unless comment_id.nil?
  command.params['replyId'] = reply_id unless reply_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#patch_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Revision

Updates a revision.

Parameters:

  • file_id (String)

    The ID for the file.

  • revision_id (String)

    The ID for the revision.

  • revision_object (Google::Apis::DriveV2::Revision) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
# File 'generated/google/apis/drive_v2/service.rb', line 3151

def patch_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:patch, 'files/{fileId}/revisions/{revisionId}', options)
  command.request_representation = Google::Apis::DriveV2::Revision::Representation
  command.request_object = revision_object
  command.response_representation = Google::Apis::DriveV2::Revision::Representation
  command.response_class = Google::Apis::DriveV2::Revision
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['revisionId'] = revision_id unless revision_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#stop_channel(channel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Stop watching resources through this channel

Parameters:

  • channel_object (Google::Apis::DriveV2::Channel) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



458
459
460
461
462
463
464
465
466
# File 'generated/google/apis/drive_v2/service.rb', line 458

def stop_channel(channel_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'channels/stop', options)
  command.request_representation = Google::Apis::DriveV2::Channel::Representation
  command.request_object = channel_object
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#touch_file(file_id, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File

Set the file's updated time to the current server time.

Parameters:

  • file_id (String)

    The ID of the file to update.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
# File 'generated/google/apis/drive_v2/service.rb', line 1729

def touch_file(file_id, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/touch', options)
  command.response_representation = Google::Apis::DriveV2::File::Representation
  command.response_class = Google::Apis::DriveV2::File
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#trash_file(file_id, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File

Moves a file to the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file.

Parameters:

  • file_id (String)

    The ID of the file to trash.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
# File 'generated/google/apis/drive_v2/service.rb', line 1777

def trash_file(file_id, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/trash', options)
  command.response_representation = Google::Apis::DriveV2::File::Representation
  command.response_class = Google::Apis::DriveV2::File
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#unhide_drive(drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive

Restores a shared drive to the default view.

Parameters:

  • drive_id (String)

    The ID of the shared drive.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
# File 'generated/google/apis/drive_v2/service.rb', line 1084

def unhide_drive(drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'drives/{driveId}/unhide', options)
  command.response_representation = Google::Apis::DriveV2::Drive::Representation
  command.response_class = Google::Apis::DriveV2::Drive
  command.params['driveId'] = drive_id unless drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#untrash_file(file_id, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File

Restores a file from the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may untrash a file.

Parameters:

  • file_id (String)

    The ID of the file to untrash.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
# File 'generated/google/apis/drive_v2/service.rb', line 1822

def untrash_file(file_id, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/untrash', options)
  command.response_representation = Google::Apis::DriveV2::File::Representation
  command.response_class = Google::Apis::DriveV2::File
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment

Updates an existing comment.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • comment_object (Google::Apis::DriveV2::Comment) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



862
863
864
865
866
867
868
869
870
871
872
873
874
# File 'generated/google/apis/drive_v2/service.rb', line 862

def update_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:put, 'files/{fileId}/comments/{commentId}', options)
  command.request_representation = Google::Apis::DriveV2::Comment::Representation
  command.request_object = comment_object
  command.response_representation = Google::Apis::DriveV2::Comment::Representation
  command.response_class = Google::Apis::DriveV2::Comment
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['commentId'] = comment_id unless comment_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_drive(drive_id, drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive

Updates the metadata for a shared drive.

Parameters:

  • drive_id (String)

    The ID of the shared drive.

  • drive_object (Google::Apis::DriveV2::Drive) (defaults to: nil)
  • use_domain_admin_access (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'generated/google/apis/drive_v2/service.rb', line 1122

def update_drive(drive_id, drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:put, 'drives/{driveId}', options)
  command.request_representation = Google::Apis::DriveV2::Drive::Representation
  command.request_object = drive_object
  command.response_representation = Google::Apis::DriveV2::Drive::Representation
  command.response_class = Google::Apis::DriveV2::Drive
  command.params['driveId'] = drive_id unless drive_id.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File

Updates file metadata and/or content.

Parameters:

  • file_id (String)

    The ID of the file to update.

  • file_object (Google::Apis::DriveV2::File) (defaults to: nil)
  • add_parents (String) (defaults to: nil)

    Comma-separated list of parent IDs to add.

  • convert (Boolean) (defaults to: nil)

    This parameter is deprecated and has no function.

  • enforce_single_parent (Boolean) (defaults to: nil)

    Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • modified_date_behavior (String) (defaults to: nil)

    Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.

  • new_revision (Boolean) (defaults to: nil)

    Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center. Note that this field is ignored if there is no payload in the request.

  • ocr (Boolean) (defaults to: nil)

    Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.

  • ocr_language (String) (defaults to: nil)

    If ocr is true, hints at the language to use. Valid values are BCP 47 codes.

  • pinned (Boolean) (defaults to: nil)

    Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. Note that this field is ignored if there is no payload in the request.

  • remove_parents (String) (defaults to: nil)

    Comma-separated list of parent IDs to remove.

  • set_modified_date (Boolean) (defaults to: nil)

    Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • timed_text_language (String) (defaults to: nil)

    The language of the timed text.

  • timed_text_track_name (String) (defaults to: nil)

    The timed text track name.

  • update_viewed_date (Boolean) (defaults to: nil)

    Whether to update the view date after successfully updating the file.

  • use_content_as_indexable_text (Boolean) (defaults to: nil)

    Whether to use the content as indexable text.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
# File 'generated/google/apis/drive_v2/service.rb', line 1911

def update_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command = make_simple_command(:put, 'files/{fileId}', options)
  else
    command = make_upload_command(:put, 'files/{fileId}', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::DriveV2::File::Representation
  command.request_object = file_object
  command.response_representation = Google::Apis::DriveV2::File::Representation
  command.response_class = Google::Apis::DriveV2::File
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['addParents'] = add_parents unless add_parents.nil?
  command.query['convert'] = convert unless convert.nil?
  command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['modifiedDateBehavior'] = modified_date_behavior unless modified_date_behavior.nil?
  command.query['newRevision'] = new_revision unless new_revision.nil?
  command.query['ocr'] = ocr unless ocr.nil?
  command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
  command.query['pinned'] = pinned unless pinned.nil?
  command.query['removeParents'] = remove_parents unless remove_parents.nil?
  command.query['setModifiedDate'] = set_modified_date unless set_modified_date.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil?
  command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil?
  command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
  command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission

Updates a permission.

Parameters:

  • file_id (String)

    The ID for the file or shared drive.

  • permission_id (String)

    The ID for the permission.

  • permission_object (Google::Apis::DriveV2::Permission) (defaults to: nil)
  • remove_expiration (Boolean) (defaults to: nil)

    Whether to remove the expiration date.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • transfer_ownership (Boolean) (defaults to: nil)

    Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
# File 'generated/google/apis/drive_v2/service.rb', line 2514

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, user_ip: nil, options: nil, &block)
  command = make_simple_command(:put, 'files/{fileId}/permissions/{permissionId}', options)
  command.request_representation = Google::Apis::DriveV2::Permission::Representation
  command.request_object = permission_object
  command.response_representation = Google::Apis::DriveV2::Permission::Representation
  command.response_class = Google::Apis::DriveV2::Permission
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['permissionId'] = permission_id unless permission_id.nil?
  command.query['removeExpiration'] = remove_expiration unless remove_expiration.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['transferOwnership'] = transfer_ownership unless transfer_ownership.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property

Updates a property.

Parameters:

  • file_id (String)

    The ID of the file.

  • property_key (String)

    The key of the property.

  • property_object (Google::Apis::DriveV2::Property) (defaults to: nil)
  • visibility (String) (defaults to: nil)

    The visibility of the property. Allowed values are PRIVATE and PUBLIC. ( Default: PRIVATE)

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
# File 'generated/google/apis/drive_v2/service.rb', line 2749

def update_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:put, 'files/{fileId}/properties/{propertyKey}', options)
  command.request_representation = Google::Apis::DriveV2::Property::Representation
  command.request_object = property_object
  command.response_representation = Google::Apis::DriveV2::Property::Representation
  command.response_class = Google::Apis::DriveV2::Property
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['propertyKey'] = property_key unless property_key.nil?
  command.query['visibility'] = visibility unless visibility.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply

Updates an existing reply.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • reply_id (String)

    The ID of the reply.

  • comment_reply_object (Google::Apis::DriveV2::CommentReply) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
# File 'generated/google/apis/drive_v2/service.rb', line 2999

def update_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:put, 'files/{fileId}/comments/{commentId}/replies/{replyId}', options)
  command.request_representation = Google::Apis::DriveV2::CommentReply::Representation
  command.request_object = comment_reply_object
  command.response_representation = Google::Apis::DriveV2::CommentReply::Representation
  command.response_class = Google::Apis::DriveV2::CommentReply
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['commentId'] = comment_id unless comment_id.nil?
  command.params['replyId'] = reply_id unless reply_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Revision

Updates a revision.

Parameters:

  • file_id (String)

    The ID for the file.

  • revision_id (String)

    The ID for the revision.

  • revision_object (Google::Apis::DriveV2::Revision) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
# File 'generated/google/apis/drive_v2/service.rb', line 3190

def update_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:put, 'files/{fileId}/revisions/{revisionId}', options)
  command.request_representation = Google::Apis::DriveV2::Revision::Representation
  command.request_object = revision_object
  command.response_representation = Google::Apis::DriveV2::Revision::Representation
  command.response_class = Google::Apis::DriveV2::Revision
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['revisionId'] = revision_id unless revision_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_teamdrive(team_drive_id, team_drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDrive

Deprecated use drives.update instead.

Parameters:

  • team_drive_id (String)

    The ID of the Team Drive

  • team_drive_object (Google::Apis::DriveV2::TeamDrive) (defaults to: nil)
  • use_domain_admin_access (Boolean) (defaults to: nil)

    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 Team Drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
# File 'generated/google/apis/drive_v2/service.rb', line 3383

def update_teamdrive(team_drive_id, team_drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:put, 'teamdrives/{teamDriveId}', options)
  command.request_representation = Google::Apis::DriveV2::TeamDrive::Representation
  command.request_object = team_drive_object
  command.response_representation = Google::Apis::DriveV2::TeamDrive::Representation
  command.response_class = Google::Apis::DriveV2::TeamDrive
  command.params['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#watch_change(channel_object = nil, drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Channel

Subscribe to changes for a user.

Parameters:

  • channel_object (Google::Apis::DriveV2::Channel) (defaults to: nil)
  • drive_id (String) (defaults to: nil)

    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.

  • include_corpus_removals (Boolean) (defaults to: nil)

    Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file.

  • include_deleted (Boolean) (defaults to: nil)

    Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.

  • include_items_from_all_drives (Boolean) (defaults to: nil)

    Whether both My Drive and shared drive items should be included in results.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • include_subscribed (Boolean) (defaults to: nil)

    Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive are omitted from the result.

  • include_team_drive_items (Boolean) (defaults to: nil)

    Deprecated use includeItemsFromAllDrives instead.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of changes to return.

  • page_token (String) (defaults to: nil)

    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.

  • spaces (String) (defaults to: nil)

    A comma-separated list of spaces to query. Supported values are 'drive', ' appDataFolder' and 'photos'.

  • start_change_id (Fixnum) (defaults to: nil)

    Deprecated - use pageToken instead.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • team_drive_id (String) (defaults to: nil)

    Deprecated use driveId instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'generated/google/apis/drive_v2/service.rb', line 411

def watch_change(channel_object = nil, drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'changes/watch', options)
  command.request_representation = Google::Apis::DriveV2::Channel::Representation
  command.request_object = channel_object
  command.response_representation = Google::Apis::DriveV2::Channel::Representation
  command.response_class = Google::Apis::DriveV2::Channel
  command.query['driveId'] = drive_id unless drive_id.nil?
  command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil?
  command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
  command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil?
  command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['spaces'] = spaces unless spaces.nil?
  command.query['startChangeId'] = start_change_id unless start_change_id.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#watch_file(file_id, channel_object = nil, acknowledge_abuse: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Channel

Subscribe to changes on a file

Parameters:

  • file_id (String)

    The ID for the file in question.

  • channel_object (Google::Apis::DriveV2::Channel) (defaults to: nil)
  • acknowledge_abuse (Boolean) (defaults to: nil)

    Whether the user is acknowledging the risk of downloading known malware or other abusive files.

  • include_permissions_for_view (String) (defaults to: nil)

    Specifies which additional view's permissions to include in the response. Only 'published' is supported.

  • projection (String) (defaults to: nil)

    This parameter is deprecated and has no function.

  • revision_id (String) (defaults to: nil)

    Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.

  • supports_all_drives (Boolean) (defaults to: nil)

    Whether the requesting application supports both My Drives and shared drives.

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • update_viewed_date (Boolean) (defaults to: nil)

    Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • download_dest (IO, String) (defaults to: nil)

    IO stream or filename to receive content download

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
# File 'generated/google/apis/drive_v2/service.rb', line 1990

def watch_file(file_id, channel_object = nil, acknowledge_abuse: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
  if download_dest.nil?
    command = make_simple_command(:post, 'files/{fileId}/watch', options)
  else
    command = make_download_command(:post, 'files/{fileId}/watch', options)
    command.download_dest = download_dest
  end
  command.request_representation = Google::Apis::DriveV2::Channel::Representation
  command.request_object = channel_object
  command.response_representation = Google::Apis::DriveV2::Channel::Representation
  command.response_class = Google::Apis::DriveV2::Channel
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['projection'] = projection unless projection.nil?
  command.query['revisionId'] = revision_id unless revision_id.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end