Overview

Classes

  • Google_Service_Drive
  • Google_Service_Drive_About
  • Google_Service_Drive_About_Resource
  • Google_Service_Drive_AboutDriveThemes
  • Google_Service_Drive_AboutStorageQuota
  • Google_Service_Drive_AboutTeamDriveThemes
  • Google_Service_Drive_Change
  • Google_Service_Drive_ChangeList
  • Google_Service_Drive_Changes_Resource
  • Google_Service_Drive_Channel
  • Google_Service_Drive_Channels_Resource
  • Google_Service_Drive_Comment
  • Google_Service_Drive_CommentList
  • Google_Service_Drive_CommentQuotedFileContent
  • Google_Service_Drive_Comments_Resource
  • Google_Service_Drive_Drive
  • Google_Service_Drive_DriveBackgroundImageFile
  • Google_Service_Drive_DriveCapabilities
  • Google_Service_Drive_DriveFile
  • Google_Service_Drive_DriveFileCapabilities
  • Google_Service_Drive_DriveFileContentHints
  • Google_Service_Drive_DriveFileContentHintsThumbnail
  • Google_Service_Drive_DriveFileImageMediaMetadata
  • Google_Service_Drive_DriveFileImageMediaMetadataLocation
  • Google_Service_Drive_DriveFileShortcutDetails
  • Google_Service_Drive_DriveFileVideoMediaMetadata
  • Google_Service_Drive_DriveList
  • Google_Service_Drive_DriveRestrictions
  • Google_Service_Drive_Drives_Resource
  • Google_Service_Drive_FileList
  • Google_Service_Drive_Files_Resource
  • Google_Service_Drive_GeneratedIds
  • Google_Service_Drive_Permission
  • Google_Service_Drive_PermissionList
  • Google_Service_Drive_PermissionPermissionDetails
  • Google_Service_Drive_Permissions_Resource
  • Google_Service_Drive_PermissionTeamDrivePermissionDetails
  • Google_Service_Drive_Replies_Resource
  • Google_Service_Drive_Reply
  • Google_Service_Drive_ReplyList
  • Google_Service_Drive_Revision
  • Google_Service_Drive_RevisionList
  • Google_Service_Drive_Revisions_Resource
  • Google_Service_Drive_StartPageToken
  • Google_Service_Drive_TeamDrive
  • Google_Service_Drive_TeamDriveBackgroundImageFile
  • Google_Service_Drive_TeamDriveCapabilities
  • Google_Service_Drive_TeamDriveList
  • Google_Service_Drive_TeamDriveRestrictions
  • Google_Service_Drive_Teamdrives_Resource
  • Google_Service_Drive_User
  • Overview
  • Class
  • Tree

Class Google_Service_Drive_Files_Resource

The "files" collection of methods. Typical usage is:

 $driveService = new Google_Service_Drive(...);
 $files = $driveService->files;
Google_Service_Resource
Extended by Google_Service_Drive_Files_Resource
Located at Drive.php
Methods summary
public Google_Service_Drive_DriveFile
# copy( string $fileId, Google_Service_Drive_DriveFile $postBody, array $optParams = array() )

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

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

Parameters

$fileId
The ID of the file.
$postBody
$optParams
Optional parameters.

Returns

Google_Service_Drive_DriveFile
Google_Service_Drive_DriveFile

Opt_param

bool enforceSingleParent Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. Requests that specify more than one parent will fail.
bool ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.
bool keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.
string ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code).
bool supportsAllDrives Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
bool supportsTeamDrives Deprecated use supportsAllDrives instead.
public Google_Service_Drive_DriveFile
# create( Google_Service_Drive_DriveFile $postBody, array $optParams = array() )

Creates a new file. (files.create)

Creates a new file. (files.create)

Parameters

$postBody
$optParams
Optional parameters.

Returns

Google_Service_Drive_DriveFile
Google_Service_Drive_DriveFile

Opt_param

bool enforceSingleParent Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. Requests that specify more than one parent will fail.
bool ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.
bool keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.
string ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code).
bool supportsAllDrives Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
bool supportsTeamDrives Deprecated use supportsAllDrives instead.
bool useContentAsIndexableText Whether to use the uploaded content as indexable text.
public
# delete( string $fileId, array $optParams = array() )

Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted. (files.delete)

Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted. (files.delete)

Parameters

$fileId
The ID of the file.
$optParams
Optional parameters.

Opt_param

bool supportsAllDrives Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
bool supportsTeamDrives Deprecated use supportsAllDrives instead.
public
# emptyTrash( array $optParams = array() )

Permanently deletes all of the user's trashed files. (files.emptyTrash)

Permanently deletes all of the user's trashed files. (files.emptyTrash)

Parameters

$optParams
Optional parameters.
public
# export( string $fileId, string $mimeType, array $optParams = array() )

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

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

Parameters

$fileId
The ID of the file.
$mimeType
The MIME type of the format requested for this export.
$optParams
Optional parameters.
public Google_Service_Drive_GeneratedIds
# generateIds( array $optParams = array() )

Generates a set of file IDs which can be provided in create or copy requests. (files.generateIds)

Generates a set of file IDs which can be provided in create or copy requests. (files.generateIds)

Parameters

$optParams
Optional parameters.

Returns

Google_Service_Drive_GeneratedIds
Google_Service_Drive_GeneratedIds

Opt_param

int count The number of IDs to return.
string space The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.
public Google_Service_Drive_DriveFile
# get( string $fileId, array $optParams = array() )

Gets a file's metadata or content by ID. (files.get)

Gets a file's metadata or content by ID. (files.get)

Parameters

$fileId
The ID of the file.
$optParams
Optional parameters.

Returns

Google_Service_Drive_DriveFile
Google_Service_Drive_DriveFile

Opt_param

bool acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
bool supportsAllDrives Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
bool supportsTeamDrives Deprecated use supportsAllDrives instead.
public Google_Service_Drive_FileList
# listFiles( array $optParams = array() )

Lists or searches files. (files.listFiles)

Lists or searches files. (files.listFiles)

Parameters

$optParams
Optional parameters.

Returns

Google_Service_Drive_FileList
Google_Service_Drive_FileList

Opt_param

string corpora Bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'drive' and 'allDrives'. Prefer 'user' or 'drive' to 'allDrives' for efficiency.
string corpus The source of files to list. Deprecated: use 'corpora' instead.
string driveId ID of the shared drive to search.
bool includeItemsFromAllDrives Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items will be included in the results.
bool includeTeamDriveItems Deprecated use includeItemsFromAllDrives instead.
string orderBy A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.
int pageSize The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached.
string pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.
string q A query for filtering the file results. See the "Search for Files" guide for supported syntax.
string spaces A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
bool supportsAllDrives Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
bool supportsTeamDrives Deprecated use supportsAllDrives instead.
string teamDriveId Deprecated use driveId instead.
public Google_Service_Drive_DriveFile
# update( string $fileId, Google_Service_Drive_DriveFile $postBody, array $optParams = array() )

Updates a file's metadata and/or content with patch semantics. (files.update)

Updates a file's metadata and/or content with patch semantics. (files.update)

Parameters

$fileId
The ID of the file.
$postBody
$optParams
Optional parameters.

Returns

Google_Service_Drive_DriveFile
Google_Service_Drive_DriveFile

Opt_param

string addParents A comma-separated list of parent IDs to add.
bool enforceSingleParent Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If the item's owner makes a request to add a single parent, the item will be removed from all current folders and placed in the requested folder. Other requests that increase the number of parents will fail, except when the canAddMyDriveParent file capability is true and a single parent is being added.
bool keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.
string ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code).
string removeParents A comma-separated list of parent IDs to remove.
bool supportsAllDrives Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
bool supportsTeamDrives Deprecated use supportsAllDrives instead.
bool useContentAsIndexableText Whether to use the uploaded content as indexable text.
public Google_Service_Drive_Channel
# watch( string $fileId, Google_Service_Drive_Channel $postBody, array $optParams = array() )

Subscribes to changes to a file (files.watch)

Subscribes to changes to a file (files.watch)

Parameters

$fileId
The ID of the file.
$postBody
$optParams
Optional parameters.

Returns

Google_Service_Drive_Channel
Google_Service_Drive_Channel

Opt_param

bool acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
bool supportsAllDrives Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
bool supportsTeamDrives Deprecated use supportsAllDrives instead.
© 2020 Google Inc.
Drive API documentation generated by ApiGen 2.8.0