Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
Google_Service_Drive_Files_Resource Class Reference

The "files" collection of methods. More...

Inheritance diagram for Google_Service_Drive_Files_Resource:
Google_Service_Resource

Public Member Functions

 call ($name, $arguments, $expected_class=null)
 TODO: This function needs simplifying.
 
 copy ($fileId, Google_Service_Drive_DriveFile $postBody, $optParams=array())
 Creates a copy of the specified file.
 
 delete ($fileId, $optParams=array())
 Permanently deletes a file by ID.
 
 emptyTrash ($optParams=array())
 Permanently deletes all of the user's trashed files.
 
 generateIds ($optParams=array())
 Generates a set of file IDs which can be provided in insert requests.
 
 get ($fileId, $optParams=array())
 Gets a file's metadata by ID.
 
 insert (Google_Service_Drive_DriveFile $postBody, $optParams=array())
 Insert a new file.
 
 listFiles ($optParams=array())
 Lists the user's files.
 
 patch ($fileId, Google_Service_Drive_DriveFile $postBody, $optParams=array())
 Updates file metadata and/or content.
 
 touch ($fileId, $optParams=array())
 Set the file's updated time to the current server time.
 
 trash ($fileId, $optParams=array())
 Moves a file to the trash.
 
 untrash ($fileId, $optParams=array())
 Restores a file from the trash.
 
 update ($fileId, Google_Service_Drive_DriveFile $postBody, $optParams=array())
 Updates file metadata and/or content.
 
 watch ($fileId, Google_Service_Drive_Channel $postBody, $optParams=array())
 Subscribe to changes on a file (files.watch)
 

Protected Member Functions

 convertToArrayAndStripNulls ($o)
 

Detailed Description

The "files" collection of methods.

Typical usage is: $driveService = new Google_Service_Drive(...); $files = $driveService->files;

Member Function Documentation

◆ call()

Google_Service_Resource::call ( $name,
$arguments,
$expected_class = null )
inherited

TODO: This function needs simplifying.

Parameters
$name
$arguments
$expected_class- optional, the expected class name
Return values
Google_Http_Request|expected_class
Exceptions
Google_Exception

◆ copy()

Google_Service_Drive_Files_Resource::copy ( $fileId,
Google_Service_Drive_DriveFile $postBody,
$optParams = array() )

Creates a copy of the specified file.

(files.copy)

Parameters
string$fileIdThe ID of the file to copy.
Google_DriveFile$postBody
array$optParamsOptional parameters.

@opt_param bool convert Whether to convert this file to the corresponding Google Docs format. @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. @opt_param 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. @opt_param bool pinned Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions. @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. @opt_param string timedTextTrackName The timed text track name. @opt_param string timedTextLanguage The language of the timed text.

Return values
Google_Service_Drive_DriveFile

◆ delete()

Google_Service_Drive_Files_Resource::delete ( $fileId,
$optParams = array() )

Permanently deletes a file by ID.

Skips the trash. The currently authenticated user must own the file. (files.delete)

Parameters
string$fileIdThe ID of the file to delete.
array$optParamsOptional parameters.

◆ emptyTrash()

Google_Service_Drive_Files_Resource::emptyTrash ( $optParams = array())

Permanently deletes all of the user's trashed files.

(files.emptyTrash)

Parameters
array$optParamsOptional parameters.

◆ generateIds()

Google_Service_Drive_Files_Resource::generateIds ( $optParams = array())

Generates a set of file IDs which can be provided in insert requests.

(files.generateIds)

Parameters
array$optParamsOptional parameters.

@opt_param int maxResults Maximum number of IDs to return. @opt_param string space The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.

Return values
Google_Service_Drive_GeneratedIds

◆ get()

Google_Service_Drive_Files_Resource::get ( $fileId,
$optParams = array() )

Gets a file's metadata by ID.

(files.get)

Parameters
string$fileIdThe ID for the file in question.
array$optParamsOptional parameters.

@opt_param bool acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. @opt_param bool updateViewedDate Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. @opt_param string revisionId Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. @opt_param string projection This parameter is deprecated and has no function.

Return values
Google_Service_Drive_DriveFile

◆ insert()

Google_Service_Drive_Files_Resource::insert ( Google_Service_Drive_DriveFile $postBody,
$optParams = array() )

Insert a new file.

(files.insert)

Parameters
Google_DriveFile$postBody
array$optParamsOptional parameters.

@opt_param bool convert Whether to convert this file to the corresponding Google Docs format. @opt_param bool useContentAsIndexableText Whether to use the content as indexable text. @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. @opt_param string visibility The visibility of the new file. This parameter is only relevant when convert=false. @opt_param bool pinned Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions. @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. @opt_param string timedTextTrackName The timed text track name. @opt_param string timedTextLanguage The language of the timed text.

Return values
Google_Service_Drive_DriveFile

◆ listFiles()

Google_Service_Drive_Files_Resource::listFiles ( $optParams = array())

Lists the user's files.

(files.listFiles)

Parameters
array$optParamsOptional parameters.

@opt_param string orderBy A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. 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. @opt_param string projection This parameter is deprecated and has no function. @opt_param int maxResults Maximum number of files to return. @opt_param string q Query string for searching files. @opt_param string pageToken Page token for files. @opt_param string spaces A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. @opt_param string corpus The body of items (files/documents) to which the query applies.

Return values
Google_Service_Drive_FileList

◆ patch()

Google_Service_Drive_Files_Resource::patch ( $fileId,
Google_Service_Drive_DriveFile $postBody,
$optParams = array() )

Updates file metadata and/or content.

This method supports patch semantics. (files.patch)

Parameters
string$fileIdThe ID of the file to update.
Google_DriveFile$postBody
array$optParamsOptional parameters.

@opt_param string addParents Comma-separated list of parent IDs to add. @opt_param string modifiedDateBehavior Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate. @opt_param string removeParents Comma-separated list of parent IDs to remove. @opt_param bool updateViewedDate Whether to update the view date after successfully updating the file. @opt_param bool setModifiedDate Whether to set the modified date with the supplied modified date. @opt_param bool useContentAsIndexableText Whether to use the content as indexable text. @opt_param bool convert This parameter is deprecated and has no function. @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. @opt_param bool pinned Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. @opt_param 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. @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. @opt_param string timedTextLanguage The language of the timed text. @opt_param string timedTextTrackName The timed text track name.

Return values
Google_Service_Drive_DriveFile

◆ touch()

Google_Service_Drive_Files_Resource::touch ( $fileId,
$optParams = array() )

Set the file's updated time to the current server time.

(files.touch)

Parameters
string$fileIdThe ID of the file to update.
array$optParamsOptional parameters.
Return values
Google_Service_Drive_DriveFile

◆ trash()

Google_Service_Drive_Files_Resource::trash ( $fileId,
$optParams = array() )

Moves a file to the trash.

The currently authenticated user must own the file. (files.trash)

Parameters
string$fileIdThe ID of the file to trash.
array$optParamsOptional parameters.
Return values
Google_Service_Drive_DriveFile

◆ untrash()

Google_Service_Drive_Files_Resource::untrash ( $fileId,
$optParams = array() )

Restores a file from the trash.

(files.untrash)

Parameters
string$fileIdThe ID of the file to untrash.
array$optParamsOptional parameters.
Return values
Google_Service_Drive_DriveFile

◆ update()

Google_Service_Drive_Files_Resource::update ( $fileId,
Google_Service_Drive_DriveFile $postBody,
$optParams = array() )

Updates file metadata and/or content.

(files.update)

Parameters
string$fileIdThe ID of the file to update.
Google_DriveFile$postBody
array$optParamsOptional parameters.

@opt_param string addParents Comma-separated list of parent IDs to add. @opt_param string modifiedDateBehavior Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate. @opt_param string removeParents Comma-separated list of parent IDs to remove. @opt_param bool updateViewedDate Whether to update the view date after successfully updating the file. @opt_param bool setModifiedDate Whether to set the modified date with the supplied modified date. @opt_param bool useContentAsIndexableText Whether to use the content as indexable text. @opt_param bool convert This parameter is deprecated and has no function. @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. @opt_param bool pinned Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. @opt_param 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. @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. @opt_param string timedTextLanguage The language of the timed text. @opt_param string timedTextTrackName The timed text track name.

Return values
Google_Service_Drive_DriveFile

◆ watch()

Google_Service_Drive_Files_Resource::watch ( $fileId,
Google_Service_Drive_Channel $postBody,
$optParams = array() )

Subscribe to changes on a file (files.watch)

Parameters
string$fileIdThe ID for the file in question.
Google_Channel$postBody
array$optParamsOptional parameters.

@opt_param bool acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. @opt_param bool updateViewedDate Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. @opt_param string revisionId Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. @opt_param string projection This parameter is deprecated and has no function.

Return values
Google_Service_Drive_Channel

The documentation for this class was generated from the following file: