Class: Google::Apis::DriveV3::DriveService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/drive_v3/service.rb

Overview

Drive API

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

Examples:

require 'google/apis/drive_v3'

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

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeDriveService

Returns a new instance of DriveService



52
53
54
55
# File 'generated/google/apis/drive_v3/service.rb', line 52

def initialize
  super('https://www.googleapis.com/', 'drive/v3/')
  @batch_path = 'batch'
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_v3/service.rb', line 39

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.



45
46
47
# File 'generated/google/apis/drive_v3/service.rb', line 45

def quota_user
  @quota_user
end

#user_ipString

Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Returns:

  • (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.



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

def user_ip
  @user_ip
end

Instance Method Details

#copy_file(file_id, file_object = nil, ignore_default_visibility: nil, keep_revision_forever: nil, ocr_language: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::File

Creates a copy of a file and applies any requested updates with patch semantics.

Parameters:

  • file_id (String)

    The ID of the file.

  • file_object (Google::Apis::DriveV3::File) (defaults to: nil)
  • ignore_default_visibility (Boolean)

    Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.

  • keep_revision_forever (Boolean)

    Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.

  • ocr_language (String)

    A language hint for OCR processing during image import (ISO 639-1 code).

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
# File 'generated/google/apis/drive_v3/service.rb', line 549

def copy_file(file_id, file_object = nil, ignore_default_visibility: nil, keep_revision_forever: nil, ocr_language: nil, supports_team_drives: 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::DriveV3::File::Representation
  command.request_object = file_object
  command.response_representation = Google::Apis::DriveV3::File::Representation
  command.response_class = Google::Apis::DriveV3::File
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['ignoreDefaultVisibility'] = ignore_default_visibility unless ignore_default_visibility.nil?
  command.query['keepRevisionForever'] = keep_revision_forever unless keep_revision_forever.nil?
  command.query['ocrLanguage'] = ocr_language unless ocr_language.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

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

Creates a new comment on a file.

Parameters:

  • file_id (String)

    The ID of the file.

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

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



329
330
331
332
333
334
335
336
337
338
339
340
# File 'generated/google/apis/drive_v3/service.rb', line 329

def create_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::DriveV3::Comment::Representation
  command.request_object = comment_object
  command.response_representation = Google::Apis::DriveV3::Comment::Representation
  command.response_class = Google::Apis::DriveV3::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

#create_file(file_object = nil, ignore_default_visibility: nil, keep_revision_forever: nil, ocr_language: nil, supports_team_drives: 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::DriveV3::File

Creates a new file.

Parameters:

  • file_object (Google::Apis::DriveV3::File) (defaults to: nil)
  • ignore_default_visibility (Boolean)

    Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.

  • keep_revision_forever (Boolean)

    Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.

  • ocr_language (String)

    A language hint for OCR processing during image import (ISO 639-1 code).

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • use_content_as_indexable_text (Boolean)

    Whether to use the uploaded content as indexable text.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • upload_source (IO, String)

    IO stream or filename containing content to upload

  • content_type (String)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
# File 'generated/google/apis/drive_v3/service.rb', line 607

def create_file(file_object = nil, ignore_default_visibility: nil, keep_revision_forever: nil, ocr_language: nil, supports_team_drives: 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(: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::DriveV3::File::Representation
  command.request_object = file_object
  command.response_representation = Google::Apis::DriveV3::File::Representation
  command.response_class = Google::Apis::DriveV3::File
  command.query['ignoreDefaultVisibility'] = ignore_default_visibility unless ignore_default_visibility.nil?
  command.query['keepRevisionForever'] = keep_revision_forever unless keep_revision_forever.nil?
  command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.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

#create_permission(file_id, permission_object = nil, email_message: nil, send_notification_email: nil, supports_team_drives: nil, transfer_ownership: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Permission

Creates a permission for a file or Team Drive.

Parameters:

  • file_id (String)

    The ID of the file or Team Drive.

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

    A custom message to include in the notification email.

  • send_notification_email (Boolean)

    Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers.

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • transfer_ownership (Boolean)

    Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
# File 'generated/google/apis/drive_v3/service.rb', line 1062

def create_permission(file_id, permission_object = nil, email_message: nil, send_notification_email: nil, supports_team_drives: nil, transfer_ownership: 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::DriveV3::Permission::Representation
  command.request_object = permission_object
  command.response_representation = Google::Apis::DriveV3::Permission::Representation
  command.response_class = Google::Apis::DriveV3::Permission
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['emailMessage'] = email_message unless email_message.nil?
  command.query['sendNotificationEmail'] = send_notification_email unless send_notification_email.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['transferOwnership'] = transfer_ownership unless transfer_ownership.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

#create_reply(file_id, comment_id, reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Reply

Creates a new reply to a comment.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • reply_object (Google::Apis::DriveV3::Reply) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
# File 'generated/google/apis/drive_v3/service.rb', line 1285

def create_reply(file_id, comment_id, 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::DriveV3::Reply::Representation
  command.request_object = reply_object
  command.response_representation = Google::Apis::DriveV3::Reply::Representation
  command.response_class = Google::Apis::DriveV3::Reply
  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

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

Creates a new Team Drive.

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::DriveV3::TeamDrive) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
# File 'generated/google/apis/drive_v3/service.rb', line 1674

def create_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::DriveV3::TeamDrive::Representation
  command.request_object = team_drive_object
  command.response_representation = Google::Apis::DriveV3::TeamDrive::Representation
  command.response_class = Google::Apis::DriveV3::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

#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)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    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:



368
369
370
371
372
373
374
375
376
# File 'generated/google/apis/drive_v3/service.rb', line 368

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_file(file_id, 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 owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted.

Parameters:

  • file_id (String)

    The ID of the file.

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    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:



659
660
661
662
663
664
665
666
667
# File 'generated/google/apis/drive_v3/service.rb', line 659

def delete_file(file_id, 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['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_permission(file_id, permission_id, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deletes a permission.

Parameters:

  • file_id (String)

    The ID of the file or Team Drive.

  • permission_id (String)

    The ID of the permission.

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    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:



1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
# File 'generated/google/apis/drive_v3/service.rb', line 1107

def delete_permission(file_id, permission_id, supports_team_drives: 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['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_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)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    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:



1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
# File 'generated/google/apis/drive_v3/service.rb', line 1327

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 revision. This method is only applicable to files with binary content in Drive.

Parameters:

  • file_id (String)

    The ID of the file.

  • revision_id (String)

    The ID of the revision.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    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:



1503
1504
1505
1506
1507
1508
1509
1510
1511
# File 'generated/google/apis/drive_v3/service.rb', line 1503

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.

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

Parameters:

  • team_drive_id (String)

    The ID of the Team Drive

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    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:



1712
1713
1714
1715
1716
1717
1718
1719
# File 'generated/google/apis/drive_v3/service.rb', line 1712

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_file_trash(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:

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    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:



691
692
693
694
695
696
697
# File 'generated/google/apis/drive_v3/service.rb', line 691

def empty_file_trash(fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, 'files/trash', options)
  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.

Parameters:

  • file_id (String)

    The ID of the file.

  • mime_type (String)

    The MIME type of the format requested for this export.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • download_dest (IO, String)

    IO stream or filename to receive content download

  • options (Google::Apis::RequestOptions)

    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:



728
729
730
731
732
733
734
735
736
737
738
739
740
741
# File 'generated/google/apis/drive_v3/service.rb', line 728

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(count: nil, space: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::GeneratedIds

Generates a set of file IDs which can be provided in create requests.

Parameters:

  • count (Fixnum)

    The number of IDs to return.

  • space (String)

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



770
771
772
773
774
775
776
777
778
779
780
# File 'generated/google/apis/drive_v3/service.rb', line 770

def generate_file_ids(count: 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::DriveV3::GeneratedIds::Representation
  command.response_class = Google::Apis::DriveV3::GeneratedIds
  command.query['count'] = count unless count.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(fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::About

Gets information about the user, the user's Drive, and system capabilities.

Parameters:

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



79
80
81
82
83
84
85
86
87
# File 'generated/google/apis/drive_v3/service.rb', line 79

def get_about(fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'about', options)
  command.response_representation = Google::Apis::DriveV3::About::Representation
  command.response_class = Google::Apis::DriveV3::About
  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_changes_start_page_token(supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::StartPageToken

Gets the starting pageToken for listing future changes.

Parameters:

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • team_drive_id (String)

    The ID of the Team Drive for which the starting pageToken for listing future changes from that Team Drive will be returned.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



116
117
118
119
120
121
122
123
124
125
126
# File 'generated/google/apis/drive_v3/service.rb', line 116

def get_changes_start_page_token(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::DriveV3::StartPageToken::Representation
  command.response_class = Google::Apis::DriveV3::StartPageToken
  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_comment(file_id, comment_id, include_deleted: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::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)

    Whether to return deleted comments. Deleted comments will not include their original content.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



407
408
409
410
411
412
413
414
415
416
417
418
# File 'generated/google/apis/drive_v3/service.rb', line 407

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::DriveV3::Comment::Representation
  command.response_class = Google::Apis::DriveV3::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_file(file_id, acknowledge_abuse: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::File

Gets a file's metadata or content by ID.

Parameters:

  • file_id (String)

    The ID of the file.

  • acknowledge_abuse (Boolean)

    Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • download_dest (IO, String)

    IO stream or filename to receive content download

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
# File 'generated/google/apis/drive_v3/service.rb', line 813

def get_file(file_id, acknowledge_abuse: nil, supports_team_drives: 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::DriveV3::File::Representation
  command.response_class = Google::Apis::DriveV3::File
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.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

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

Gets a permission by ID.

Parameters:

  • file_id (String)

    The ID of the file.

  • permission_id (String)

    The ID of the permission.

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
# File 'generated/google/apis/drive_v3/service.rb', line 1146

def get_permission(file_id, permission_id, supports_team_drives: 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::DriveV3::Permission::Representation
  command.response_class = Google::Apis::DriveV3::Permission
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['permissionId'] = permission_id unless permission_id.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

#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::DriveV3::Reply

Gets a reply by ID.

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)

    Whether to return deleted replies. Deleted replies will not include their original content.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
# File 'generated/google/apis/drive_v3/service.rb', line 1369

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::DriveV3::Reply::Representation
  command.response_class = Google::Apis::DriveV3::Reply
  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, acknowledge_abuse: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Revision

Gets a revision's metadata or content by ID.

Parameters:

  • file_id (String)

    The ID of the file.

  • revision_id (String)

    The ID of the revision.

  • acknowledge_abuse (Boolean)

    Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • download_dest (IO, String)

    IO stream or filename to receive content download

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
# File 'generated/google/apis/drive_v3/service.rb', line 1544

def get_revision(file_id, revision_id, acknowledge_abuse: 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}/revisions/{revisionId}', options)
  else
    command = make_download_command(:get, 'files/{fileId}/revisions/{revisionId}', options)
    command.download_dest = download_dest
  end
  command.response_representation = Google::Apis::DriveV3::Revision::Representation
  command.response_class = Google::Apis::DriveV3::Revision
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['revisionId'] = revision_id unless revision_id.nil?
  command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.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, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::TeamDrive

Gets a Team Drive's metadata by ID.

Parameters:

  • team_drive_id (String)

    The ID of the Team Drive

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
# File 'generated/google/apis/drive_v3/service.rb', line 1745

def get_teamdrive(team_drive_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'teamdrives/{teamDriveId}', options)
  command.response_representation = Google::Apis::DriveV3::TeamDrive::Representation
  command.response_class = Google::Apis::DriveV3::TeamDrive
  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

#list_changes(page_token, include_corpus_removals: nil, include_removed: nil, include_team_drive_items: nil, page_size: nil, restrict_to_my_drive: nil, spaces: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::ChangeList

Lists the changes for a user or Team Drive.

Parameters:

  • page_token (String)

    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.

  • include_corpus_removals (Boolean)

    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_removed (Boolean)

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

  • include_team_drive_items (Boolean)

    Whether Team Drive files or changes should be included in results.

  • page_size (Fixnum)

    The maximum number of changes to return per page.

  • restrict_to_my_drive (Boolean)

    Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive.

  • spaces (String)

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

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • team_drive_id (String)

    The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'generated/google/apis/drive_v3/service.rb', line 179

def list_changes(page_token, include_corpus_removals: nil, include_removed: nil, include_team_drive_items: nil, page_size: nil, restrict_to_my_drive: nil, spaces: 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::DriveV3::ChangeList::Representation
  command.response_class = Google::Apis::DriveV3::ChangeList
  command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil?
  command.query['includeRemoved'] = include_removed unless include_removed.nil?
  command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['restrictToMyDrive'] = restrict_to_my_drive unless restrict_to_my_drive.nil?
  command.query['spaces'] = spaces unless spaces.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_comments(file_id, include_deleted: nil, page_size: nil, page_token: nil, start_modified_time: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::CommentList

Lists a file's comments.

Parameters:

  • file_id (String)

    The ID of the file.

  • include_deleted (Boolean)

    Whether to include deleted comments. Deleted comments will not include their original content.

  • page_size (Fixnum)

    The maximum number of comments to return per page.

  • page_token (String)

    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.

  • start_modified_time (String)

    The minimum value of 'modifiedTime' for the result comments (RFC 3339 date- time).

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



455
456
457
458
459
460
461
462
463
464
465
466
467
468
# File 'generated/google/apis/drive_v3/service.rb', line 455

def list_comments(file_id, include_deleted: nil, page_size: nil, page_token: nil, start_modified_time: 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::DriveV3::CommentList::Representation
  command.response_class = Google::Apis::DriveV3::CommentList
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['includeDeleted'] = include_deleted unless include_deleted.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['startModifiedTime'] = start_modified_time unless start_modified_time.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, include_team_drive_items: nil, order_by: nil, page_size: nil, page_token: nil, q: nil, spaces: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::FileList

Lists or searches files.

Parameters:

  • corpora (String)

    Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'teamDrive' and 'allTeamDrives' . 'allTeamDrives' must be combined with 'user'; all other values must be used in isolation. Prefer 'user' or 'teamDrive' to 'allTeamDrives' for efficiency.

  • corpus (String)

    The source of files to list. Deprecated: use 'corpora' instead.

  • include_team_drive_items (Boolean)

    Whether Team Drive items should be included in results.

  • order_by (String)

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

  • page_size (Fixnum)

    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.

  • page_token (String)

    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.

  • q (String)

    A query for filtering the file results. See the "Search for Files" guide for supported syntax.

  • spaces (String)

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

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • team_drive_id (String)

    ID of Team Drive to search.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
# File 'generated/google/apis/drive_v3/service.rb', line 886

def list_files(corpora: nil, corpus: nil, include_team_drive_items: nil, order_by: nil, page_size: nil, page_token: nil, q: nil, spaces: 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::DriveV3::FileList::Representation
  command.response_class = Google::Apis::DriveV3::FileList
  command.query['corpora'] = corpora unless corpora.nil?
  command.query['corpus'] = corpus unless corpus.nil?
  command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
  command.query['orderBy'] = order_by unless order_by.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['q'] = q unless q.nil?
  command.query['spaces'] = spaces unless spaces.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_permissions(file_id, page_size: nil, page_token: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::PermissionList

Lists a file's or Team Drive's permissions.

Parameters:

  • file_id (String)

    The ID of the file or Team Drive.

  • page_size (Fixnum)

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

  • page_token (String)

    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_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
# File 'generated/google/apis/drive_v3/service.rb', line 1192

def list_permissions(file_id, page_size: nil, page_token: nil, supports_team_drives: 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::DriveV3::PermissionList::Representation
  command.response_class = Google::Apis::DriveV3::PermissionList
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.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

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

Lists a comment's replies.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • include_deleted (Boolean)

    Whether to include deleted replies. Deleted replies will not include their original content.

  • page_size (Fixnum)

    The maximum number of replies to return per page.

  • page_token (String)

    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.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
# File 'generated/google/apis/drive_v3/service.rb', line 1417

def list_replies(file_id, comment_id, include_deleted: nil, page_size: 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::DriveV3::ReplyList::Representation
  command.response_class = Google::Apis::DriveV3::ReplyList
  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['pageSize'] = page_size unless page_size.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, page_size: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::RevisionList

Lists a file's revisions.

Parameters:

  • file_id (String)

    The ID of the file.

  • page_size (Fixnum)

    The maximum number of revisions to return per page.

  • page_token (String)

    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.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
# File 'generated/google/apis/drive_v3/service.rb', line 1591

def list_revisions(file_id, page_size: 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::DriveV3::RevisionList::Representation
  command.response_class = Google::Apis::DriveV3::RevisionList
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['pageSize'] = page_size unless page_size.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(page_size: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::TeamDriveList

Lists the user's Team Drives.

Parameters:

  • page_size (Fixnum)

    Maximum number of Team Drives to return.

  • page_token (String)

    Page token for Team Drives.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
# File 'generated/google/apis/drive_v3/service.rb', line 1782

def list_teamdrives(page_size: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'teamdrives', options)
  command.response_representation = Google::Apis::DriveV3::TeamDriveList::Representation
  command.response_class = Google::Apis::DriveV3::TeamDriveList
  command.query['pageSize'] = page_size unless page_size.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

#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::DriveV3::Channel) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    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:



294
295
296
297
298
299
300
301
302
# File 'generated/google/apis/drive_v3/service.rb', line 294

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::DriveV3::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

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

Updates a comment with patch semantics.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

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

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



497
498
499
500
501
502
503
504
505
506
507
508
509
# File 'generated/google/apis/drive_v3/service.rb', line 497

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(:patch, 'files/{fileId}/comments/{commentId}', options)
  command.request_representation = Google::Apis::DriveV3::Comment::Representation
  command.request_object = comment_object
  command.response_representation = Google::Apis::DriveV3::Comment::Representation
  command.response_class = Google::Apis::DriveV3::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_file(file_id, file_object = nil, add_parents: nil, keep_revision_forever: nil, ocr_language: nil, remove_parents: nil, supports_team_drives: 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::DriveV3::File

Updates a file's metadata and/or content with patch semantics.

Parameters:

  • file_id (String)

    The ID of the file.

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

    A comma-separated list of parent IDs to add.

  • keep_revision_forever (Boolean)

    Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.

  • ocr_language (String)

    A language hint for OCR processing during image import (ISO 639-1 code).

  • remove_parents (String)

    A comma-separated list of parent IDs to remove.

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • use_content_as_indexable_text (Boolean)

    Whether to use the uploaded content as indexable text.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • upload_source (IO, String)

    IO stream or filename containing content to upload

  • content_type (String)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
# File 'generated/google/apis/drive_v3/service.rb', line 948

def update_file(file_id, file_object = nil, add_parents: nil, keep_revision_forever: nil, ocr_language: nil, remove_parents: nil, supports_team_drives: 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(:patch, 'files/{fileId}', options)
  else
    command = make_upload_command(:patch, 'files/{fileId}', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::DriveV3::File::Representation
  command.request_object = file_object
  command.response_representation = Google::Apis::DriveV3::File::Representation
  command.response_class = Google::Apis::DriveV3::File
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['addParents'] = add_parents unless add_parents.nil?
  command.query['keepRevisionForever'] = keep_revision_forever unless keep_revision_forever.nil?
  command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
  command.query['removeParents'] = remove_parents unless remove_parents.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.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_team_drives: nil, transfer_ownership: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Permission

Updates a permission with patch semantics.

Parameters:

  • file_id (String)

    The ID of the file or Team Drive.

  • permission_id (String)

    The ID of the permission.

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

    Whether to remove the expiration date.

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • transfer_ownership (Boolean)

    Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
# File 'generated/google/apis/drive_v3/service.rb', line 1241

def update_permission(file_id, permission_id, permission_object = nil, remove_expiration: nil, supports_team_drives: nil, transfer_ownership: 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::DriveV3::Permission::Representation
  command.request_object = permission_object
  command.response_representation = Google::Apis::DriveV3::Permission::Representation
  command.response_class = Google::Apis::DriveV3::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['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['transferOwnership'] = transfer_ownership unless transfer_ownership.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, reply_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Reply

Updates a reply with patch semantics.

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.

  • reply_object (Google::Apis::DriveV3::Reply) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
# File 'generated/google/apis/drive_v3/service.rb', line 1461

def update_reply(file_id, comment_id, reply_id, 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::DriveV3::Reply::Representation
  command.request_object = reply_object
  command.response_representation = Google::Apis::DriveV3::Reply::Representation
  command.response_class = Google::Apis::DriveV3::Reply
  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::DriveV3::Revision

Updates a revision with patch semantics.

Parameters:

  • file_id (String)

    The ID of the file.

  • revision_id (String)

    The ID of the revision.

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

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
# File 'generated/google/apis/drive_v3/service.rb', line 1631

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(:patch, 'files/{fileId}/revisions/{revisionId}', options)
  command.request_representation = Google::Apis::DriveV3::Revision::Representation
  command.request_object = revision_object
  command.response_representation = Google::Apis::DriveV3::Revision::Representation
  command.response_class = Google::Apis::DriveV3::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, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::TeamDrive

Updates a Team Drive's metadata

Parameters:

  • team_drive_id (String)

    The ID of the Team Drive

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

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
# File 'generated/google/apis/drive_v3/service.rb', line 1819

def update_teamdrive(team_drive_id, team_drive_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:patch, 'teamdrives/{teamDriveId}', options)
  command.request_representation = Google::Apis::DriveV3::TeamDrive::Representation
  command.request_object = team_drive_object
  command.response_representation = Google::Apis::DriveV3::TeamDrive::Representation
  command.response_class = Google::Apis::DriveV3::TeamDrive
  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

#watch_change(page_token, channel_object = nil, include_corpus_removals: nil, include_removed: nil, include_team_drive_items: nil, page_size: nil, restrict_to_my_drive: nil, spaces: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Channel

Subscribes to changes for a user.

Parameters:

  • page_token (String)

    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.

  • channel_object (Google::Apis::DriveV3::Channel) (defaults to: nil)
  • include_corpus_removals (Boolean)

    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_removed (Boolean)

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

  • include_team_drive_items (Boolean)

    Whether Team Drive files or changes should be included in results.

  • page_size (Fixnum)

    The maximum number of changes to return per page.

  • restrict_to_my_drive (Boolean)

    Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive.

  • spaces (String)

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

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • team_drive_id (String)

    The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'generated/google/apis/drive_v3/service.rb', line 250

def watch_change(page_token, channel_object = nil, include_corpus_removals: nil, include_removed: nil, include_team_drive_items: nil, page_size: nil, restrict_to_my_drive: nil, spaces: 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::DriveV3::Channel::Representation
  command.request_object = channel_object
  command.response_representation = Google::Apis::DriveV3::Channel::Representation
  command.response_class = Google::Apis::DriveV3::Channel
  command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil?
  command.query['includeRemoved'] = include_removed unless include_removed.nil?
  command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['restrictToMyDrive'] = restrict_to_my_drive unless restrict_to_my_drive.nil?
  command.query['spaces'] = spaces unless spaces.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, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Channel

Subscribes to changes to a file

Parameters:

  • file_id (String)

    The ID of the file.

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

    Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.

  • supports_team_drives (Boolean)

    Whether the requesting application supports Team Drives.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • download_dest (IO, String)

    IO stream or filename to receive content download

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
# File 'generated/google/apis/drive_v3/service.rb', line 1005

def watch_file(file_id, channel_object = nil, acknowledge_abuse: nil, supports_team_drives: 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::DriveV3::Channel::Representation
  command.request_object = channel_object
  command.response_representation = Google::Apis::DriveV3::Channel::Representation
  command.response_class = Google::Apis::DriveV3::Channel
  command.params['fileId'] = file_id unless file_id.nil?
  command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.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