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/drive/v3'
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, use_domain_admin_access: 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 plain text 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.

  • use_domain_admin_access (Boolean)

    Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.

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



1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'generated/google/apis/drive_v3/service.rb', line 1066

def create_permission(file_id, permission_object = nil, email_message: nil, send_notification_email: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(: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['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

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



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

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:



1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
# File 'generated/google/apis/drive_v3/service.rb', line 1699

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, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deletes a permission.

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.

  • use_domain_admin_access (Boolean)

    Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.

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



1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
# File 'generated/google/apis/drive_v3/service.rb', line 1116

def delete_permission(file_id, permission_id, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, 'files/{fileId}/permissions/{permissionId}', options)
  command.params['fileId'] = file_id unless file_id.nil?
  command.params['permissionId'] = permission_id unless permission_id.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_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:



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

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:



1528
1529
1530
1531
1532
1533
1534
1535
1536
# File 'generated/google/apis/drive_v3/service.rb', line 1528

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:



1737
1738
1739
1740
1741
1742
1743
1744
# File 'generated/google/apis/drive_v3/service.rb', line 1737

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. Please note that the exported content is limited to 10MB.

Parameters:

  • file_id (String)

    The ID of the file.

  • mime_type (String)

    The MIME type of the format requested for this export.

  • fields (String)

    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, use_domain_admin_access: 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.

  • use_domain_admin_access (Boolean)

    Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.

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



1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
# File 'generated/google/apis/drive_v3/service.rb', line 1160

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

#get_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:



1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
# File 'generated/google/apis/drive_v3/service.rb', line 1394

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:



1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
# File 'generated/google/apis/drive_v3/service.rb', line 1569

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, use_domain_admin_access: nil, 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

  • use_domain_admin_access (Boolean)

    Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs.

  • fields (String)

    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:



1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
# File 'generated/google/apis/drive_v3/service.rb', line 1774

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

#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', 'name_natural', '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, use_domain_admin_access: 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.

  • use_domain_admin_access (Boolean)

    Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.

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



1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
# File 'generated/google/apis/drive_v3/service.rb', line 1211

def list_permissions(file_id, page_size: nil, page_token: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'files/{fileId}/permissions', options)
  command.response_representation = Google::Apis::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['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_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:



1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
# File 'generated/google/apis/drive_v3/service.rb', line 1442

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:



1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
# File 'generated/google/apis/drive_v3/service.rb', line 1616

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, q: nil, use_domain_admin_access: 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.

  • q (String)

    Query string for searching Team Drives.

  • use_domain_admin_access (Boolean)

    Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned.

  • fields (String)

    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:



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

def list_teamdrives(page_size: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'teamdrives', options)
  command.response_representation = Google::Apis::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['q'] = q unless q.nil?
  command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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, use_domain_admin_access: 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.

  • use_domain_admin_access (Boolean)

    Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs.

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



1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
# File 'generated/google/apis/drive_v3/service.rb', line 1265

def update_permission(file_id, permission_id, permission_object = nil, remove_expiration: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:patch, 'files/{fileId}/permissions/{permissionId}', options)
  command.request_representation = Google::Apis::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['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_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:



1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
# File 'generated/google/apis/drive_v3/service.rb', line 1486

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:



1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
# File 'generated/google/apis/drive_v3/service.rb', line 1656

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:



1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
# File 'generated/google/apis/drive_v3/service.rb', line 1857

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