Class: Google::Apis::DriveV2::DriveService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::DriveV2::DriveService
- Defined in:
- lib/google/apis/drive_v2/service.rb
Overview
Google Drive API
The Google Drive API allows clients to access resources from Google Drive.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://www.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#copy_file(file_id, file_object = nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, visibility: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Creates a copy of the specified file.
-
#delete_child(folder_id, child_id, enforce_single_parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Removes a child from a folder.
-
#delete_comment(file_id, comment_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Deletes a comment.
-
#delete_drive(drive_id, allow_item_deletion: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Permanently deletes a shared drive for which the user is an
organizer
. -
#delete_file(file_id, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Permanently deletes a file owned by the user without moving it to the trash.
-
#delete_parent(file_id, parent_id, enforce_single_parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Removes a parent from a file.
-
#delete_permission(file_id, permission_id, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Deletes a permission from a file or shared drive.
-
#delete_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Deletes a property.
-
#delete_reply(file_id, comment_id, reply_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Deletes a reply.
-
#delete_revision(file_id, revision_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Permanently deletes a file version.
-
#delete_teamdrive(team_drive_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Deprecated: Use
drives.delete
instead. -
#empty_trash(drive_id: nil, enforce_single_parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Permanently deletes all of the user's trashed files.
-
#export_file(file_id, mime_type, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... }
Exports a Google Workspace document to the requested MIME type and returns exported byte content.
-
#generate_file_ids(max_results: nil, space: nil, type: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::GeneratedIds
Generates a set of file IDs which can be provided in insert or copy requests.
-
#get_about(include_subscribed: nil, max_change_id_count: nil, start_change_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::About
Gets the information about the current user along with Drive API settings.
-
#get_app(app_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::App
Gets a specific app.
-
#get_change(change_id, drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Change
Deprecated: Use
changes.getStartPageToken
andchanges.list
to retrieve recent changes. -
#get_change_start_page_token(drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::StartPageToken
Gets the starting pageToken for listing future changes.
-
#get_child(folder_id, child_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChildReference
Gets a specific child reference.
-
#get_comment(file_id, comment_id, include_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment
Gets a comment by ID.
-
#get_drive(drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive
Gets a shared drive's metadata by ID.
-
#get_file(file_id, acknowledge_abuse: nil, include_labels: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Gets a file's metadata or content by ID.
-
#get_parent(file_id, parent_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ParentReference
Gets a specific parent reference.
-
#get_permission(file_id, permission_id, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission
Gets a permission by ID.
-
#get_permission_id_for_email(email, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::PermissionId
Returns the permission ID for an email address.
-
#get_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property
Gets a property by its key.
-
#get_reply(file_id, comment_id, reply_id, include_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply
Gets a reply.
-
#get_revision(file_id, revision_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Revision
Gets a specific revision.
-
#get_teamdrive(team_drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDrive
Deprecated: Use
drives.get
instead. -
#hide_drive(drive_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive
Hides a shared drive from the default view.
-
#initialize ⇒ DriveService
constructor
A new instance of DriveService.
-
#insert_child(folder_id, child_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChildReference
Inserts a file into a folder.
-
#insert_comment(file_id, comment_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment
Creates a new comment on the given file.
-
#insert_drive(request_id, drive_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive
Creates a new shared drive.
-
#insert_file(file_object = nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, use_content_as_indexable_text: nil, visibility: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Inserts a new file.
-
#insert_parent(file_id, parent_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ParentReference
Adds a parent folder for a file.
-
#insert_permission(file_id, permission_object = nil, email_message: nil, enforce_single_parent: nil, move_to_new_owners_root: nil, send_notification_emails: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission
Inserts a permission for a file or shared drive.
-
#insert_property(file_id, property_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property
Adds a property to a file, or updates it if it already exists.
-
#insert_reply(file_id, comment_id, comment_reply_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply
Creates a new reply to the given comment.
-
#insert_teamdrive(request_id, team_drive_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDrive
Deprecated: Use
drives.insert
instead. -
#list_apps(app_filter_extensions: nil, app_filter_mime_types: nil, language_code: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::AppList
Lists a user's installed apps.
-
#list_changes(drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChangeList
Lists the changes for a user or shared drive.
-
#list_children(folder_id, max_results: nil, order_by: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChildList
Lists a folder's children.
-
#list_comments(file_id, include_deleted: nil, max_results: nil, page_token: nil, updated_min: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentList
Lists a file's comments.
-
#list_drives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::DriveList
Lists the user's shared drives.
-
#list_file_labels(file_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::LabelList
Lists the labels on a file.
-
#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, max_results: nil, order_by: nil, page_token: nil, projection: nil, q: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::FileList
Lists the user's files.
-
#list_parents(file_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ParentList
Lists a file's parents.
-
#list_permissions(file_id, include_permissions_for_view: nil, max_results: nil, page_token: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::PermissionList
Lists a file's or shared drive's permissions.
-
#list_properties(file_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::PropertyList
Lists a file's properties.
-
#list_replies(file_id, comment_id, include_deleted: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReplyList
Lists all of the replies to a comment.
-
#list_revisions(file_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::RevisionList
Lists a file's revisions.
-
#list_teamdrives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDriveList
Deprecated: Use
drives.list
instead. -
#modify_file_labels(file_id, modify_labels_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ModifyLabelsResponse
Modifies the set of labels applied to a file.
-
#patch_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment
Updates an existing comment.
-
#patch_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Updates a file's metadata and/or content.
-
#patch_permission(file_id, permission_id, permission_object = nil, remove_expiration: nil, supports_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission
Updates a permission using patch semantics.
-
#patch_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property
Updates a property.
-
#patch_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply
Updates an existing reply.
-
#patch_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Revision
Updates a revision.
-
#stop_channel(channel_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
Stops watching resources through this channel.
-
#touch_file(file_id, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Set the file's updated time to the current server time.
-
#trash_file(file_id, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Moves a file to the trash.
-
#unhide_drive(drive_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive
Restores a shared drive to the default view.
-
#untrash_file(file_id, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Restores a file from the trash.
-
#update_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment
Updates an existing comment.
-
#update_drive(drive_id, drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive
Updates the metadata for a shared drive.
-
#update_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Updates a file's metadata and/or content.
-
#update_permission(file_id, permission_id, permission_object = nil, remove_expiration: nil, supports_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission
Updates a permission.
-
#update_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property
Updates a property.
-
#update_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply
Updates an existing reply.
-
#update_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Revision
Updates a revision.
-
#update_teamdrive(team_drive_id, team_drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDrive
Deprecated: Use
drives.update
instead. -
#watch_change(channel_object = nil, drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Channel
Subscribe to changes for a user.
-
#watch_file(file_id, channel_object = nil, acknowledge_abuse: nil, include_labels: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Channel
Subscribes to changes to a file.
Constructor Details
#initialize ⇒ DriveService
Returns a new instance of DriveService.
47 48 49 50 51 52 |
# File 'lib/google/apis/drive_v2/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, 'drive/v2/', client_name: 'google-apis-drive_v2', client_version: Google::Apis::DriveV2::GEM_VERSION) @batch_path = 'batch/drive/v2' end |
Instance Attribute Details
#key ⇒ String
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.
40 41 42 |
# File 'lib/google/apis/drive_v2/service.rb', line 40 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
45 46 47 |
# File 'lib/google/apis/drive_v2/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#copy_file(file_id, file_object = nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, visibility: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Creates a copy of the specified file.
1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 |
# File 'lib/google/apis/drive_v2/service.rb', line 1132 def copy_file(file_id, file_object = nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, visibility: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/copy', ) command.request_representation = Google::Apis::DriveV2::File::Representation command.request_object = file_object command.response_representation = Google::Apis::DriveV2::File::Representation command.response_class = Google::Apis::DriveV2::File command.params['fileId'] = file_id unless file_id.nil? command.query['convert'] = convert unless convert.nil? command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .nil? command.query['ocr'] = ocr unless ocr.nil? command.query['ocrLanguage'] = ocr_language unless ocr_language.nil? command.query['pinned'] = pinned unless pinned.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil? command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil? command.query['visibility'] = visibility unless visibility.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_child(folder_id, child_id, enforce_single_parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Removes a child from a folder.
478 479 480 481 482 483 484 485 486 |
# File 'lib/google/apis/drive_v2/service.rb', line 478 def delete_child(folder_id, child_id, enforce_single_parent: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'files/{folderId}/children/{childId}', ) command.params['folderId'] = folder_id unless folder_id.nil? command.params['childId'] = child_id unless child_id.nil? command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_comment(file_id, comment_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Deletes a comment.
634 635 636 637 638 639 640 641 |
# File 'lib/google/apis/drive_v2/service.rb', line 634 def delete_comment(file_id, comment_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}', ) 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? 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, 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.
859 860 861 862 863 864 865 866 867 |
# File 'lib/google/apis/drive_v2/service.rb', line 859 def delete_drive(drive_id, allow_item_deletion: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'drives/{driveId}', ) 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? 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, 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 folder. If the target is a folder, all descendants owned by the user
are also deleted.
1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 |
# File 'lib/google/apis/drive_v2/service.rb', line 1186 def delete_file(file_id, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'files/{fileId}', ) 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? execute_or_queue_command(command, &block) end |
#delete_parent(file_id, parent_id, enforce_single_parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Removes a parent from a file.
2087 2088 2089 2090 2091 2092 2093 2094 2095 |
# File 'lib/google/apis/drive_v2/service.rb', line 2087 def delete_parent(file_id, parent_id, enforce_single_parent: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'files/{fileId}/parents/{parentId}', ) command.params['fileId'] = file_id unless file_id.nil? command.params['parentId'] = parent_id unless parent_id.nil? command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? 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, options: nil) {|result, err| ... }
This method returns an undefined value.
Deletes a permission from a file or shared drive. Warning: Concurrent permissions operations on the same file are not supported; only the last update is applied.
2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 |
# File 'lib/google/apis/drive_v2/service.rb', line 2236 def (file_id, , supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'files/{fileId}/permissions/{permissionId}', ) command.params['fileId'] = file_id unless file_id.nil? command.params['permissionId'] = unless .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? execute_or_queue_command(command, &block) end |
#delete_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Deletes a property.
2578 2579 2580 2581 2582 2583 2584 2585 2586 |
# File 'lib/google/apis/drive_v2/service.rb', line 2578 def delete_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'files/{fileId}/properties/{propertyKey}', ) command.params['fileId'] = file_id unless file_id.nil? command.params['propertyKey'] = property_key unless property_key.nil? command.query['visibility'] = visibility unless visibility.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_reply(file_id, comment_id, reply_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Deletes a reply.
2791 2792 2793 2794 2795 2796 2797 2798 2799 |
# File 'lib/google/apis/drive_v2/service.rb', line 2791 def delete_reply(file_id, comment_id, reply_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'files/{fileId}/comments/{commentId}/replies/{replyId}', ) 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? execute_or_queue_command(command, &block) end |
#delete_revision(file_id, revision_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Permanently deletes a file version. You can only delete revisions for files with binary content, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.
3023 3024 3025 3026 3027 3028 3029 3030 |
# File 'lib/google/apis/drive_v2/service.rb', line 3023 def delete_revision(file_id, revision_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'files/{fileId}/revisions/{revisionId}', ) 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? execute_or_queue_command(command, &block) end |
#delete_teamdrive(team_drive_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Deprecated: Use drives.delete
instead.
3194 3195 3196 3197 3198 3199 3200 |
# File 'lib/google/apis/drive_v2/service.rb', line 3194 def delete_teamdrive(team_drive_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'teamdrives/{teamDriveId}', ) 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? execute_or_queue_command(command, &block) end |
#empty_trash(drive_id: nil, enforce_single_parent: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Permanently deletes all of the user's trashed files.
1220 1221 1222 1223 1224 1225 1226 1227 |
# File 'lib/google/apis/drive_v2/service.rb', line 1220 def empty_trash(drive_id: nil, enforce_single_parent: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'files/trash', ) command.query['driveId'] = drive_id unless drive_id.nil? command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#export_file(file_id, mime_type, fields: nil, quota_user: 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.
1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 |
# File 'lib/google/apis/drive_v2/service.rb', line 1254 def export_file(file_id, mime_type, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block) if download_dest.nil? command = make_simple_command(:get, 'files/{fileId}/export', ) else command = make_download_command(:get, 'files/{fileId}/export', ) 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? execute_or_queue_command(command, &block) end |
#generate_file_ids(max_results: nil, space: nil, type: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::GeneratedIds
Generates a set of file IDs which can be provided in insert or copy requests.
1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 |
# File 'lib/google/apis/drive_v2/service.rb', line 1295 def generate_file_ids(max_results: nil, space: nil, type: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/generateIds', ) command.response_representation = Google::Apis::DriveV2::GeneratedIds::Representation command.response_class = Google::Apis::DriveV2::GeneratedIds command.query['maxResults'] = max_results unless max_results.nil? command.query['space'] = space unless space.nil? command.query['type'] = type unless type.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_about(include_subscribed: nil, max_change_id_count: nil, start_change_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::About
Gets the information about the current user along with Drive API settings
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/google/apis/drive_v2/service.rb', line 82 def get_about(include_subscribed: nil, max_change_id_count: nil, start_change_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'about', ) command.response_representation = Google::Apis::DriveV2::About::Representation command.response_class = Google::Apis::DriveV2::About command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil? command.query['maxChangeIdCount'] = max_change_id_count unless max_change_id_count.nil? command.query['startChangeId'] = start_change_id unless start_change_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_app(app_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::App
Gets a specific app.
114 115 116 117 118 119 120 121 122 |
# File 'lib/google/apis/drive_v2/service.rb', line 114 def get_app(app_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'apps/{appId}', ) command.response_representation = Google::Apis::DriveV2::App::Representation command.response_class = Google::Apis::DriveV2::App command.params['appId'] = app_id unless app_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_change(change_id, drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Change
Deprecated: Use changes.getStartPageToken
and changes.list
to retrieve
recent changes.
196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/google/apis/drive_v2/service.rb', line 196 def get_change(change_id, drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'changes/{changeId}', ) command.response_representation = Google::Apis::DriveV2::Change::Representation command.response_class = Google::Apis::DriveV2::Change command.params['changeId'] = change_id unless change_id.nil? command.query['driveId'] = drive_id unless drive_id.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_change_start_page_token(drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::StartPageToken
Gets the starting pageToken for listing future changes.
237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/google/apis/drive_v2/service.rb', line 237 def get_change_start_page_token(drive_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'changes/startPageToken', ) command.response_representation = Google::Apis::DriveV2::StartPageToken::Representation command.response_class = Google::Apis::DriveV2::StartPageToken command.query['driveId'] = drive_id unless drive_id.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_child(folder_id, child_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChildReference
Gets a specific child reference.
510 511 512 513 514 515 516 517 518 519 |
# File 'lib/google/apis/drive_v2/service.rb', line 510 def get_child(folder_id, child_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{folderId}/children/{childId}', ) command.response_representation = Google::Apis::DriveV2::ChildReference::Representation command.response_class = Google::Apis::DriveV2::ChildReference command.params['folderId'] = folder_id unless folder_id.nil? command.params['childId'] = child_id unless child_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_comment(file_id, comment_id, include_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment
Gets a comment by ID.
668 669 670 671 672 673 674 675 676 677 678 |
# File 'lib/google/apis/drive_v2/service.rb', line 668 def get_comment(file_id, comment_id, include_deleted: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}', ) command.response_representation = Google::Apis::DriveV2::Comment::Representation command.response_class = Google::Apis::DriveV2::Comment command.params['fileId'] = file_id unless file_id.nil? command.params['commentId'] = comment_id unless comment_id.nil? command.query['includeDeleted'] = include_deleted unless include_deleted.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_drive(drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive
Gets a shared drive's metadata by ID.
893 894 895 896 897 898 899 900 901 902 |
# File 'lib/google/apis/drive_v2/service.rb', line 893 def get_drive(drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'drives/{driveId}', ) command.response_representation = Google::Apis::DriveV2::Drive::Representation command.response_class = Google::Apis::DriveV2::Drive command.params['driveId'] = drive_id unless drive_id.nil? command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_file(file_id, acknowledge_abuse: nil, include_labels: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Gets a file's metadata or content by ID. If you provide the URL parameter
alt=media
, then the response includes the file contents in the response body.
Downloading content with alt=media
only works if the file is stored in Drive.
To download Google Docs, Sheets, and Slides use files.export
instead. For more information, see Download &
export files.
1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 |
# File 'lib/google/apis/drive_v2/service.rb', line 1355 def get_file(file_id, acknowledge_abuse: nil, include_labels: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block) if download_dest.nil? command = make_simple_command(:get, 'files/{fileId}', ) else command = make_download_command(:get, 'files/{fileId}', ) command.download_dest = download_dest end command.response_representation = Google::Apis::DriveV2::File::Representation command.response_class = Google::Apis::DriveV2::File command.params['fileId'] = file_id unless file_id.nil? command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .nil? command.query['projection'] = projection unless projection.nil? command.query['revisionId'] = revision_id unless revision_id.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_parent(file_id, parent_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ParentReference
Gets a specific parent reference.
2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 |
# File 'lib/google/apis/drive_v2/service.rb', line 2119 def get_parent(file_id, parent_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/parents/{parentId}', ) command.response_representation = Google::Apis::DriveV2::ParentReference::Representation command.response_class = Google::Apis::DriveV2::ParentReference command.params['fileId'] = file_id unless file_id.nil? command.params['parentId'] = parent_id unless parent_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? 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, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission
Gets a permission by ID.
2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 |
# File 'lib/google/apis/drive_v2/service.rb', line 2279 def (file_id, , supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/permissions/{permissionId}', ) command.response_representation = Google::Apis::DriveV2::Permission::Representation command.response_class = Google::Apis::DriveV2::Permission command.params['fileId'] = file_id unless file_id.nil? command.params['permissionId'] = unless .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? execute_or_queue_command(command, &block) end |
#get_permission_id_for_email(email, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::PermissionId
Returns the permission ID for an email address.
2313 2314 2315 2316 2317 2318 2319 2320 2321 |
# File 'lib/google/apis/drive_v2/service.rb', line 2313 def (email, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'permissionIds/{email}', ) command.response_representation = Google::Apis::DriveV2::PermissionId::Representation command.response_class = Google::Apis::DriveV2::PermissionId command.params['email'] = email unless email.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property
Gets a property by its key.
2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 |
# File 'lib/google/apis/drive_v2/service.rb', line 2612 def get_property(file_id, property_key, visibility: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/properties/{propertyKey}', ) command.response_representation = Google::Apis::DriveV2::Property::Representation command.response_class = Google::Apis::DriveV2::Property command.params['fileId'] = file_id unless file_id.nil? command.params['propertyKey'] = property_key unless property_key.nil? command.query['visibility'] = visibility unless visibility.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_reply(file_id, comment_id, reply_id, include_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply
Gets a reply.
2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 |
# File 'lib/google/apis/drive_v2/service.rb', line 2827 def get_reply(file_id, comment_id, reply_id, include_deleted: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}/replies/{replyId}', ) command.response_representation = Google::Apis::DriveV2::CommentReply::Representation command.response_class = Google::Apis::DriveV2::CommentReply command.params['fileId'] = file_id unless file_id.nil? command.params['commentId'] = comment_id unless comment_id.nil? command.params['replyId'] = reply_id unless reply_id.nil? command.query['includeDeleted'] = include_deleted unless include_deleted.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_revision(file_id, revision_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Revision
Gets a specific revision.
3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 |
# File 'lib/google/apis/drive_v2/service.rb', line 3054 def get_revision(file_id, revision_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/revisions/{revisionId}', ) command.response_representation = Google::Apis::DriveV2::Revision::Representation command.response_class = Google::Apis::DriveV2::Revision command.params['fileId'] = file_id unless file_id.nil? command.params['revisionId'] = revision_id unless revision_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_teamdrive(team_drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDrive
Deprecated: Use drives.get
instead.
3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 |
# File 'lib/google/apis/drive_v2/service.rb', line 3226 def get_teamdrive(team_drive_id, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'teamdrives/{teamDriveId}', ) command.response_representation = Google::Apis::DriveV2::TeamDrive::Representation command.response_class = Google::Apis::DriveV2::TeamDrive command.params['teamDriveId'] = team_drive_id unless team_drive_id.nil? command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#hide_drive(drive_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive
Hides a shared drive from the default view.
924 925 926 927 928 929 930 931 932 |
# File 'lib/google/apis/drive_v2/service.rb', line 924 def hide_drive(drive_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'drives/{driveId}/hide', ) command.response_representation = Google::Apis::DriveV2::Drive::Representation command.response_class = Google::Apis::DriveV2::Drive command.params['driveId'] = drive_id unless drive_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_child(folder_id, child_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChildReference
Inserts a file into a folder.
549 550 551 552 553 554 555 556 557 558 559 560 561 562 |
# File 'lib/google/apis/drive_v2/service.rb', line 549 def insert_child(folder_id, child_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{folderId}/children', ) command.request_representation = Google::Apis::DriveV2::ChildReference::Representation command.request_object = child_reference_object command.response_representation = Google::Apis::DriveV2::ChildReference::Representation command.response_class = Google::Apis::DriveV2::ChildReference command.params['folderId'] = folder_id unless folder_id.nil? command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_comment(file_id, comment_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment
Creates a new comment on the given file.
701 702 703 704 705 706 707 708 709 710 711 |
# File 'lib/google/apis/drive_v2/service.rb', line 701 def insert_comment(file_id, comment_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/comments', ) command.request_representation = Google::Apis::DriveV2::Comment::Representation command.request_object = comment_object command.response_representation = Google::Apis::DriveV2::Comment::Representation command.response_class = Google::Apis::DriveV2::Comment command.params['fileId'] = file_id unless file_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_drive(request_id, drive_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive
Creates a new shared drive.
959 960 961 962 963 964 965 966 967 968 969 |
# File 'lib/google/apis/drive_v2/service.rb', line 959 def insert_drive(request_id, drive_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'drives', ) command.request_representation = Google::Apis::DriveV2::Drive::Representation command.request_object = drive_object command.response_representation = Google::Apis::DriveV2::Drive::Representation command.response_class = Google::Apis::DriveV2::Drive command.query['requestId'] = request_id unless request_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_file(file_object = nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, use_content_as_indexable_text: nil, visibility: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Inserts a new file. This method supports an /upload URI and accepts
uploaded media with the following characteristics: - Maximum file size: 5,
120 GB - Accepted Media MIME types:*/*
Note: Specify a valid MIME type,
rather than the literal */*
value. The literal */*
is only used to
indicate that any valid MIME type can be uploaded. For more information on
uploading files, see Upload file data.
Apps creating shortcuts with files.insert
must specify the MIME type
application/vnd.google-apps.shortcut
. Apps should specify a file extension in
the title
property when inserting files with the API. For example, an
operation to insert a JPEG file should specify something like "title": "cat.
jpg"
in the metadata. Subsequent GET
requests include the read-only
fileExtension
property populated with the extension originally specified in
the title
property. When a Google Drive user requests to download a file, or
when the file is downloaded through the sync client, Drive builds a full
filename (with extension) based on the title. In cases where the extension is
missing, Drive attempts to determine the extension based on the file's MIME
type.
1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 |
# File 'lib/google/apis/drive_v2/service.rb', line 1447 def insert_file(file_object = nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, ocr: nil, ocr_language: nil, pinned: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, use_content_as_indexable_text: nil, visibility: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block) if upload_source.nil? command = make_simple_command(:post, 'files', ) else command = make_upload_command(:post, 'files', ) command.upload_source = upload_source command.upload_content_type = content_type end command.request_representation = Google::Apis::DriveV2::File::Representation command.request_object = file_object command.response_representation = Google::Apis::DriveV2::File::Representation command.response_class = Google::Apis::DriveV2::File command.query['convert'] = convert unless convert.nil? command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .nil? command.query['ocr'] = ocr unless ocr.nil? command.query['ocrLanguage'] = ocr_language unless ocr_language.nil? command.query['pinned'] = pinned unless pinned.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil? command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil? command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil? command.query['visibility'] = visibility unless visibility.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_parent(file_id, parent_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ParentReference
Adds a parent folder for a file.
2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 |
# File 'lib/google/apis/drive_v2/service.rb', line 2158 def insert_parent(file_id, parent_reference_object = nil, enforce_single_parent: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/parents', ) command.request_representation = Google::Apis::DriveV2::ParentReference::Representation command.request_object = parent_reference_object command.response_representation = Google::Apis::DriveV2::ParentReference::Representation command.response_class = Google::Apis::DriveV2::ParentReference command.params['fileId'] = file_id unless file_id.nil? command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_permission(file_id, permission_object = nil, email_message: nil, enforce_single_parent: nil, move_to_new_owners_root: nil, send_notification_emails: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission
Inserts a permission for a file or shared drive. Warning: Concurrent permissions operations on the same file are not supported; only the last update is applied.
2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 |
# File 'lib/google/apis/drive_v2/service.rb', line 2367 def (file_id, = nil, email_message: nil, enforce_single_parent: nil, move_to_new_owners_root: nil, send_notification_emails: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/permissions', ) command.request_representation = Google::Apis::DriveV2::Permission::Representation command.request_object = command.response_representation = Google::Apis::DriveV2::Permission::Representation command.response_class = Google::Apis::DriveV2::Permission command.params['fileId'] = file_id unless file_id.nil? command.query['emailMessage'] = unless .nil? command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil? command.query['moveToNewOwnersRoot'] = move_to_new_owners_root unless move_to_new_owners_root.nil? command.query['sendNotificationEmails'] = send_notification_emails unless send_notification_emails.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_property(file_id, property_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property
Adds a property to a file, or updates it if it already exists.
2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 |
# File 'lib/google/apis/drive_v2/service.rb', line 2645 def insert_property(file_id, property_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/properties', ) command.request_representation = Google::Apis::DriveV2::Property::Representation command.request_object = property_object command.response_representation = Google::Apis::DriveV2::Property::Representation command.response_class = Google::Apis::DriveV2::Property command.params['fileId'] = file_id unless file_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_reply(file_id, comment_id, comment_reply_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply
Creates a new reply to the given comment.
2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 |
# File 'lib/google/apis/drive_v2/service.rb', line 2863 def insert_reply(file_id, comment_id, comment_reply_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/comments/{commentId}/replies', ) command.request_representation = Google::Apis::DriveV2::CommentReply::Representation command.request_object = comment_reply_object command.response_representation = Google::Apis::DriveV2::CommentReply::Representation command.response_class = Google::Apis::DriveV2::CommentReply command.params['fileId'] = file_id unless file_id.nil? command.params['commentId'] = comment_id unless comment_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_teamdrive(request_id, team_drive_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDrive
Deprecated: Use drives.insert
instead.
3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 |
# File 'lib/google/apis/drive_v2/service.rb', line 3262 def insert_teamdrive(request_id, team_drive_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'teamdrives', ) command.request_representation = Google::Apis::DriveV2::TeamDrive::Representation command.request_object = team_drive_object command.response_representation = Google::Apis::DriveV2::TeamDrive::Representation command.response_class = Google::Apis::DriveV2::TeamDrive command.query['requestId'] = request_id unless request_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_apps(app_filter_extensions: nil, app_filter_mime_types: nil, language_code: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::AppList
Lists a user's installed apps.
155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/google/apis/drive_v2/service.rb', line 155 def list_apps(app_filter_extensions: nil, app_filter_mime_types: nil, language_code: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'apps', ) command.response_representation = Google::Apis::DriveV2::AppList::Representation command.response_class = Google::Apis::DriveV2::AppList command.query['appFilterExtensions'] = app_filter_extensions unless app_filter_extensions.nil? command.query['appFilterMimeTypes'] = app_filter_mime_types unless app_filter_mime_types.nil? command.query['languageCode'] = language_code unless language_code.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_changes(drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChangeList
Lists the changes for a user or shared drive.
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/google/apis/drive_v2/service.rb', line 312 def list_changes(drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'changes', ) command.response_representation = Google::Apis::DriveV2::ChangeList::Representation command.response_class = Google::Apis::DriveV2::ChangeList command.query['driveId'] = drive_id unless drive_id.nil? command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil? command.query['includeDeleted'] = include_deleted unless include_deleted.nil? command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .nil? command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil? command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil? command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['spaces'] = spaces unless spaces.nil? command.query['startChangeId'] = start_change_id unless start_change_id.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_children(folder_id, max_results: nil, order_by: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ChildList
Lists a folder's children.
598 599 600 601 602 603 604 605 606 607 608 609 610 |
# File 'lib/google/apis/drive_v2/service.rb', line 598 def list_children(folder_id, max_results: nil, order_by: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{folderId}/children', ) command.response_representation = Google::Apis::DriveV2::ChildList::Representation command.response_class = Google::Apis::DriveV2::ChildList command.params['folderId'] = folder_id unless folder_id.nil? command.query['maxResults'] = max_results unless max_results.nil? command.query['orderBy'] = order_by unless order_by.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['q'] = q unless q.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_comments(file_id, include_deleted: nil, max_results: nil, page_token: nil, updated_min: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentList
Lists a file's comments.
745 746 747 748 749 750 751 752 753 754 755 756 757 |
# File 'lib/google/apis/drive_v2/service.rb', line 745 def list_comments(file_id, include_deleted: nil, max_results: nil, page_token: nil, updated_min: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/comments', ) command.response_representation = Google::Apis::DriveV2::CommentList::Representation command.response_class = Google::Apis::DriveV2::CommentList command.params['fileId'] = file_id unless file_id.nil? command.query['includeDeleted'] = include_deleted unless include_deleted.nil? command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['updatedMin'] = updated_min unless updated_min.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_drives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::DriveList
Lists the user's shared drives. This method accepts the q
parameter, which
is a search query combining one or more search terms. For more information,
see the Search for shared drives
guide.
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 |
# File 'lib/google/apis/drive_v2/service.rb', line 1001 def list_drives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'drives', ) command.response_representation = Google::Apis::DriveV2::DriveList::Representation command.response_class = Google::Apis::DriveV2::DriveList command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['q'] = q unless q.nil? command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_file_labels(file_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::LabelList
Lists the labels on a file.
1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 |
# File 'lib/google/apis/drive_v2/service.rb', line 1595 def list_file_labels(file_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/listLabels', ) command.response_representation = Google::Apis::DriveV2::LabelList::Representation command.response_class = Google::Apis::DriveV2::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? 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, max_results: nil, order_by: nil, page_token: nil, projection: nil, q: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::FileList
Lists the user's files. This method accepts the q
parameter, which is a
search query combining one or more search terms. For more information, see the
Search for files & folders guide. Note:
This method returns all files by default, including trashed files. If you
don't want trashed files to appear in the list, use the trashed=false
query
parameter to remove trashed files from the results.
1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 |
# File 'lib/google/apis/drive_v2/service.rb', line 1545 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, max_results: nil, order_by: nil, page_token: nil, projection: nil, q: nil, spaces: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files', ) command.response_representation = Google::Apis::DriveV2::FileList::Representation command.response_class = Google::Apis::DriveV2::FileList command.query['corpora'] = corpora unless corpora.nil? command.query['corpus'] = corpus unless corpus.nil? command.query['driveId'] = drive_id unless drive_id.nil? command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .nil? command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil? command.query['maxResults'] = max_results unless max_results.nil? command.query['orderBy'] = order_by unless order_by.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['projection'] = projection unless projection.nil? command.query['q'] = q unless q.nil? command.query['spaces'] = spaces unless spaces.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_parents(file_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ParentList
Lists a file's parents.
2193 2194 2195 2196 2197 2198 2199 2200 2201 |
# File 'lib/google/apis/drive_v2/service.rb', line 2193 def list_parents(file_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/parents', ) command.response_representation = Google::Apis::DriveV2::ParentList::Representation command.response_class = Google::Apis::DriveV2::ParentList command.params['fileId'] = file_id unless file_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_permissions(file_id, include_permissions_for_view: nil, max_results: nil, page_token: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::PermissionList
Lists a file's or shared drive's permissions.
2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 |
# File 'lib/google/apis/drive_v2/service.rb', line 2425 def (file_id, include_permissions_for_view: nil, max_results: nil, page_token: nil, supports_all_drives: nil, supports_team_drives: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/permissions', ) command.response_representation = Google::Apis::DriveV2::PermissionList::Representation command.response_class = Google::Apis::DriveV2::PermissionList command.params['fileId'] = file_id unless file_id.nil? command.query['includePermissionsForView'] = unless .nil? command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_properties(file_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::PropertyList
Lists a file's properties.
2677 2678 2679 2680 2681 2682 2683 2684 2685 |
# File 'lib/google/apis/drive_v2/service.rb', line 2677 def list_properties(file_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/properties', ) command.response_representation = Google::Apis::DriveV2::PropertyList::Representation command.response_class = Google::Apis::DriveV2::PropertyList command.params['fileId'] = file_id unless file_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_replies(file_id, comment_id, include_deleted: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReplyList
Lists all of the replies to a comment.
2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 |
# File 'lib/google/apis/drive_v2/service.rb', line 2907 def list_replies(file_id, comment_id, include_deleted: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/comments/{commentId}/replies', ) command.response_representation = Google::Apis::DriveV2::CommentReplyList::Representation command.response_class = Google::Apis::DriveV2::CommentReplyList command.params['fileId'] = file_id unless file_id.nil? command.params['commentId'] = comment_id unless comment_id.nil? command.query['includeDeleted'] = include_deleted unless include_deleted.nil? command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_revisions(file_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::RevisionList
Lists a file's revisions.
3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 |
# File 'lib/google/apis/drive_v2/service.rb', line 3090 def list_revisions(file_id, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'files/{fileId}/revisions', ) command.response_representation = Google::Apis::DriveV2::RevisionList::Representation command.response_class = Google::Apis::DriveV2::RevisionList command.params['fileId'] = file_id unless file_id.nil? command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_teamdrives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDriveList
Deprecated: Use drives.list
instead.
3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 |
# File 'lib/google/apis/drive_v2/service.rb', line 3301 def list_teamdrives(max_results: nil, page_token: nil, q: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'teamdrives', ) command.response_representation = Google::Apis::DriveV2::TeamDriveList::Representation command.response_class = Google::Apis::DriveV2::TeamDriveList command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['q'] = q unless q.nil? command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#modify_file_labels(file_id, modify_labels_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::ModifyLabelsResponse
Modifies the set of labels applied to a file. Returns a list of the labels that were added or modified.
1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 |
# File 'lib/google/apis/drive_v2/service.rb', line 1629 def modify_file_labels(file_id, modify_labels_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/modifyLabels', ) command.request_representation = Google::Apis::DriveV2::ModifyLabelsRequest::Representation command.request_object = modify_labels_request_object command.response_representation = Google::Apis::DriveV2::ModifyLabelsResponse::Representation command.response_class = Google::Apis::DriveV2::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? execute_or_queue_command(command, &block) end |
#patch_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment
Updates an existing comment.
782 783 784 785 786 787 788 789 790 791 792 793 |
# File 'lib/google/apis/drive_v2/service.rb', line 782 def patch_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}', ) command.request_representation = Google::Apis::DriveV2::Comment::Representation command.request_object = comment_object command.response_representation = Google::Apis::DriveV2::Comment::Representation command.response_class = Google::Apis::DriveV2::Comment command.params['fileId'] = file_id unless file_id.nil? command.params['commentId'] = comment_id unless comment_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::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.
1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 |
# File 'lib/google/apis/drive_v2/service.rb', line 1717 def patch_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'files/{fileId}', ) command.request_representation = Google::Apis::DriveV2::File::Representation command.request_object = file_object command.response_representation = Google::Apis::DriveV2::File::Representation command.response_class = Google::Apis::DriveV2::File command.params['fileId'] = file_id unless file_id.nil? command.query['addParents'] = add_parents unless add_parents.nil? command.query['convert'] = convert unless convert.nil? command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .nil? command.query['modifiedDateBehavior'] = modified_date_behavior unless modified_date_behavior.nil? command.query['newRevision'] = new_revision unless new_revision.nil? command.query['ocr'] = ocr unless ocr.nil? command.query['ocrLanguage'] = ocr_language unless ocr_language.nil? command.query['pinned'] = pinned unless pinned.nil? command.query['removeParents'] = remove_parents unless remove_parents.nil? command.query['setModifiedDate'] = set_modified_date unless set_modified_date.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil? command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil? command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil? command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_permission(file_id, permission_id, permission_object = nil, remove_expiration: nil, supports_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission
Updates a permission using patch semantics. Warning: Concurrent permissions operations on the same file are not supported; only the last update is applied.
2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 |
# File 'lib/google/apis/drive_v2/service.rb', line 2480 def (file_id, , = nil, remove_expiration: nil, supports_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'files/{fileId}/permissions/{permissionId}', ) command.request_representation = Google::Apis::DriveV2::Permission::Representation command.request_object = command.response_representation = Google::Apis::DriveV2::Permission::Representation command.response_class = Google::Apis::DriveV2::Permission command.params['fileId'] = file_id unless file_id.nil? command.params['permissionId'] = unless .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? execute_or_queue_command(command, &block) end |
#patch_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property
Updates a property.
2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 |
# File 'lib/google/apis/drive_v2/service.rb', line 2713 def patch_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'files/{fileId}/properties/{propertyKey}', ) command.request_representation = Google::Apis::DriveV2::Property::Representation command.request_object = property_object command.response_representation = Google::Apis::DriveV2::Property::Representation command.response_class = Google::Apis::DriveV2::Property command.params['fileId'] = file_id unless file_id.nil? command.params['propertyKey'] = property_key unless property_key.nil? command.query['visibility'] = visibility unless visibility.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply
Updates an existing reply.
2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 |
# File 'lib/google/apis/drive_v2/service.rb', line 2946 def patch_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'files/{fileId}/comments/{commentId}/replies/{replyId}', ) command.request_representation = Google::Apis::DriveV2::CommentReply::Representation command.request_object = comment_reply_object command.response_representation = Google::Apis::DriveV2::CommentReply::Representation command.response_class = Google::Apis::DriveV2::CommentReply command.params['fileId'] = file_id unless file_id.nil? command.params['commentId'] = comment_id unless comment_id.nil? command.params['replyId'] = reply_id unless reply_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Revision
Updates a revision.
3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 |
# File 'lib/google/apis/drive_v2/service.rb', line 3125 def patch_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'files/{fileId}/revisions/{revisionId}', ) command.request_representation = Google::Apis::DriveV2::Revision::Representation command.request_object = revision_object command.response_representation = Google::Apis::DriveV2::Revision::Representation command.response_class = Google::Apis::DriveV2::Revision command.params['fileId'] = file_id unless file_id.nil? command.params['revisionId'] = revision_id unless revision_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#stop_channel(channel_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Stops watching resources through this channel.
444 445 446 447 448 449 450 451 |
# File 'lib/google/apis/drive_v2/service.rb', line 444 def stop_channel(channel_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'channels/stop', ) command.request_representation = Google::Apis::DriveV2::Channel::Representation command.request_object = channel_object command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#touch_file(file_id, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Set the file's updated time to the current server time.
1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 |
# File 'lib/google/apis/drive_v2/service.rb', line 1777 def touch_file(file_id, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/touch', ) command.response_representation = Google::Apis::DriveV2::File::Representation command.response_class = Google::Apis::DriveV2::File command.params['fileId'] = file_id unless file_id.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .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? execute_or_queue_command(command, &block) end |
#trash_file(file_id, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Moves a file to the trash. The currently authenticated user must own the file
or be at least a fileOrganizer
on the parent for shared drive files.
1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 |
# File 'lib/google/apis/drive_v2/service.rb', line 1822 def trash_file(file_id, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/trash', ) command.response_representation = Google::Apis::DriveV2::File::Representation command.response_class = Google::Apis::DriveV2::File command.params['fileId'] = file_id unless file_id.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .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? execute_or_queue_command(command, &block) end |
#unhide_drive(drive_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive
Restores a shared drive to the default view.
1034 1035 1036 1037 1038 1039 1040 1041 1042 |
# File 'lib/google/apis/drive_v2/service.rb', line 1034 def unhide_drive(drive_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'drives/{driveId}/unhide', ) command.response_representation = Google::Apis::DriveV2::Drive::Representation command.response_class = Google::Apis::DriveV2::Drive command.params['driveId'] = drive_id unless drive_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#untrash_file(file_id, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::File
Restores a file from the trash. The currently authenticated user must own the
file or be at least a fileOrganizer
on the parent for shared drive files.
1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 |
# File 'lib/google/apis/drive_v2/service.rb', line 1867 def untrash_file(file_id, include_labels: nil, include_permissions_for_view: nil, supports_all_drives: nil, supports_team_drives: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/untrash', ) command.response_representation = Google::Apis::DriveV2::File::Representation command.response_class = Google::Apis::DriveV2::File command.params['fileId'] = file_id unless file_id.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .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? execute_or_queue_command(command, &block) end |
#update_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Comment
Updates an existing comment.
818 819 820 821 822 823 824 825 826 827 828 829 |
# File 'lib/google/apis/drive_v2/service.rb', line 818 def update_comment(file_id, comment_id, comment_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'files/{fileId}/comments/{commentId}', ) command.request_representation = Google::Apis::DriveV2::Comment::Representation command.request_object = comment_object command.response_representation = Google::Apis::DriveV2::Comment::Representation command.response_class = Google::Apis::DriveV2::Comment command.params['fileId'] = file_id unless file_id.nil? command.params['commentId'] = comment_id unless comment_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_drive(drive_id, drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Drive
Updates the metadata for a shared drive.
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 |
# File 'lib/google/apis/drive_v2/service.rb', line 1069 def update_drive(drive_id, drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'drives/{driveId}', ) command.request_representation = Google::Apis::DriveV2::Drive::Representation command.request_object = drive_object command.response_representation = Google::Apis::DriveV2::Drive::Representation command.response_class = Google::Apis::DriveV2::Drive command.params['driveId'] = drive_id unless drive_id.nil? command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::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 be changed automatically, such as modifiedDate
. This
method supports patch semantics. This method supports an /upload URI and
accepts uploaded media with the following characteristics: - Maximum file
size: 5,120 GB - Accepted Media MIME types:*/*
Note: Specify a valid MIME
type, rather than the literal */*
value. The literal */*
is only used to
indicate that any valid MIME type can be uploaded. For more information on
uploading files, see Upload file data.
1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 |
# File 'lib/google/apis/drive_v2/service.rb', line 1964 def update_file(file_id, file_object = nil, add_parents: nil, convert: nil, enforce_single_parent: nil, include_labels: nil, include_permissions_for_view: nil, modified_date_behavior: nil, new_revision: nil, ocr: nil, ocr_language: nil, pinned: nil, remove_parents: nil, set_modified_date: nil, supports_all_drives: nil, supports_team_drives: nil, timed_text_language: nil, timed_text_track_name: nil, update_viewed_date: nil, use_content_as_indexable_text: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block) if upload_source.nil? command = make_simple_command(:put, 'files/{fileId}', ) else command = make_upload_command(:put, 'files/{fileId}', ) command.upload_source = upload_source command.upload_content_type = content_type end command.request_representation = Google::Apis::DriveV2::File::Representation command.request_object = file_object command.response_representation = Google::Apis::DriveV2::File::Representation command.response_class = Google::Apis::DriveV2::File command.params['fileId'] = file_id unless file_id.nil? command.query['addParents'] = add_parents unless add_parents.nil? command.query['convert'] = convert unless convert.nil? command.query['enforceSingleParent'] = enforce_single_parent unless enforce_single_parent.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .nil? command.query['modifiedDateBehavior'] = modified_date_behavior unless modified_date_behavior.nil? command.query['newRevision'] = new_revision unless new_revision.nil? command.query['ocr'] = ocr unless ocr.nil? command.query['ocrLanguage'] = ocr_language unless ocr_language.nil? command.query['pinned'] = pinned unless pinned.nil? command.query['removeParents'] = remove_parents unless remove_parents.nil? command.query['setModifiedDate'] = set_modified_date unless set_modified_date.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['timedTextLanguage'] = timed_text_language unless timed_text_language.nil? command.query['timedTextTrackName'] = timed_text_track_name unless timed_text_track_name.nil? command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil? command.query['useContentAsIndexableText'] = use_content_as_indexable_text unless use_content_as_indexable_text.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? 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, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Permission
Updates a permission. Warning: Concurrent permissions operations on the same file are not supported; only the last update is applied.
2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 |
# File 'lib/google/apis/drive_v2/service.rb', line 2536 def (file_id, , = nil, remove_expiration: nil, supports_all_drives: nil, supports_team_drives: nil, transfer_ownership: nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'files/{fileId}/permissions/{permissionId}', ) command.request_representation = Google::Apis::DriveV2::Permission::Representation command.request_object = command.response_representation = Google::Apis::DriveV2::Permission::Representation command.response_class = Google::Apis::DriveV2::Permission command.params['fileId'] = file_id unless file_id.nil? command.params['permissionId'] = unless .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? execute_or_queue_command(command, &block) end |
#update_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Property
Updates a property.
2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 |
# File 'lib/google/apis/drive_v2/service.rb', line 2753 def update_property(file_id, property_key, property_object = nil, visibility: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'files/{fileId}/properties/{propertyKey}', ) command.request_representation = Google::Apis::DriveV2::Property::Representation command.request_object = property_object command.response_representation = Google::Apis::DriveV2::Property::Representation command.response_class = Google::Apis::DriveV2::Property command.params['fileId'] = file_id unless file_id.nil? command.params['propertyKey'] = property_key unless property_key.nil? command.query['visibility'] = visibility unless visibility.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::CommentReply
Updates an existing reply.
2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 |
# File 'lib/google/apis/drive_v2/service.rb', line 2985 def update_reply(file_id, comment_id, reply_id, comment_reply_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'files/{fileId}/comments/{commentId}/replies/{replyId}', ) command.request_representation = Google::Apis::DriveV2::CommentReply::Representation command.request_object = comment_reply_object command.response_representation = Google::Apis::DriveV2::CommentReply::Representation command.response_class = Google::Apis::DriveV2::CommentReply command.params['fileId'] = file_id unless file_id.nil? command.params['commentId'] = comment_id unless comment_id.nil? command.params['replyId'] = reply_id unless reply_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Revision
Updates a revision.
3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 |
# File 'lib/google/apis/drive_v2/service.rb', line 3161 def update_revision(file_id, revision_id, revision_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'files/{fileId}/revisions/{revisionId}', ) command.request_representation = Google::Apis::DriveV2::Revision::Representation command.request_object = revision_object command.response_representation = Google::Apis::DriveV2::Revision::Representation command.response_class = Google::Apis::DriveV2::Revision command.params['fileId'] = file_id unless file_id.nil? command.params['revisionId'] = revision_id unless revision_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? 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, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::TeamDrive
Deprecated: Use drives.update
instead.
3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 |
# File 'lib/google/apis/drive_v2/service.rb', line 3339 def update_teamdrive(team_drive_id, team_drive_object = nil, use_domain_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'teamdrives/{teamDriveId}', ) command.request_representation = Google::Apis::DriveV2::TeamDrive::Representation command.request_object = team_drive_object command.response_representation = Google::Apis::DriveV2::TeamDrive::Representation command.response_class = Google::Apis::DriveV2::TeamDrive command.params['teamDriveId'] = team_drive_id unless team_drive_id.nil? command.query['useDomainAdminAccess'] = use_domain_admin_access unless use_domain_admin_access.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#watch_change(channel_object = nil, drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Channel
Subscribe to changes for a user.
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 |
# File 'lib/google/apis/drive_v2/service.rb', line 399 def watch_change(channel_object = nil, drive_id: nil, include_corpus_removals: nil, include_deleted: nil, include_items_from_all_drives: nil, include_labels: nil, include_permissions_for_view: nil, include_subscribed: nil, include_team_drive_items: nil, max_results: nil, page_token: nil, spaces: nil, start_change_id: nil, supports_all_drives: nil, supports_team_drives: nil, team_drive_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'changes/watch', ) command.request_representation = Google::Apis::DriveV2::Channel::Representation command.request_object = channel_object command.response_representation = Google::Apis::DriveV2::Channel::Representation command.response_class = Google::Apis::DriveV2::Channel command.query['driveId'] = drive_id unless drive_id.nil? command.query['includeCorpusRemovals'] = include_corpus_removals unless include_corpus_removals.nil? command.query['includeDeleted'] = include_deleted unless include_deleted.nil? command.query['includeItemsFromAllDrives'] = include_items_from_all_drives unless include_items_from_all_drives.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .nil? command.query['includeSubscribed'] = include_subscribed unless include_subscribed.nil? command.query['includeTeamDriveItems'] = include_team_drive_items unless include_team_drive_items.nil? command.query['maxResults'] = max_results unless max_results.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['spaces'] = spaces unless spaces.nil? command.query['startChangeId'] = start_change_id unless start_change_id.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['teamDriveId'] = team_drive_id unless team_drive_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? 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, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DriveV2::Channel
Subscribes to changes to a file.
2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 |
# File 'lib/google/apis/drive_v2/service.rb', line 2042 def watch_file(file_id, channel_object = nil, acknowledge_abuse: nil, include_labels: nil, include_permissions_for_view: nil, projection: nil, revision_id: nil, supports_all_drives: nil, supports_team_drives: nil, update_viewed_date: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'files/{fileId}/watch', ) command.request_representation = Google::Apis::DriveV2::Channel::Representation command.request_object = channel_object command.response_representation = Google::Apis::DriveV2::Channel::Representation command.response_class = Google::Apis::DriveV2::Channel command.params['fileId'] = file_id unless file_id.nil? command.query['acknowledgeAbuse'] = acknowledge_abuse unless acknowledge_abuse.nil? command.query['includeLabels'] = include_labels unless include_labels.nil? command.query['includePermissionsForView'] = unless .nil? command.query['projection'] = projection unless projection.nil? command.query['revisionId'] = revision_id unless revision_id.nil? command.query['supportsAllDrives'] = supports_all_drives unless supports_all_drives.nil? command.query['supportsTeamDrives'] = supports_team_drives unless supports_team_drives.nil? command.query['updateViewedDate'] = update_viewed_date unless update_viewed_date.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |