Methods summary
public
Google_Service_Drive_DriveFile
|
#
copy( string $fileId, Google_Service_Drive_DriveFile $postBody, array $optParams = array() )
Creates a copy of the specified file. (files.copy)
Creates a copy of the specified file. (files.copy)
Parameters
- $fileId
- The ID of the file to copy.
- $postBody
- $optParams
- Optional parameters.
Returns
Opt_param
bool convert Whether to convert this file to the corresponding Google Docs
format.
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 ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
string ocrLanguage If ocr is true, hints at the language to use. Valid values
are BCP 47 codes.
bool pinned Whether to pin the head revision of the new copy. A file can have a
maximum of 200 pinned revisions.
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 timedTextLanguage The language of the timed text.
string timedTextTrackName The timed text track name.
string visibility The visibility of the new file. This parameter is only
relevant when the source is not a native Google Doc and convert=false.
|
public
|
#
delete( string $fileId, array $optParams = array() )
Permanently deletes a file by ID. Skips the trash. The currently
authenticated user must own the file or be an organizer on the parent for shared
drive files. (files.delete)
Permanently deletes a file by ID. Skips the trash. The currently
authenticated user must own the file or be an organizer on the parent for shared
drive files. (files.delete)
Parameters
- $fileId
- The ID of the file to delete.
- $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 insert or copy requests.
(files.generateIds)
Generates a set of file IDs which can be provided in insert or copy requests.
(files.generateIds)
Parameters
- $optParams
- Optional parameters.
Returns
Opt_param
int maxResults Maximum 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 by ID. (files.get)
Gets a file's metadata by ID. (files.get)
Parameters
- $fileId
- The ID for the file in question.
- $optParams
- Optional parameters.
Returns
Opt_param
bool acknowledgeAbuse Whether the user is acknowledging the risk of downloading
known malware or other abusive files.
string projection This parameter is deprecated and has no function.
string revisionId Specifies the Revision ID that should be downloaded. Ignored
unless alt=media is specified.
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 updateViewedDate Deprecated: Use files.update with
modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
|
public
Google_Service_Drive_DriveFile
|
#
insert( Google_Service_Drive_DriveFile $postBody, array $optParams = array() )
Insert a new file. (files.insert)
Insert a new file. (files.insert)
Parameters
- $postBody
- $optParams
- Optional parameters.
Returns
Opt_param
bool convert Whether to convert this file to the corresponding Google Docs
format.
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 ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
string ocrLanguage If ocr is true, hints at the language to use. Valid values
are BCP 47 codes.
bool pinned Whether to pin the head revision of the uploaded file. A file can
have a maximum of 200 pinned revisions.
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 timedTextLanguage The language of the timed text.
string timedTextTrackName The timed text track name.
bool useContentAsIndexableText Whether to use the content as indexable text.
string visibility The visibility of the new file. This parameter is only
relevant when convert=false.
|
public
Google_Service_Drive_FileList
|
#
listFiles( array $optParams = array() )
Lists the user's files. (files.listFiles)
Lists the user's files. (files.listFiles)
Parameters
- $optParams
- Optional parameters.
Returns
Opt_param
string corpora Bodies of items (files/documents) to which the query applies.
Supported bodies are 'default', 'domain', 'drive' and 'allDrives'. Prefer
'default' or 'drive' to 'allDrives' for efficiency.
string corpus The body of items (files/documents) to which the query applies.
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.
int maxResults 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 orderBy A comma-separated list of sort keys. Valid keys are
'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate',
'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred',
'title', and 'title_natural'. Each key sorts ascending by default, but may be
reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate
desc,title. Please note that there is a current limitation for users with
approximately one million files in which the requested sort order is ignored.
string pageToken Page token for files.
string projection This parameter is deprecated and has no function.
string q Query string for searching files.
string spaces A comma-separated list of spaces to query. 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
|
#
patch( string $fileId, Google_Service_Drive_DriveFile $postBody, array $optParams = array() )
Updates file metadata and/or content. This method supports patch semantics.
(files.patch)
Updates file metadata and/or content. This method supports patch semantics.
(files.patch)
Parameters
- $fileId
- The ID of the file to update.
- $postBody
- $optParams
- Optional parameters.
Returns
Opt_param
string addParents Comma-separated list of parent IDs to add.
bool convert This parameter is deprecated and has no function.
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.
string modifiedDateBehavior Determines the behavior in which modifiedDate is
updated. This overrides setModifiedDate.
bool newRevision Whether a blob upload should create a new revision. If false,
the blob data in the current head revision is replaced. If true or not set, a
new blob is created as head revision, and previous unpinned revisions are
preserved for a short period of time. Pinned revisions are stored indefinitely,
using additional storage quota, up to a maximum of 200 revisions. For details on
how revisions are retained, see the Drive Help Center.
bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
string ocrLanguage If ocr is true, hints at the language to use. Valid values
are BCP 47 codes.
bool pinned Whether to pin the new revision. A file can have a maximum of 200
pinned revisions.
string removeParents Comma-separated list of parent IDs to remove.
bool setModifiedDate Whether to set the modified date using the value supplied
in the request body. Setting this field to true is equivalent to
modifiedDateBehavior=fromBodyOrNow, and false is equivalent to
modifiedDateBehavior=now. To prevent any changes to the modified date set
modifiedDateBehavior=noChange.
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 timedTextLanguage The language of the timed text.
string timedTextTrackName The timed text track name.
bool updateViewedDate Whether to update the view date after successfully
updating the file.
bool useContentAsIndexableText Whether to use the content as indexable text.
|
public
Google_Service_Drive_DriveFile
|
#
touch( string $fileId, array $optParams = array() )
Set the file's updated time to the current server time. (files.touch)
Set the file's updated time to the current server time. (files.touch)
Parameters
- $fileId
- The ID of the file to update.
- $optParams
- Optional parameters.
Returns
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
Google_Service_Drive_DriveFile
|
#
trash( string $fileId, array $optParams = array() )
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.
(files.trash)
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.
(files.trash)
Parameters
- $fileId
- The ID of the file to trash.
- $optParams
- Optional parameters.
Returns
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
Google_Service_Drive_DriveFile
|
#
untrash( string $fileId, array $optParams = array() )
Restores a file from the trash. (files.untrash)
Restores a file from the trash. (files.untrash)
Parameters
- $fileId
- The ID of the file to untrash.
- $optParams
- Optional parameters.
Returns
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
Google_Service_Drive_DriveFile
|
#
update( string $fileId, Google_Service_Drive_DriveFile $postBody, array $optParams = array() )
Updates file metadata and/or content. (files.update)
Updates file metadata and/or content. (files.update)
Parameters
- $fileId
- The ID of the file to update.
- $postBody
- $optParams
- Optional parameters.
Returns
Opt_param
string addParents Comma-separated list of parent IDs to add.
bool convert This parameter is deprecated and has no function.
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.
string modifiedDateBehavior Determines the behavior in which modifiedDate is
updated. This overrides setModifiedDate.
bool newRevision Whether a blob upload should create a new revision. If false,
the blob data in the current head revision is replaced. If true or not set, a
new blob is created as head revision, and previous unpinned revisions are
preserved for a short period of time. Pinned revisions are stored indefinitely,
using additional storage quota, up to a maximum of 200 revisions. For details on
how revisions are retained, see the Drive Help Center.
bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
string ocrLanguage If ocr is true, hints at the language to use. Valid values
are BCP 47 codes.
bool pinned Whether to pin the new revision. A file can have a maximum of 200
pinned revisions.
string removeParents Comma-separated list of parent IDs to remove.
bool setModifiedDate Whether to set the modified date using the value supplied
in the request body. Setting this field to true is equivalent to
modifiedDateBehavior=fromBodyOrNow, and false is equivalent to
modifiedDateBehavior=now. To prevent any changes to the modified date set
modifiedDateBehavior=noChange.
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 timedTextLanguage The language of the timed text.
string timedTextTrackName The timed text track name.
bool updateViewedDate Whether to update the view date after successfully
updating the file.
bool useContentAsIndexableText Whether to use the content as indexable text.
|
public
Google_Service_Drive_Channel
|
#
watch( string $fileId, Google_Service_Drive_Channel $postBody, array $optParams = array() )
Subscribe to changes on a file (files.watch)
Subscribe to changes on a file (files.watch)
Parameters
- $fileId
- The ID for the file in question.
- $postBody
- $optParams
- Optional parameters.
Returns
Opt_param
bool acknowledgeAbuse Whether the user is acknowledging the risk of downloading
known malware or other abusive files.
string projection This parameter is deprecated and has no function.
string revisionId Specifies the Revision ID that should be downloaded. Ignored
unless alt=media is specified.
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 updateViewedDate Deprecated: Use files.update with
modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
|