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

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/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

Instance Method Summary collapse

Constructor Details

#initializeDriveService

Returns a new instance of DriveService.



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

def initialize
  super('https://www.googleapis.com/', 'drive/v3/',
        client_name: 'google-apis-drive_v3',
        client_version: Google::Apis::DriveV3::GEM_VERSION)
  @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 'lib/google/apis/drive_v3/service.rb', line 39

def key
  @key
end

#quota_userString

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

Returns:

  • (String)

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



44
45
46
# File 'lib/google/apis/drive_v3/service.rb', line 44

def quota_user
  @quota_user
end

#user_ipString

Returns Deprecated. Please use quotaUser instead.

Returns:

  • (String)

    Deprecated. Please use quotaUser instead.



48
49
50
# File 'lib/google/apis/drive_v3/service.rb', line 48

def user_ip
  @user_ip
end

Instance Method Details

#copy_file(file_id, file_object = nil, enforce_single_parent: nil, ignore_default_visibility: nil, include_labels: nil, include_permissions_for_view: nil, keep_revision_forever: nil, ocr_language: nil, supports_all_drives: 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. Folders cannot be copied.

Parameters:

  • file_id (String)

    The ID of the file.

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

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

  • ignore_default_visibility (Boolean) (defaults to: nil)

    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.

  • include_labels (String) (defaults to: nil)

    A comma-separated list of IDs of labels to include in the labelInfo part of the response.

  • include_permissions_for_view (String) (defaults to: nil)

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

  • keep_revision_forever (Boolean) (defaults to: nil)

    Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.

  • ocr_language (String) (defaults to: nil)

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

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
# File 'lib/google/apis/drive_v3/service.rb', line 849

def copy_file(file_id, file_object = nil, enforce_single_parent: nil, ignore_default_visibility: nil, include_labels: nil, include_permissions_for_view: nil, keep_revision_forever: nil, ocr_language: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/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['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['ignoreDefaultVisibility'] = ignore_default_visibility unless ignore_default_visibility.nil?
  command.query['includeLabels'] = include_labels unless include_labels.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['keepRevisionForever'] = keep_revision_forever unless keep_revision_forever.nil?
  command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#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) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/google/apis/drive_v3/service.rb', line 357

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_drive(request_id, drive_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Drive

Creates a new shared drive.

Parameters:

  • request_id (String)

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

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

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



558
559
560
561
562
563
564
565
566
567
568
569
# File 'lib/google/apis/drive_v3/service.rb', line 558

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

#create_file(file_object = nil, enforce_single_parent: nil, ignore_default_visibility: nil, include_labels: nil, include_permissions_for_view: nil, keep_revision_forever: nil, ocr_language: nil, supports_all_drives: 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)
  • enforce_single_parent (Boolean) (defaults to: nil)

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

  • ignore_default_visibility (Boolean) (defaults to: nil)

    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.

  • include_labels (String) (defaults to: nil)

    A comma-separated list of IDs of labels to include in the labelInfo part of the response.

  • include_permissions_for_view (String) (defaults to: nil)

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

  • keep_revision_forever (Boolean) (defaults to: nil)

    Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.

  • ocr_language (String) (defaults to: nil)

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

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • use_content_as_indexable_text (Boolean) (defaults to: nil)

    Whether to use the uploaded content as indexable text.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
# File 'lib/google/apis/drive_v3/service.rb', line 921

def create_file(file_object = nil, enforce_single_parent: nil, ignore_default_visibility: nil, include_labels: nil, include_permissions_for_view: nil, keep_revision_forever: nil, ocr_language: nil, supports_all_drives: 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['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['ignoreDefaultVisibility'] = ignore_default_visibility unless ignore_default_visibility.nil?
  command.query['includeLabels'] = include_labels unless include_labels.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['keepRevisionForever'] = keep_revision_forever unless keep_revision_forever.nil?
  command.query['ocrLanguage'] = ocr_language unless ocr_language.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['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, enforce_single_parent: nil, move_to_new_owners_root: nil, send_notification_email: nil, supports_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Permission

Creates a permission for a file or shared drive.

Parameters:

  • file_id (String)

    The ID of the file or shared drive.

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

    A plain text custom message to include in the notification email.

  • enforce_single_parent (Boolean) (defaults to: nil)

    Deprecated. See moveToNewOwnersRoot for details.

  • move_to_new_owners_root (Boolean) (defaults to: nil)

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

  • send_notification_email (Boolean) (defaults to: nil)

    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_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • transfer_ownership (Boolean) (defaults to: nil)

    Whether 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. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them.

  • use_domain_admin_access (Boolean) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
# File 'lib/google/apis/drive_v3/service.rb', line 1536

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

#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) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
# File 'lib/google/apis/drive_v3/service.rb', line 1797

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

Deprecated use drives.create instead.

Parameters:

  • request_id (String)

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

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

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
# File 'lib/google/apis/drive_v3/service.rb', line 2170

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) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



394
395
396
397
398
399
400
401
402
# File 'lib/google/apis/drive_v3/service.rb', line 394

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

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

This method returns an undefined value.

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

Parameters:

  • drive_id (String)

    The ID of the shared drive.

  • allow_item_deletion (Boolean) (defaults to: nil)

    Whether any items inside the shared drive should also be deleted. This option is only supported when useDomainAdminAccess is also set to true.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



601
602
603
604
605
606
607
608
609
610
# File 'lib/google/apis/drive_v3/service.rb', line 601

def delete_drive(drive_id, allow_item_deletion: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:delete, 'drives/{driveId}', options)
  command.params['driveId'] = drive_id unless drive_id.nil?
  command.query['allowItemDeletion'] = allow_item_deletion unless allow_item_deletion.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_file(file_id, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared 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.

  • enforce_single_parent (Boolean) (defaults to: nil)

    Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root.

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



980
981
982
983
984
985
986
987
988
989
990
# File 'lib/google/apis/drive_v3/service.rb', line 980

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

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

This method returns an undefined value.

Deletes a permission.

Parameters:

  • file_id (String)

    The ID of the file or shared drive.

  • permission_id (String)

    The ID of the permission.

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • use_domain_admin_access (Boolean) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

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

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

This method returns an undefined value.

Deletes a reply.

Parameters:

  • file_id (String)

    The ID of the file.

  • comment_id (String)

    The ID of the comment.

  • reply_id (String)

    The ID of the reply.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
# File 'lib/google/apis/drive_v3/service.rb', line 1837

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

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

This method returns an undefined value.

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

Parameters:

  • file_id (String)

    The ID of the file.

  • revision_id (String)

    The ID of the revision.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2007
2008
2009
2010
2011
2012
2013
2014
2015
# File 'lib/google/apis/drive_v3/service.rb', line 2007

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

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

This method returns an undefined value.

Deprecated use drives.delete instead.

Parameters:

  • team_drive_id (String)

    The ID of the Team Drive

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2205
2206
2207
2208
2209
2210
2211
2212
# File 'lib/google/apis/drive_v3/service.rb', line 2205

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

This method returns an undefined value.

Permanently deletes all of the user's trashed files.

Parameters:

  • enforce_single_parent (Boolean) (defaults to: nil)

    Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1015
1016
1017
1018
1019
1020
1021
1022
# File 'lib/google/apis/drive_v3/service.rb', line 1015

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

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

This method returns an undefined value.

Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.

Parameters:

  • file_id (String)

    The ID of the file.

  • mime_type (String)

    The MIME type of the format requested for this export.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    IO stream or filename to receive content download

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
# File 'lib/google/apis/drive_v3/service.rb', line 1051

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, type: 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 or copy requests.

Parameters:

  • count (Fixnum) (defaults to: nil)

    The number of IDs to return.

  • space (String) (defaults to: nil)

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

  • type (String) (defaults to: nil)

    The type of items which the IDs can be used for. Supported values are 'files' and 'shortcuts'. Note that 'shortcuts' are only supported in the drive 'space'. (Default: 'files')

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
# File 'lib/google/apis/drive_v3/service.rb', line 1095

def generate_file_ids(count: nil, space: nil, type: 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['type'] = type unless 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

#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) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



77
78
79
80
81
82
83
84
85
# File 'lib/google/apis/drive_v3/service.rb', line 77

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(drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::StartPageToken

Gets the starting pageToken for listing future changes.

Parameters:

  • drive_id (String) (defaults to: nil)

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

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • team_drive_id (String) (defaults to: nil)

    Deprecated use driveId instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

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

#get_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) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/google/apis/drive_v3/service.rb', line 431

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_drive(drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Drive

Gets a shared drive's metadata by ID.

Parameters:

  • drive_id (String)

    The ID of the shared drive.

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



638
639
640
641
642
643
644
645
646
647
648
# File 'lib/google/apis/drive_v3/service.rb', line 638

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

#get_file(file_id, acknowledge_abuse: nil, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: 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) (defaults to: nil)

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

  • include_labels (String) (defaults to: nil)

    A comma-separated list of IDs of labels to include in the labelInfo part of the response.

  • include_permissions_for_view (String) (defaults to: nil)

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

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    IO stream or filename to receive content download

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/google/apis/drive_v3/service.rb', line 1145

def get_file(file_id, acknowledge_abuse: nil, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: 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['includeLabels'] = include_labels unless include_labels.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_permission(file_id, permission_id, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::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_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • use_domain_admin_access (Boolean) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
# File 'lib/google/apis/drive_v3/service.rb', line 1636

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

#get_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) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
# File 'lib/google/apis/drive_v3/service.rb', line 1877

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) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    IO stream or filename to receive content download

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
# File 'lib/google/apis/drive_v3/service.rb', line 2046

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

Deprecated use drives.get instead.

Parameters:

  • team_drive_id (String)

    The ID of the Team Drive

  • use_domain_admin_access (Boolean) (defaults to: nil)

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
# File 'lib/google/apis/drive_v3/service.rb', line 2240

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

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

Hides a shared drive from the default view.

Parameters:

  • drive_id (String)

    The ID of the shared drive.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



672
673
674
675
676
677
678
679
680
681
# File 'lib/google/apis/drive_v3/service.rb', line 672

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

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

Lists the changes for a user or shared 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.

  • drive_id (String) (defaults to: nil)

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

  • include_corpus_removals (Boolean) (defaults to: nil)

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

  • include_items_from_all_drives (Boolean) (defaults to: nil)

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

  • include_labels (String) (defaults to: nil)

    A comma-separated list of IDs of labels to include in the labelInfo part of the response.

  • include_permissions_for_view (String) (defaults to: nil)

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

  • include_removed (Boolean) (defaults to: nil)

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

  • include_team_drive_items (Boolean) (defaults to: nil)

    Deprecated use includeItemsFromAllDrives instead.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of changes to return per page.

  • restrict_to_my_drive (Boolean) (defaults to: nil)

    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) (defaults to: nil)

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

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • team_drive_id (String) (defaults to: nil)

    Deprecated use driveId instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/google/apis/drive_v3/service.rb', line 191

def list_changes(page_token, drive_id: nil, include_corpus_removals: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_removed: nil, include_team_drive_items: nil, page_size: nil, restrict_to_my_drive: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'changes', options)
  command.response_representation = Google::Apis::DriveV3::ChangeList::Representation
  command.response_class = Google::Apis::DriveV3::ChangeList
  command.query['driveId'] = drive_id unless drive_id.nil?
  command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil?
  command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
  command.query['includeLabels'] = include_labels unless include_labels.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.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['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_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) (defaults to: nil)

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

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of comments to return per page.

  • page_token (String) (defaults to: nil)

    The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.

  • start_modified_time (String) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



477
478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/google/apis/drive_v3/service.rb', line 477

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_drives(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::DriveList

Lists the user's shared drives.

Parameters:

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of shared drives to return per page.

  • page_token (String) (defaults to: nil)

    Page token for shared drives.

  • q (String) (defaults to: nil)

    Query string for searching shared drives.

  • use_domain_admin_access (Boolean) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



712
713
714
715
716
717
718
719
720
721
722
723
724
# File 'lib/google/apis/drive_v3/service.rb', line 712

def list_drives(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, 'drives', options)
  command.response_representation = Google::Apis::DriveV3::DriveList::Representation
  command.response_class = Google::Apis::DriveV3::DriveList
  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

#list_file_labels(file_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::LabelList

Lists the labels on a file.

Parameters:

  • file_id (String)

    The ID of the file.

  • max_results (Fixnum) (defaults to: nil)

    The maximum number of labels to return per page. When not set, this defaults to 100.

  • page_token (String) (defaults to: nil)

    The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

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

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

Lists or searches files.

Parameters:

  • corpora (String) (defaults to: nil)

    Groupings of files to which the query applies. Supported groupings are: 'user' (files created by, opened by, or shared directly with the user), 'drive' ( files in the specified shared drive as indicated by the 'driveId'), 'domain' ( files shared to the user's domain), and 'allDrives' (A combination of 'user' and 'drive' for all drives where the user is a member). When able, use 'user' or 'drive', instead of 'allDrives', for efficiency.

  • corpus (String) (defaults to: nil)

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

  • drive_id (String) (defaults to: nil)

    ID of the shared drive to search.

  • include_items_from_all_drives (Boolean) (defaults to: nil)

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

  • include_labels (String) (defaults to: nil)

    A comma-separated list of IDs of labels to include in the labelInfo part of the response.

  • include_permissions_for_view (String) (defaults to: nil)

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

  • include_team_drive_items (Boolean) (defaults to: nil)

    Deprecated use includeItemsFromAllDrives instead.

  • order_by (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • page_token (String) (defaults to: nil)

    The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.

  • q (String) (defaults to: nil)

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

  • spaces (String) (defaults to: nil)

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

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • team_drive_id (String) (defaults to: nil)

    Deprecated use driveId instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
# File 'lib/google/apis/drive_v3/service.rb', line 1233

def list_files(corpora: nil, corpus: nil, drive_id: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_team_drive_items: nil, order_by: nil, page_size: nil, page_token: nil, q: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'files', options)
  command.response_representation = Google::Apis::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['driveId'] = drive_id unless drive_id.nil?
  command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
  command.query['includeLabels'] = include_labels unless include_labels.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil?
  command.query['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['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

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

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

Parameters:

  • file_id (String)

    The ID of the file or shared drive.

  • include_permissions_for_view (String) (defaults to: nil)

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

  • page_size (Fixnum) (defaults to: nil)

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

  • page_token (String) (defaults to: nil)

    The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • use_domain_admin_access (Boolean) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
# File 'lib/google/apis/drive_v3/service.rb', line 1692

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

#list_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) (defaults to: nil)

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

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of replies to return per page.

  • page_token (String) (defaults to: nil)

    The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
# File 'lib/google/apis/drive_v3/service.rb', line 1923

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) (defaults to: nil)

    The maximum number of revisions to return per page.

  • page_token (String) (defaults to: nil)

    The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
# File 'lib/google/apis/drive_v3/service.rb', line 2091

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

Deprecated use drives.list instead.

Parameters:

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of Team Drives to return.

  • page_token (String) (defaults to: nil)

    Page token for Team Drives.

  • q (String) (defaults to: nil)

    Query string for searching Team Drives.

  • use_domain_admin_access (Boolean) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
# File 'lib/google/apis/drive_v3/service.rb', line 2281

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

#modify_file_labels(file_id, modify_labels_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::ModifyLabelsResponse

Modifies the set of labels on a file.

Parameters:

  • file_id (String)

    The ID of the file for which the labels are modified.

  • modify_labels_request_object (Google::Apis::DriveV3::ModifyLabelsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
# File 'lib/google/apis/drive_v3/service.rb', line 1322

def modify_file_labels(file_id, modify_labels_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:post, 'files/{fileId}/modifyLabels', options)
  command.request_representation = Google::Apis::DriveV3::ModifyLabelsRequest::Representation
  command.request_object = modify_labels_request_object
  command.response_representation = Google::Apis::DriveV3::ModifyLabelsResponse::Representation
  command.response_class = Google::Apis::DriveV3::ModifyLabelsResponse
  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

#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) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



324
325
326
327
328
329
330
331
332
# File 'lib/google/apis/drive_v3/service.rb', line 324

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

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

Restores a shared drive to the default view.

Parameters:

  • drive_id (String)

    The ID of the shared drive.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



748
749
750
751
752
753
754
755
756
757
# File 'lib/google/apis/drive_v3/service.rb', line 748

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

#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) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/google/apis/drive_v3/service.rb', line 517

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_drive(drive_id, drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Drive

Updates the metadate for a shared drive.

Parameters:

  • drive_id (String)

    The ID of the shared drive.

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

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



786
787
788
789
790
791
792
793
794
795
796
797
798
# File 'lib/google/apis/drive_v3/service.rb', line 786

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

#update_file(file_id, file_object = nil, add_parents: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, keep_revision_forever: nil, ocr_language: nil, remove_parents: nil, supports_all_drives: 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. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might change automatically, such as modifiedDate. This method supports patch semantics.

Parameters:

  • file_id (String)

    The ID of the file.

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

    A comma-separated list of parent IDs to add.

  • enforce_single_parent (Boolean) (defaults to: nil)

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

  • include_labels (String) (defaults to: nil)

    A comma-separated list of IDs of labels to include in the labelInfo part of the response.

  • include_permissions_for_view (String) (defaults to: nil)

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

  • keep_revision_forever (Boolean) (defaults to: nil)

    Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.

  • ocr_language (String) (defaults to: nil)

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

  • remove_parents (String) (defaults to: nil)

    A comma-separated list of parent IDs to remove.

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • use_content_as_indexable_text (Boolean) (defaults to: nil)

    Whether to use the uploaded content as indexable text.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
# File 'lib/google/apis/drive_v3/service.rb', line 1391

def update_file(file_id, file_object = nil, add_parents: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, keep_revision_forever: nil, ocr_language: nil, remove_parents: nil, supports_all_drives: 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['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil?
  command.query['includeLabels'] = include_labels unless include_labels.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.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['supportsAllDrives'] = supports_all_drives unless supports_all_drives.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_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV3::Permission

Updates a permission with patch semantics.

Parameters:

  • file_id (String)

    The ID of the file or shared drive.

  • permission_id (String)

    The ID of the permission.

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

    Whether to remove the expiration date.

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • transfer_ownership (Boolean) (defaults to: nil)

    Whether 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. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them.

  • use_domain_admin_access (Boolean) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
# File 'lib/google/apis/drive_v3/service.rb', line 1753

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

#update_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) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
# File 'lib/google/apis/drive_v3/service.rb', line 1965

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) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
# File 'lib/google/apis/drive_v3/service.rb', line 2129

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

Deprecated use drives.update instead

Parameters:

  • team_drive_id (String)

    The ID of the Team Drive

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

    Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
# File 'lib/google/apis/drive_v3/service.rb', line 2322

def update_teamdrive(team_drive_id, team_drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(: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['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#watch_change(page_token, channel_object = nil, drive_id: nil, include_corpus_removals: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_removed: nil, include_team_drive_items: nil, page_size: nil, restrict_to_my_drive: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::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)
  • drive_id (String) (defaults to: nil)

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

  • include_corpus_removals (Boolean) (defaults to: nil)

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

  • include_items_from_all_drives (Boolean) (defaults to: nil)

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

  • include_labels (String) (defaults to: nil)

    A comma-separated list of IDs of labels to include in the labelInfo part of the response.

  • include_permissions_for_view (String) (defaults to: nil)

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

  • include_removed (Boolean) (defaults to: nil)

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

  • include_team_drive_items (Boolean) (defaults to: nil)

    Deprecated use includeItemsFromAllDrives instead.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of changes to return per page.

  • restrict_to_my_drive (Boolean) (defaults to: nil)

    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) (defaults to: nil)

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

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • team_drive_id (String) (defaults to: nil)

    Deprecated use driveId instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/google/apis/drive_v3/service.rb', line 277

def watch_change(page_token, channel_object = nil, drive_id: nil, include_corpus_removals: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_removed: nil, include_team_drive_items: nil, page_size: nil, restrict_to_my_drive: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(: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['driveId'] = drive_id unless drive_id.nil?
  command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil?
  command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil?
  command.query['includeLabels'] = include_labels unless include_labels.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.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['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#watch_file(file_id, channel_object = nil, acknowledge_abuse: nil, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: 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. While you can establish a channel for changes to a file on a shared drive, a change to a shared drive file won't create a notification.

Parameters:

  • file_id (String)

    The ID of the file.

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

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

  • include_labels (String) (defaults to: nil)

    A comma-separated list of IDs of labels to include in the labelInfo part of the response.

  • include_permissions_for_view (String) (defaults to: nil)

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

  • supports_all_drives (Boolean) (defaults to: nil)

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

  • supports_team_drives (Boolean) (defaults to: nil)

    Deprecated use supportsAllDrives instead.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

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

    IO stream or filename to receive content download

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

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

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
# File 'lib/google/apis/drive_v3/service.rb', line 1460

def watch_file(file_id, channel_object = nil, acknowledge_abuse: nil, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: 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['includeLabels'] = include_labels unless include_labels.nil?
  command.query['includePermissionsForView'] = include_permissions_for_view unless include_permissions_for_view.nil?
  command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil?
  command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end