Service Client: Google::Firestore::V1::Firestore::FirestoreClient

Client stub representing the remote Firestore gRPC service. Delegates call dispatching to Google::gRPC::Client.

target

The endpoint target address. Defaults to firestore.googleapis.com:443.

credentials

The authentication credentials provider. Defaults to application default credentials via Google::Auth.

NAME

Google::Firestore::V1::Firestore - Compiled Protocol Buffers messages for google/firestore/v1/firestore.proto

SYNOPSIS

use Google::Firestore::V1::Firestore;

my $msg = Google::Firestore::V1::Firestore::GetDocumentRequest->new({
    name => $name,
    mask => $mask,
    transaction => $transaction,
    read_time => $read_time,
});

# Read or update a field
my $val = $msg->name();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Firestore::V1::Firestore::GetDocumentRequest->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/firestore/v1/firestore.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Firestore::V1::Firestore::GetDocumentRequest

The request for [Firestore.GetDocument][google.firestore.v1.Firestore.GetDocument].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name of the Document to get. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.

  • $msg->mask() / $msg->mask($value)

    Type: Message (Google::Firestore::V1::Common::DocumentMask)

    The fields to return. If not set, returns all fields.

    If the document has a field that is not present in this mask, that field will not be returned in the response.

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    Reads the document in a transaction.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Reads the version of the document at the given time.

    This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::ListDocumentsRequest

The request for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`.

    For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`

  • $msg->collection_id() / $msg->collection_id($value)

    Type: String

    Optional. The collection ID, relative to `parent`, to list.

    For example: `chatrooms` or `messages`.

    This is optional, and when not provided, Firestore will list documents from all collections under the provided `parent`.

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    Optional. The maximum number of documents to return in a single response.

    Firestore may return fewer than this value.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    Optional. A page token, received from a previous `ListDocuments` response.

    Provide this to retrieve the subsequent page. When paginating, all other parameters (with the exception of `page_size`) must match the values set in the request that generated the page token.

  • $msg->order_by() / $msg->order_by($value)

    Type: String

    Optional. The optional ordering of the documents to return.

    For example: `priority desc, __name__ desc`.

    This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] used in Firestore queries but in a string representation. When absent, documents are ordered based on `__name__ ASC`.

  • $msg->mask() / $msg->mask($value)

    Type: Message (Google::Firestore::V1::Common::DocumentMask)

    Optional. The fields to return. If not set, returns all fields.

    If a document has a field that is not present in this mask, that field will not be returned in the response.

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    Perform the read as part of an already active transaction.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Perform the read at the provided time.

    This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

  • $msg->show_missing() / $msg->show_missing($value)

    Type: Bool

    If the list should show missing documents.

    A document is missing if it does not exist, but there are sub-documents nested underneath it. When true, such missing documents will be returned with a key but will not have fields, [`create_time`][google.firestore.v1.Document.create_time], or [`update_time`][google.firestore.v1.Document.update_time] set.

    Requests with `show_missing` may not specify `where` or `order_by`.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::ListDocumentsResponse

The response for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments].

Inherits from Protobuf::Message.

Accessors

  • $msg->documents() / $msg->documents($value)

    Type: Message (Google::Firestore::V1::Document::Document)

    The Documents found.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    A token to retrieve the next page of documents.

    If this field is omitted, there are no subsequent pages.

Google::Firestore::V1::Firestore::CreateDocumentRequest

The request for [Firestore.CreateDocument][google.firestore.v1.Firestore.CreateDocument].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The parent resource. For example: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`

  • $msg->collection_id() / $msg->collection_id($value)

    Type: String

    Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`.

  • $msg->document_id() / $msg->document_id($value)

    Type: String

    The client-assigned document ID to use for this document.

    Optional. If not specified, an ID will be assigned by the service.

  • $msg->document() / $msg->document($value)

    Type: Message (Google::Firestore::V1::Document::Document)

    Required. The document to create. `name` must not be set.

  • $msg->mask() / $msg->mask($value)

    Type: Message (Google::Firestore::V1::Common::DocumentMask)

    The fields to return. If not set, returns all fields.

    If the document has a field that is not present in this mask, that field will not be returned in the response.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::UpdateDocumentRequest

The request for [Firestore.UpdateDocument][google.firestore.v1.Firestore.UpdateDocument].

Inherits from Protobuf::Message.

Accessors

  • $msg->document() / $msg->document($value)

    Type: Message (Google::Firestore::V1::Document::Document)

    Required. The updated document. Creates the document if it does not already exist.

  • $msg->update_mask() / $msg->update_mask($value)

    Type: Message (Google::Firestore::V1::Common::DocumentMask)

    The fields to update. None of the field paths in the mask may contain a reserved name.

    If the document exists on the server and has fields not referenced in the mask, they are left unchanged. Fields referenced in the mask, but not present in the input document, are deleted from the document on the server.

  • $msg->mask() / $msg->mask($value)

    Type: Message (Google::Firestore::V1::Common::DocumentMask)

    The fields to return. If not set, returns all fields.

    If the document has a field that is not present in this mask, that field will not be returned in the response.

  • $msg->current_document() / $msg->current_document($value)

    Type: Message (Google::Firestore::V1::Common::Precondition)

    An optional precondition on the document. The request will fail if this is set and not met by the target document.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::DeleteDocumentRequest

The request for [Firestore.DeleteDocument][google.firestore.v1.Firestore.DeleteDocument].

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name of the Document to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.

  • $msg->current_document() / $msg->current_document($value)

    Type: Message (Google::Firestore::V1::Common::Precondition)

    An optional precondition on the document. The request will fail if this is set and not met by the target document.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::BatchGetDocumentsRequest

The request for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments].

Inherits from Protobuf::Message.

Accessors

  • $msg->database() / $msg->database($value)

    Type: String

    Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`.

  • $msg->documents() / $msg->documents($value)

    Type: String

    The names of the documents to retrieve. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. The request will fail if any of the document is not a child resource of the given `database`. Duplicate names will be elided.

  • $msg->mask() / $msg->mask($value)

    Type: Message (Google::Firestore::V1::Common::DocumentMask)

    The fields to return. If not set, returns all fields.

    If a document has a field that is not present in this mask, that field will not be returned in the response.

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    Reads documents in a transaction.

  • $msg->new_transaction() / $msg->new_transaction($value)

    Type: Message (Google::Firestore::V1::Common::TransactionOptions)

    Starts a new transaction and reads the documents. Defaults to a read-only transaction. The new transaction ID will be returned as the first response in the stream.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Reads documents as they were at the given time.

    This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::BatchGetDocumentsResponse

The streamed response for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments].

Inherits from Protobuf::Message.

Accessors

  • $msg->found() / $msg->found($value)

    Type: Message (Google::Firestore::V1::Document::Document)

    A document that was requested.

  • $msg->missing() / $msg->missing($value)

    Type: String

    A document name that was requested but does not exist. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    The transaction that was started as part of this request. Will only be set in the first response, and only if [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] was set in the request.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    The time at which the document was read. This may be monotically increasing, in this case the previous documents in the result stream are guaranteed not to have changed between their read_time and this one.

Google::Firestore::V1::Firestore::BeginTransactionRequest

The request for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction].

Inherits from Protobuf::Message.

Accessors

  • $msg->database() / $msg->database($value)

    Type: String

    Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`.

  • $msg->options() / $msg->options($value)

    Type: Message (Google::Firestore::V1::Common::TransactionOptions)

    The options for the transaction. Defaults to a read-write transaction.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::BeginTransactionResponse

The response for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction].

Inherits from Protobuf::Message.

Accessors

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    The transaction that was started.

Google::Firestore::V1::Firestore::CommitRequest

The request for [Firestore.Commit][google.firestore.v1.Firestore.Commit].

Inherits from Protobuf::Message.

Accessors

  • $msg->database() / $msg->database($value)

    Type: String

    Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`.

  • $msg->writes() / $msg->writes($value)

    Type: Message (Google::Firestore::V1::Write::Write)

    The writes to apply.

    Always executed atomically and in order.

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    If set, applies all writes in this transaction, and commits it.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::CommitResponse

The response for [Firestore.Commit][google.firestore.v1.Firestore.Commit].

Inherits from Protobuf::Message.

Accessors

  • $msg->write_results() / $msg->write_results($value)

    Type: Message (Google::Firestore::V1::Write::WriteResult)

    The result of applying the writes.

    This i-th write result corresponds to the i-th write in the request.

  • $msg->commit_time() / $msg->commit_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    The time at which the commit occurred. Any read with an equal or greater `read_time` is guaranteed to see the effects of the commit.

Google::Firestore::V1::Firestore::RollbackRequest

The request for [Firestore.Rollback][google.firestore.v1.Firestore.Rollback].

Inherits from Protobuf::Message.

Accessors

  • $msg->database() / $msg->database($value)

    Type: String

    Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`.

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    Required. The transaction to roll back.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::RunQueryRequest

The request for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`

  • $msg->structured_query() / $msg->structured_query($value)

    Type: Message (Google::Firestore::V1::Query::StructuredQuery)

    A structured query.

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    Run the query within an already active transaction.

    The value here is the opaque transaction ID to execute the query in.

  • $msg->new_transaction() / $msg->new_transaction($value)

    Type: Message (Google::Firestore::V1::Common::TransactionOptions)

    Starts a new transaction and reads the documents. Defaults to a read-only transaction. The new transaction ID will be returned as the first response in the stream.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Reads documents as they were at the given time.

    This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

  • $msg->explain_options() / $msg->explain_options($value)

    Type: Message (Google::Firestore::V1::QueryProfile::ExplainOptions)

    Optional. Explain options for the query. If set, additional query statistics will be returned. If not, only query results will be returned.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::RunQueryResponse

The response for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery].

Inherits from Protobuf::Message.

Accessors

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    The transaction that was started as part of this request. Can only be set in the first response, and only if [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] was set in the request. If set, no other fields will be set in this response.

  • $msg->document() / $msg->document($value)

    Type: Message (Google::Firestore::V1::Document::Document)

    A query result, not set when reporting partial progress.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    The time at which the document was read. This may be monotonically increasing; in this case, the previous documents in the result stream are guaranteed not to have changed between their `read_time` and this one.

    If the query returns no results, a response with `read_time` and no `document` will be sent, and this represents the time at which the query was run.

  • $msg->skipped_results() / $msg->skipped_results($value)

    Type: Int32

    The number of results that have been skipped due to an offset between the last response and the current response.

  • $msg->done() / $msg->done($value)

    Type: Bool

    If present, Firestore has completely finished the request and no more documents will be returned.

  • $msg->explain_metrics() / $msg->explain_metrics($value)

    Type: Message (Google::Firestore::V1::QueryProfile::ExplainMetrics)

    Query explain metrics. This is only present when the [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] is provided, and it is sent only once with the last response in the stream.

Google::Firestore::V1::Firestore::ExecutePipelineRequest

The request for [Firestore.ExecutePipeline][google.firestore.v1.Firestore.ExecutePipeline].

Inherits from Protobuf::Message.

Accessors

  • $msg->database() / $msg->database($value)

    Type: String

    Required. Database identifier, in the form `projects/{project}/databases/{database}`.

  • $msg->structured_pipeline() / $msg->structured_pipeline($value)

    Type: Message (Google::Firestore::V1::Pipeline::StructuredPipeline)

    A pipelined operation.

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    Run the query within an already active transaction.

    The value here is the opaque transaction ID to execute the query in.

  • $msg->new_transaction() / $msg->new_transaction($value)

    Type: Message (Google::Firestore::V1::Common::TransactionOptions)

    Execute the pipeline in a new transaction.

    The identifier of the newly created transaction will be returned in the first response on the stream. This defaults to a read-only transaction.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Execute the pipeline in a snapshot transaction at the given time.

    This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

  • $msg->auto_commit_transaction() / $msg->auto_commit_transaction($value)

    Type: Bool

    Optional. Automatically commits the transaction after the pipeline has been executed. Only permitted in combination with `transaction` or `new_transaction`.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::ExecutePipelineResponse

The response for [Firestore.Execute][].

Inherits from Protobuf::Message.

Accessors

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    Newly created transaction identifier.

    This field is only specified as part of the first response from the server, alongside the `results` field when the original request specified [ExecuteRequest.new_transaction][].

  • $msg->results() / $msg->results($value)

    Type: Message (Google::Firestore::V1::Document::Document)

    An ordered batch of results returned executing a pipeline.

    The batch size is variable, and can even be zero for when only a partial progress message is returned.

    The fields present in the returned documents are only those that were explicitly requested in the pipeline, this includes those like [`__name__`][google.firestore.v1.Document.name] and [`__update_time__`][google.firestore.v1.Document.update_time]. This is explicitly a divergence from `Firestore.RunQuery` / `Firestore.GetDocument` RPCs which always return such fields even when they are not specified in the [`mask`][google.firestore.v1.DocumentMask].

  • $msg->execution_time() / $msg->execution_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    The time at which the results are valid.

    This is a (not strictly) monotonically increasing value across multiple responses in the same stream. The API guarantees that all previously returned results are still valid at the latest `execution_time`. This allows the API consumer to treat the query if it ran at the latest `execution_time` returned.

    If the query returns no results, a response with `execution_time` and no `results` will be sent, and this represents the time at which the operation was run.

  • $msg->explain_stats() / $msg->explain_stats($value)

    Type: Message (Google::Firestore::V1::ExplainStats::ExplainStats)

    Query explain stats.

    This is present on the last response if the request configured explain to run in 'analyze' or 'explain' mode in the pipeline options. If the query does not return any results, a response with `explain_stats` and no `results` will still be sent.

Google::Firestore::V1::Firestore::RunAggregationQueryRequest

The request for [Firestore.RunAggregationQuery][google.firestore.v1.Firestore.RunAggregationQuery].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`

  • $msg->structured_aggregation_query() / $msg->structured_aggregation_query($value)

    Type: Message (Google::Firestore::V1::Query::StructuredAggregationQuery)

    An aggregation query.

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    Run the aggregation within an already active transaction.

    The value here is the opaque transaction ID to execute the query in.

  • $msg->new_transaction() / $msg->new_transaction($value)

    Type: Message (Google::Firestore::V1::Common::TransactionOptions)

    Starts a new transaction as part of the query, defaulting to read-only.

    The new transaction ID will be returned as the first response in the stream.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Executes the query at the given timestamp.

    This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

  • $msg->explain_options() / $msg->explain_options($value)

    Type: Message (Google::Firestore::V1::QueryProfile::ExplainOptions)

    Optional. Explain options for the query. If set, additional query statistics will be returned. If not, only query results will be returned.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::RunAggregationQueryResponse

The response for [Firestore.RunAggregationQuery][google.firestore.v1.Firestore.RunAggregationQuery].

Inherits from Protobuf::Message.

Accessors

  • $msg->result() / $msg->result($value)

    Type: Message (Google::Firestore::V1::AggregationResult::AggregationResult)

    A single aggregation result.

    Not present when reporting partial progress.

  • $msg->transaction() / $msg->transaction($value)

    Type: Bytes

    The transaction that was started as part of this request.

    Only present on the first response when the request requested to start a new transaction.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    The time at which the aggregate result was computed. This is always monotonically increasing; in this case, the previous AggregationResult in the result stream are guaranteed not to have changed between their `read_time` and this one.

    If the query returns no results, a response with `read_time` and no `result` will be sent, and this represents the time at which the query was run.

  • $msg->explain_metrics() / $msg->explain_metrics($value)

    Type: Message (Google::Firestore::V1::QueryProfile::ExplainMetrics)

    Query explain metrics. This is only present when the [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] is provided, and it is sent only once with the last response in the stream.

Google::Firestore::V1::Firestore::PartitionQueryRequest

The request for [Firestore.PartitionQuery][google.firestore.v1.Firestore.PartitionQuery].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: 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.

  • $msg->structured_query() / $msg->structured_query($value)

    Type: Message (Google::Firestore::V1::Query::StructuredQuery)

    A structured query. Query must specify collection with all descendants and be ordered by name ascending. Other filters, order bys, limits, offsets, and start/end cursors are not supported.

  • $msg->partition_count() / $msg->partition_count($value)

    Type: Int64

    The desired maximum number of partition points. The partitions may be returned across multiple pages of results. The number must be positive. The actual number of partitions returned may be fewer.

    For example, this may be set to one fewer than the number of parallel queries to be run, or in running a data pipeline job, one fewer than the number of workers or compute instances available.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    The `next_page_token` value returned from a previous call to PartitionQuery that may be used to get an additional set of results. There are no ordering guarantees between sets of results. Thus, using multiple sets of results will require merging the different result sets.

    For example, two subsequent calls using a page_token may return:

    * cursor B, cursor M, cursor Q
    * cursor A, cursor U, cursor W

    To obtain a complete result set ordered with respect to the results of the query supplied to PartitionQuery, the results sets should be merged: cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    The maximum number of partitions to return in this call, subject to `partition_count`.

    For example, if `partition_count` = 10 and `page_size` = 8, the first call to PartitionQuery will return up to 8 partitions and a `next_page_token` if more results exist. A second call to PartitionQuery will return up to 2 partitions, to complete the total of 10 specified in `partition_count`.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Reads documents as they were at the given time.

    This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::PartitionQueryResponse

The response for [Firestore.PartitionQuery][google.firestore.v1.Firestore.PartitionQuery].

Inherits from Protobuf::Message.

Accessors

  • $msg->partitions() / $msg->partitions($value)

    Type: Message (Google::Firestore::V1::Query::Cursor)

    Partition results. Each partition is a split point that can be used by RunQuery as a starting or end point for the query results. The RunQuery requests must be made with the same query supplied to this PartitionQuery request. The partition cursors will be ordered according to same ordering as the results of the query supplied to PartitionQuery.

    For example, if a PartitionQuery request returns partition cursors A and B, running the following three queries will return the entire result set of the original query:

    * query, end_at A
    * query, start_at A, end_at B
    * query, start_at B

    An empty result may indicate that the query has too few results to be partitioned, or that the query is not yet supported for partitioning.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    A page token that may be used to request an additional set of results, up to the number specified by `partition_count` in the PartitionQuery request. If blank, there are no more results.

Google::Firestore::V1::Firestore::WriteRequest

The request for [Firestore.Write][google.firestore.v1.Firestore.Write].

The first request creates a stream, or resumes an existing one from a token.

When creating a new stream, the server replies with a response containing only an ID and a token, to use in the next request.

When resuming a stream, the server first streams any responses later than the given token, then a response containing only an up-to-date token, to use in the next request.

Inherits from Protobuf::Message.

Accessors

  • $msg->database() / $msg->database($value)

    Type: String

    Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. This is only required in the first message.

  • $msg->stream_id() / $msg->stream_id($value)

    Type: String

    The ID of the write stream to resume. This may only be set in the first message. When left empty, a new write stream will be created.

  • $msg->writes() / $msg->writes($value)

    Type: Message (Google::Firestore::V1::Write::Write)

    The writes to apply.

    Always executed atomically and in order. This must be empty on the first request. This may be empty on the last request. This must not be empty on all other requests.

  • $msg->stream_token() / $msg->stream_token($value)

    Type: Bytes

    A stream token that was previously sent by the server.

    The client should set this field to the token from the most recent [WriteResponse][google.firestore.v1.WriteResponse] it has received. This acknowledges that the client has received responses up to this token. After sending this token, earlier tokens may not be used anymore.

    The server may close the stream if there are too many unacknowledged responses.

    Leave this field unset when creating a new stream. To resume a stream at a specific point, set this field and the `stream_id` field.

    Leave this field unset when creating a new stream.

  • $msg->labels() / $msg->labels($value)

    Type: Message (Google::Firestore::V1::Firestore::WriteRequest::LabelsEntry)

    Labels associated with this write request.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::WriteResponse

The response for [Firestore.Write][google.firestore.v1.Firestore.Write].

Inherits from Protobuf::Message.

Accessors

  • $msg->stream_id() / $msg->stream_id($value)

    Type: String

    The ID of the stream. Only set on the first message, when a new stream was created.

  • $msg->stream_token() / $msg->stream_token($value)

    Type: Bytes

    A token that represents the position of this response in the stream. This can be used by a client to resume the stream at this point.

    This field is always set.

  • $msg->write_results() / $msg->write_results($value)

    Type: Message (Google::Firestore::V1::Write::WriteResult)

    The result of applying the writes.

    This i-th write result corresponds to the i-th write in the request.

  • $msg->commit_time() / $msg->commit_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    The time at which the commit occurred. Any read with an equal or greater `read_time` is guaranteed to see the effects of the write.

Google::Firestore::V1::Firestore::ListenRequest

A request for [Firestore.Listen][google.firestore.v1.Firestore.Listen]

Inherits from Protobuf::Message.

Accessors

Google::Firestore::V1::Firestore::ListenResponse

The response for [Firestore.Listen][google.firestore.v1.Firestore.Listen].

Inherits from Protobuf::Message.

Accessors

Google::Firestore::V1::Firestore::Target

A specification of a set of documents to listen to.

Inherits from Protobuf::Message.

Accessors

  • $msg->query() / $msg->query($value)

    Type: Message (Google::Firestore::V1::Firestore::Target::QueryTarget)

    A target specified by a query.

  • $msg->documents() / $msg->documents($value)

    Type: Message (Google::Firestore::V1::Firestore::Target::DocumentsTarget)

    A target specified by a set of document names.

  • $msg->resume_token() / $msg->resume_token($value)

    Type: Bytes

    A resume token from a prior [TargetChange][google.firestore.v1.TargetChange] for an identical target.

    Using a resume token with a different target is unsupported and may fail.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Start listening after a specific `read_time`.

    The client must know the state of matching documents at this time.

  • $msg->target_id() / $msg->target_id($value)

    Type: Int32

    The target ID that identifies the target on the stream. Must be a positive number and non-zero.

    If `target_id` is 0 (or unspecified), the server will assign an ID for this target and return that in a `TargetChange::ADD` event. Once a target with `target_id=0` is added, all subsequent targets must also have `target_id=0`. If an `AddTarget` request with `target_id != 0` is sent to the server after a target with `target_id=0` is added, the server will immediately send a response with a `TargetChange::Remove` event.

    Note that if the client sends multiple `AddTarget` requests without an ID, the order of IDs returned in `TargetChange.target_ids` are undefined. Therefore, clients should provide a target ID instead of relying on the server to assign one.

    If `target_id` is non-zero, there must not be an existing active target on this stream with the same ID.

  • $msg->once() / $msg->once($value)

    Type: Bool

    If the target should be removed once it is current and consistent.

  • $msg->expected_count() / $msg->expected_count($value)

    Type: Message (Google::Protobuf::Wrappers::Int32Value)

    The number of documents that last matched the query at the resume token or read time.

    This value is only relevant when a `resume_type` is provided. This value being present and greater than zero signals that the client wants `ExistenceFilter.unchanged_names` to be included in the response.

Google::Firestore::V1::Firestore::TargetChange

Targets being watched have changed.

Inherits from Protobuf::Message.

Accessors

  • $msg->target_change_type() / $msg->target_change_type($value)

    Type: Enum (Google::Firestore::V1::TargetChange::TargetChangeType)

    The type of change that occurred.

  • $msg->target_ids() / $msg->target_ids($value)

    Type: Int32

    The target IDs of targets that have changed.

    If empty, the change applies to all targets.

    The order of the target IDs is not defined.

  • $msg->cause() / $msg->cause($value)

    Type: Message (Google::Rpc::Status::Status)

    The error that resulted in this change, if applicable.

  • $msg->resume_token() / $msg->resume_token($value)

    Type: Bytes

    A token that can be used to resume the stream for the given `target_ids`, or all targets if `target_ids` is empty.

    Not set on every target change.

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    The consistent `read_time` for the given `target_ids` (omitted when the target_ids are not at a consistent snapshot).

    The stream is guaranteed to send a `read_time` with `target_ids` empty whenever the entire stream reaches a new consistent snapshot. ADD, CURRENT, and RESET messages are guaranteed to (eventually) result in a new consistent snapshot (while NO_CHANGE and REMOVE messages are not).

    For a given stream, `read_time` is guaranteed to be monotonically increasing.

Enum: TargetChange::TargetChangeType

  • NO_CHANGE => 0

  • ADD => 1

  • REMOVE => 2

  • CURRENT => 3

  • RESET => 4

Google::Firestore::V1::Firestore::ListCollectionIdsRequest

The request for [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds].

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: 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`

    Use `projects/{project_id}/databases/{database_id}/documents` to list top-level collections.

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    The maximum number of results to return.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    A page token. Must be a value from [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse].

  • $msg->read_time() / $msg->read_time($value)

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Reads documents as they were at the given time.

    This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::ListCollectionIdsResponse

The response from [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds].

Inherits from Protobuf::Message.

Accessors

  • $msg->collection_ids() / $msg->collection_ids($value)

    Type: String

    The collection ids.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    A page token that may be used to continue the list.

Google::Firestore::V1::Firestore::BatchWriteRequest

The request for [Firestore.BatchWrite][google.firestore.v1.Firestore.BatchWrite].

Inherits from Protobuf::Message.

Accessors

  • $msg->database() / $msg->database($value)

    Type: String

    Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`.

  • $msg->writes() / $msg->writes($value)

    Type: Message (Google::Firestore::V1::Write::Write)

    The writes to apply.

    Method does not apply writes atomically and does not guarantee ordering. Each write succeeds or fails independently. You cannot write to the same document more than once per request.

  • $msg->labels() / $msg->labels($value)

    Type: Message (Google::Firestore::V1::Firestore::BatchWriteRequest::LabelsEntry)

    Labels associated with this batch write.

  • $msg->request_options() / $msg->request_options($value)

    Type: Message (Google::Firestore::V1::Common::RequestOptions)

    Optional. Any additional options for the request.

Google::Firestore::V1::Firestore::BatchWriteResponse

The response from [Firestore.BatchWrite][google.firestore.v1.Firestore.BatchWrite].

Inherits from Protobuf::Message.

Accessors

  • $msg->write_results() / $msg->write_results($value)

    Type: Message (Google::Firestore::V1::Write::WriteResult)

    The result of applying the writes.

    This i-th write result corresponds to the i-th write in the request.

  • $msg->status() / $msg->status($value)

    Type: Message (Google::Rpc::Status::Status)

    The status of applying the writes.

    This i-th write status corresponds to the i-th write in the request.

SEE ALSO

Protobuf, Protobuf::Message, Google::Firestore::V1::Firestore::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.