Files
extends Resource
in package
The "files" collection of methods.
Typical usage is:
$driveService = new Google\Service\Drive(...);
$files = $driveService->files;
Table of Contents
Properties
- $client : Client
- $methods : array<string|int, mixed>
- $resourceName : string
- $rootUrl : string
- $serviceName : string
- $servicePath : string
- $stackParameters : mixed
Methods
- __construct() : mixed
- call() : mixed
- TODO: This function needs simplifying.
- copy() : DriveFile
- Creates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied. (files.copy)
- create() : DriveFile
- Creates a new file. (files.create)
- createRequestUri() : string
- Parse/expand request parameters and create a fully qualified request uri.
- delete() : mixed
- Permanently deletes a file owned by the user without moving it to the trash.
- emptyTrash() : mixed
- Permanently deletes all of the user's trashed files. (files.emptyTrash)
- export() : mixed
- Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.
- generateIds() : GeneratedIds
- Generates a set of file IDs which can be provided in create or copy requests.
- get() : DriveFile
- Gets a file's metadata or content by ID. (files.get)
- listFiles() : FileList
- Lists or searches files. (files.listFiles)
- update() : DriveFile
- Updates a file's metadata and/or content. This method supports patch semantics. (files.update)
- watch() : Channel
- Subscribes to changes to a file (files.watch)
- convertToArrayAndStripNulls() : mixed
Properties
$client
private
Client
$client
$methods
private
array<string|int, mixed>
$methods
$resourceName
private
string
$resourceName
$rootUrl
private
string
$rootUrl
$serviceName
private
string
$serviceName
$servicePath
private
string
$servicePath
$stackParameters
private
mixed
$stackParameters
= array('alt' => array('type' => 'string', 'location' => 'query'), 'fields' => array('type' => 'string', 'location' => 'query'), 'trace' => array('type' => 'string', 'location' => 'query'), 'userIp' => array('type' => 'string', 'location' => 'query'), 'quotaUser' => array('type' => 'string', 'location' => 'query'), 'data' => array('type' => 'string', 'location' => 'body'), 'mimeType' => array('type' => 'string', 'location' => 'header'), 'uploadType' => array('type' => 'string', 'location' => 'query'), 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), 'prettyPrint' => array('type' => 'string', 'location' => 'query'))
Methods
__construct()
public
__construct(mixed $service, mixed $serviceName, mixed $resourceName, mixed $resource) : mixed
Parameters
- $service : mixed
- $serviceName : mixed
- $resourceName : mixed
- $resource : mixed
call()
TODO: This function needs simplifying.
public
call(mixed $name, mixed $arguments[, mixed $expectedClass = null ]) : mixed
Parameters
- $name : mixed
- $arguments : mixed
- $expectedClass : mixed = null
-
- optional, the expected class name
Tags
copy()
Creates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied. (files.copy)
public
copy(string $fileId, DriveFile $postBody[, array<string|int, mixed> $optParams = [] ]) : DriveFile
Parameters
- $fileId : string
-
The ID of the file.
- $postBody : DriveFile
- $optParams : array<string|int, mixed> = []
-
Optional parameters.
Tags
Return values
DriveFilecreate()
Creates a new file. (files.create)
public
create(DriveFile $postBody[, array<string|int, mixed> $optParams = [] ]) : DriveFile
Parameters
- $postBody : DriveFile
- $optParams : array<string|int, mixed> = []
-
Optional parameters.
Tags
Return values
DriveFilecreateRequestUri()
Parse/expand request parameters and create a fully qualified request uri.
public
createRequestUri(string $restPath, array<string|int, mixed> $params) : string
Parameters
- $restPath : string
- $params : array<string|int, mixed>
Tags
Return values
string —$requestUrl
delete()
Permanently deletes a file owned by the user without moving it to the trash.
public
delete(string $fileId[, array<string|int, mixed> $optParams = [] ]) : mixed
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 : string
-
The ID of the file.
- $optParams : array<string|int, mixed> = []
-
Optional parameters.
Tags
emptyTrash()
Permanently deletes all of the user's trashed files. (files.emptyTrash)
public
emptyTrash([array<string|int, mixed> $optParams = [] ]) : mixed
Parameters
- $optParams : array<string|int, mixed> = []
-
Optional parameters.
Tags
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.
public
export(string $fileId, string $mimeType[, array<string|int, mixed> $optParams = [] ]) : mixed
(files.export)
Parameters
- $fileId : string
-
The ID of the file.
- $mimeType : string
-
The MIME type of the format requested for this export.
- $optParams : array<string|int, mixed> = []
-
Optional parameters.
generateIds()
Generates a set of file IDs which can be provided in create or copy requests.
public
generateIds([array<string|int, mixed> $optParams = [] ]) : GeneratedIds
(files.generateIds)
Parameters
- $optParams : array<string|int, mixed> = []
-
Optional parameters.
Tags
Return values
GeneratedIdsget()
Gets a file's metadata or content by ID. (files.get)
public
get(string $fileId[, array<string|int, mixed> $optParams = [] ]) : DriveFile
Parameters
- $fileId : string
-
The ID of the file.
- $optParams : array<string|int, mixed> = []
-
Optional parameters.
Tags
Return values
DriveFilelistFiles()
Lists or searches files. (files.listFiles)
public
listFiles([array<string|int, mixed> $optParams = [] ]) : FileList
Parameters
- $optParams : array<string|int, mixed> = []
-
Optional parameters.
Tags
Return values
FileListupdate()
Updates a file's metadata and/or content. This method supports patch semantics. (files.update)
public
update(string $fileId, DriveFile $postBody[, array<string|int, mixed> $optParams = [] ]) : DriveFile
Parameters
- $fileId : string
-
The ID of the file.
- $postBody : DriveFile
- $optParams : array<string|int, mixed> = []
-
Optional parameters.
Tags
Return values
DriveFilewatch()
Subscribes to changes to a file (files.watch)
public
watch(string $fileId, Channel $postBody[, array<string|int, mixed> $optParams = [] ]) : Channel
Parameters
- $fileId : string
-
The ID of the file.
- $postBody : Channel
- $optParams : array<string|int, mixed> = []
-
Optional parameters.
Tags
Return values
ChannelconvertToArrayAndStripNulls()
protected
convertToArrayAndStripNulls(mixed $o) : mixed
Parameters
- $o : mixed