Google_Service_Firestore_Resource_ProjectsDatabasesDocuments
extends Google_Service_Resource
in package
The "documents" collection of methods.
Typical usage is:
$firestoreService = new Google_Service_Firestore(...);
$documents = $firestoreService->documents;
Table of Contents
- $client : Google_Client
- $methods : array<string|int, mixed>
- $resourceName : string
- $rootUrl : string
- $serviceName : string
- $servicePath : string
- $stackParameters : mixed
- __construct() : mixed
- batchGet() : Google_Service_Firestore_BatchGetDocumentsResponse
- Gets multiple documents. Documents returned by this method are not guaranteed to be returned in the same order that they were requested.
- batchWrite() : Google_Service_Firestore_BatchWriteResponse
- Applies a batch of write operations. The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the BatchWriteResponse for the success status of each write. If you require an atomically applied set of writes, use Commit instead. (documents.batchWrite)
- beginTransaction() : Google_Service_Firestore_BeginTransactionResponse
- Starts a new transaction. (documents.beginTransaction)
- call() : Google_Http_Request|expectedClass
- TODO: This function needs simplifying.
- commit() : Google_Service_Firestore_CommitResponse
- Commits a transaction, while optionally updating documents.
- createDocument() : Google_Service_Firestore_Document
- Creates a new document. (documents.createDocument)
- createRequestUri() : string
- Parse/expand request parameters and create a fully qualified request uri.
- delete() : Google_Service_Firestore_FirestoreEmpty
- Deletes a document. (documents.delete)
- get() : Google_Service_Firestore_Document
- Gets a single document. (documents.get)
- listCollectionIds() : Google_Service_Firestore_ListCollectionIdsResponse
- Lists all the collection IDs underneath a document.
- listen() : Google_Service_Firestore_ListenResponse
- Listens to changes. (documents.listen)
- listProjectsDatabasesDocuments() : Google_Service_Firestore_ListDocumentsResponse
- Lists documents. (documents.listProjectsDatabasesDocuments)
- partitionQuery() : Google_Service_Firestore_PartitionQueryResponse
- Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as starting/end points for the query results.
- patch() : Google_Service_Firestore_Document
- Updates or inserts a document. (documents.patch)
- rollback() : Google_Service_Firestore_FirestoreEmpty
- Rolls back a transaction. (documents.rollback)
- runQuery() : Google_Service_Firestore_RunQueryResponse
- Runs a query. (documents.runQuery)
- write() : Google_Service_Firestore_WriteResponse
- Streams batches of document updates and deletes, in order. (documents.write)
- convertToArrayAndStripNulls() : mixed
Properties
$client
private
Google_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
Return values
mixed —batchGet()
Gets multiple documents. Documents returned by this method are not guaranteed to be returned in the same order that they were requested.
public
batchGet(string $database, Google_Service_Firestore_BatchGetDocumentsRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_BatchGetDocumentsResponse
(documents.batchGet)
Parameters
- $database : string
-
Required. The database name. In the format:
projects/{project_id}/databases/{database_id}. - $postBody : Google_Service_Firestore_BatchGetDocumentsRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Firestore_BatchGetDocumentsResponse —batchWrite()
Applies a batch of write operations. The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the BatchWriteResponse for the success status of each write. If you require an atomically applied set of writes, use Commit instead. (documents.batchWrite)
public
batchWrite(string $database, Google_Service_Firestore_BatchWriteRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_BatchWriteResponse
Parameters
- $database : string
-
Required. The database name. In the format:
projects/{project_id}/databases/{database_id}. - $postBody : Google_Service_Firestore_BatchWriteRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Firestore_BatchWriteResponse —beginTransaction()
Starts a new transaction. (documents.beginTransaction)
public
beginTransaction(string $database, Google_Service_Firestore_BeginTransactionRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_BeginTransactionResponse
Parameters
- $database : string
-
Required. The database name. In the format:
projects/{project_id}/databases/{database_id}. - $postBody : Google_Service_Firestore_BeginTransactionRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Firestore_BeginTransactionResponse —call()
TODO: This function needs simplifying.
public
call( $name, $arguments[, $expectedClass = null ]) : Google_Http_Request|expectedClass
Parameters
Tags
Return values
Google_Http_Request|expectedClass —commit()
Commits a transaction, while optionally updating documents.
public
commit(string $database, Google_Service_Firestore_CommitRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_CommitResponse
(documents.commit)
Parameters
- $database : string
-
Required. The database name. In the format:
projects/{project_id}/databases/{database_id}. - $postBody : Google_Service_Firestore_CommitRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Firestore_CommitResponse —createDocument()
Creates a new document. (documents.createDocument)
public
createDocument(string $parent, string $collectionId, Google_Service_Firestore_Document $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_Document
Parameters
- $parent : string
-
Required. The parent resource. For example:
projects/{project_id}/databases/{database_id}/documentsorprojects/{proje ct_id}/databases/{database_id}/documents/chatrooms/{chatroom_id} - $collectionId : string
-
Required. The collection ID, relative to
parent, to list. For example:chatrooms. - $postBody : Google_Service_Firestore_Document
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Tags
Return values
Google_Service_Firestore_Document —createRequestUri()
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()
Deletes a document. (documents.delete)
public
delete(string $name[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_FirestoreEmpty
Parameters
- $name : string
-
Required. The resource name of the Document to delete. In the format:
projects/{project_id}/databases/{database_id}/documents/{document_path}. - $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Tags
Return values
Google_Service_Firestore_FirestoreEmpty —get()
Gets a single document. (documents.get)
public
get(string $name[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_Document
Parameters
- $name : string
-
Required. The resource name of the Document to get. In the format:
projects/{project_id}/databases/{database_id}/documents/{document_path}. - $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Tags
Return values
Google_Service_Firestore_Document —listCollectionIds()
Lists all the collection IDs underneath a document.
public
listCollectionIds(string $parent, Google_Service_Firestore_ListCollectionIdsRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_ListCollectionIdsResponse
(documents.listCollectionIds)
Parameters
- $parent : string
-
Required. The parent document. In the format:
projects/{project_id}/databases/{database_id}/documents/{document_path}. For example:projects/my-project/databases/my-database/documents/chatrooms /my-chatroom - $postBody : Google_Service_Firestore_ListCollectionIdsRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Firestore_ListCollectionIdsResponse —listen()
Listens to changes. (documents.listen)
public
listen(string $database, Google_Service_Firestore_ListenRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_ListenResponse
Parameters
- $database : string
-
Required. The database name. In the format:
projects/{project_id}/databases/{database_id}. - $postBody : Google_Service_Firestore_ListenRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Firestore_ListenResponse —listProjectsDatabasesDocuments()
Lists documents. (documents.listProjectsDatabasesDocuments)
public
listProjectsDatabasesDocuments(string $parent, string $collectionId[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_ListDocumentsResponse
Parameters
- $parent : string
-
Required. The parent resource name. In the format:
projects/{project_id}/databases/{database_id}/documentsorprojects/{project_id}/databases/{database_id}/documents/{document_path}. For example:projects/my-project/databases/my-database/documentsorprojects/my-project/databases/my-database/documents/chatrooms/my-chatroom - $collectionId : string
-
Required. The collection ID, relative to
parent, to list. For example:chatroomsormessages. - $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Tags
Return values
Google_Service_Firestore_ListDocumentsResponse —partitionQuery()
Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as starting/end points for the query results.
public
partitionQuery(string $parent, Google_Service_Firestore_PartitionQueryRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_PartitionQueryResponse
(documents.partitionQuery)
Parameters
- $parent : string
-
Required. The parent resource name. In the format:
projects/{project_id}/databases/{database_id}/documents. Document resource names are not supported; only database resource names can be specified. - $postBody : Google_Service_Firestore_PartitionQueryRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Firestore_PartitionQueryResponse —patch()
Updates or inserts a document. (documents.patch)
public
patch(string $name, Google_Service_Firestore_Document $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_Document
Parameters
- $name : string
-
The resource name of the document, for example
projects/{project_id}/databases/{database_id}/documents/{document_path}. - $postBody : Google_Service_Firestore_Document
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Tags
Return values
Google_Service_Firestore_Document —rollback()
Rolls back a transaction. (documents.rollback)
public
rollback(string $database, Google_Service_Firestore_RollbackRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_FirestoreEmpty
Parameters
- $database : string
-
Required. The database name. In the format:
projects/{project_id}/databases/{database_id}. - $postBody : Google_Service_Firestore_RollbackRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Firestore_FirestoreEmpty —runQuery()
Runs a query. (documents.runQuery)
public
runQuery(string $parent, Google_Service_Firestore_RunQueryRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_RunQueryResponse
Parameters
- $parent : string
-
Required. The parent resource name. In the format:
projects/{project_id}/databases/{database_id}/documentsorprojects/{project_id}/databases/{database_id}/documents/{document_path}. For example:projects/my-project/databases/my-database/documentsorprojects/my-project/databases/my-database/documents/chatrooms/my-chatroom - $postBody : Google_Service_Firestore_RunQueryRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Firestore_RunQueryResponse —write()
Streams batches of document updates and deletes, in order. (documents.write)
public
write(string $database, Google_Service_Firestore_WriteRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Firestore_WriteResponse
Parameters
- $database : string
-
Required. The database name. In the format:
projects/{project_id}/databases/{database_id}. This is only required in the first message. - $postBody : Google_Service_Firestore_WriteRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Firestore_WriteResponse —convertToArrayAndStripNulls()
protected
convertToArrayAndStripNulls(mixed $o) : mixed
Parameters
- $o : mixed