# Cloud Firestore V1 API - Class Google::Cloud::Firestore::V1::Firestore::Client (v2.4.0)

2.4.0 (latest) 2.3.0 2.2.1 2.1.1 2.0.1 1.3.0 1.2.0 1.1.1 1.0.0 0.14.0 0.13.0 0.12.0 0.11.1 0.10.0 0.9.0 0.8.0 0.7.1 0.6.0 0.5.0 0.4.8 Reference documentation and code samples for the Cloud Firestore V1 API class Google::Cloud::Firestore::V1::Firestore::Client.

Client for the Firestore service.


The Cloud Firestore service.

<br />

Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL
document database that simplifies storing, syncing, and querying data for
your mobile, web, and IoT apps at global scale. Its client libraries provide
live synchronization and offline support, while its security features and
integrations with Firebase and Google Cloud Platform accelerate building
truly serverless apps.

## Inherits

- Object

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the Firestore Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client-Configuration "Google::Cloud::Firestore::V1::Firestore::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all Firestore clients
::Google::Cloud::Firestore::V1::Firestore::Client.configure do |config|
  config.timeout = 10.0
end
```

### #batch_get_documents

    def batch_get_documents(request, options = nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse>
    def batch_get_documents(database: nil, documents: nil, mask: nil, transaction: nil, new_transaction: nil, read_time: nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse>

Gets multiple documents.


<br />

Documents returned by this method are not guaranteed to be returned in the
same order that they were requested.
**Overloads**

    def batch_get_documents(request, options = nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse>

Pass arguments to `batch_get_documents` via a request object, either of type [BatchGetDocumentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BatchGetDocumentsRequest "Google::Cloud::Firestore::V1::BatchGetDocumentsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::BatchGetDocumentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BatchGetDocumentsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def batch_get_documents(database: nil, documents: nil, mask: nil, transaction: nil, new_transaction: nil, read_time: nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse>

Pass arguments to `batch_get_documents` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **database** (::String) --- Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`.
- **documents** (::Array\<::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.
- **mask** ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask), ::Hash) --- 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.
- **transaction** (::String) --- Reads documents in a transaction.


  Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **new_transaction** ([::Google::Cloud::Firestore::V1::TransactionOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-TransactionOptions), ::Hash) --- 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.


  Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **read_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Timestamp), ::Hash) --- 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.

  Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Enumerable\<[::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BatchGetDocumentsResponse)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Enumerable\<[::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BatchGetDocumentsResponse)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new

# Call the batch_get_documents method to start streaming.
output = client.batch_get_documents request

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse
output.each do |current_response|
  p current_response
end
```

### #batch_write

    def batch_write(request, options = nil) -> ::Google::Cloud::Firestore::V1::BatchWriteResponse
    def batch_write(database: nil, writes: nil, labels: nil) -> ::Google::Cloud::Firestore::V1::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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BatchWriteResponse "Google::Cloud::Firestore::V1::BatchWriteResponse (class)") for the
success status of each write.

<br />

If you require an atomically applied set of writes, use
[Commit](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client#Google__Cloud__Firestore__V1__Firestore__Client_commit_instance_ "Google::Cloud::Firestore::V1::Firestore::Client#commit (method)") instead.
**Overloads**

    def batch_write(request, options = nil) -> ::Google::Cloud::Firestore::V1::BatchWriteResponse

Pass arguments to `batch_write` via a request object, either of type [BatchWriteRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BatchWriteRequest "Google::Cloud::Firestore::V1::BatchWriteRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::BatchWriteRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BatchWriteRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def batch_write(database: nil, writes: nil, labels: nil) -> ::Google::Cloud::Firestore::V1::BatchWriteResponse

Pass arguments to `batch_write` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **database** (::String) --- Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`.
- **writes** (::Array\<[::Google::Cloud::Firestore::V1::Write](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Write), ::Hash\>) --- 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.
- **labels** (::Hash{::String =\> ::String}) --- Labels associated with this batch write.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Firestore::V1::BatchWriteResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BatchWriteResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Firestore::V1::BatchWriteResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BatchWriteResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::BatchWriteRequest.new

# Call the batch_write method.
result = client.batch_write request

# The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse.
p result
```

### #begin_transaction

    def begin_transaction(request, options = nil) -> ::Google::Cloud::Firestore::V1::BeginTransactionResponse
    def begin_transaction(database: nil, options: nil) -> ::Google::Cloud::Firestore::V1::BeginTransactionResponse

Starts a new transaction.
**Overloads**

    def begin_transaction(request, options = nil) -> ::Google::Cloud::Firestore::V1::BeginTransactionResponse

Pass arguments to `begin_transaction` via a request object, either of type [BeginTransactionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BeginTransactionRequest "Google::Cloud::Firestore::V1::BeginTransactionRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::BeginTransactionRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BeginTransactionRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def begin_transaction(database: nil, options: nil) -> ::Google::Cloud::Firestore::V1::BeginTransactionResponse

Pass arguments to `begin_transaction` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **database** (::String) --- Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`.
- **options** ([::Google::Cloud::Firestore::V1::TransactionOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-TransactionOptions), ::Hash) --- The options for the transaction. Defaults to a read-write transaction.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Firestore::V1::BeginTransactionResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BeginTransactionResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Firestore::V1::BeginTransactionResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-BeginTransactionResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new

# Call the begin_transaction method.
result = client.begin_transaction request

# The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse.
p result
```

### #commit

    def commit(request, options = nil) -> ::Google::Cloud::Firestore::V1::CommitResponse
    def commit(database: nil, writes: nil, transaction: nil) -> ::Google::Cloud::Firestore::V1::CommitResponse

Commits a transaction, while optionally updating documents.
**Overloads**

    def commit(request, options = nil) -> ::Google::Cloud::Firestore::V1::CommitResponse

Pass arguments to `commit` via a request object, either of type [CommitRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-CommitRequest "Google::Cloud::Firestore::V1::CommitRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::CommitRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-CommitRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def commit(database: nil, writes: nil, transaction: nil) -> ::Google::Cloud::Firestore::V1::CommitResponse

Pass arguments to `commit` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **database** (::String) --- Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`.
- **writes** (::Array\<[::Google::Cloud::Firestore::V1::Write](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Write), ::Hash\>) --- The writes to apply.


  Always executed atomically and in order.
- **transaction** (::String) --- If set, applies all writes in this transaction, and commits it.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Firestore::V1::CommitResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-CommitResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Firestore::V1::CommitResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-CommitResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::CommitRequest.new

# Call the commit method.
result = client.commit request

# The returned object is of type Google::Cloud::Firestore::V1::CommitResponse.
p result
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the Firestore Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client#Google__Cloud__Firestore__V1__Firestore__Client_configure_class_ "Google::Cloud::Firestore::V1::Firestore::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client-Configuration "Google::Cloud::Firestore::V1::Firestore::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client-Configuration))

### #create_document

    def create_document(request, options = nil) -> ::Google::Cloud::Firestore::V1::Document
    def create_document(parent: nil, collection_id: nil, document_id: nil, document: nil, mask: nil) -> ::Google::Cloud::Firestore::V1::Document

Creates a new document.
**Overloads**

    def create_document(request, options = nil) -> ::Google::Cloud::Firestore::V1::Document

Pass arguments to `create_document` via a request object, either of type [CreateDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-CreateDocumentRequest "Google::Cloud::Firestore::V1::CreateDocumentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::CreateDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-CreateDocumentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_document(parent: nil, collection_id: nil, document_id: nil, document: nil, mask: nil) -> ::Google::Cloud::Firestore::V1::Document

Pass arguments to `create_document` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::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}`
- **collection_id** (::String) --- Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`.
- **document_id** (::String) --- The client-assigned document ID to use for this document.


  Optional. If not specified, an ID will be assigned by the service.
- **document** ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document), ::Hash) --- Required. The document to create. `name` must not be set.
- **mask** ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask), ::Hash) --- 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.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new

# Call the create_document method.
result = client.create_document request

# The returned object is of type Google::Cloud::Firestore::V1::Document.
p result
```

### #delete_document

    def delete_document(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_document(name: nil, current_document: nil) -> ::Google::Protobuf::Empty

Deletes a document.
**Overloads**

    def delete_document(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_document` via a request object, either of type [DeleteDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DeleteDocumentRequest "Google::Cloud::Firestore::V1::DeleteDocumentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::DeleteDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DeleteDocumentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def delete_document(name: nil, current_document: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_document` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name of the Document to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
- **current_document** ([::Google::Cloud::Firestore::V1::Precondition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Precondition), ::Hash) --- An optional precondition on the document. The request will fail if this is set and not met by the target document.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new

# Call the delete_document method.
result = client.delete_document request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #execute_pipeline

    def execute_pipeline(request, options = nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::ExecutePipelineResponse>
    def execute_pipeline(database: nil, structured_pipeline: nil, transaction: nil, new_transaction: nil, read_time: nil, auto_commit_transaction: nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::ExecutePipelineResponse>

Executes a pipeline query.
**Overloads**

    def execute_pipeline(request, options = nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::ExecutePipelineResponse>

Pass arguments to `execute_pipeline` via a request object, either of type [ExecutePipelineRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ExecutePipelineRequest "Google::Cloud::Firestore::V1::ExecutePipelineRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::ExecutePipelineRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ExecutePipelineRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def execute_pipeline(database: nil, structured_pipeline: nil, transaction: nil, new_transaction: nil, read_time: nil, auto_commit_transaction: nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::ExecutePipelineResponse>

Pass arguments to `execute_pipeline` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **database** (::String) --- Required. Database identifier, in the form `projects/{project}/databases/{database}`.
- **structured_pipeline** ([::Google::Cloud::Firestore::V1::StructuredPipeline](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-StructuredPipeline), ::Hash) --- A pipelined operation.
- **transaction** (::String) --- Run the query within an already active transaction.


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

  Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **new_transaction** ([::Google::Cloud::Firestore::V1::TransactionOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-TransactionOptions), ::Hash) --- 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.

  Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **read_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Timestamp), ::Hash) --- 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.

  Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **auto_commit_transaction** (::Boolean) --- Optional. Automatically commits the transaction after the pipeline has been executed. Only permitted in combination with `transaction` or `new_transaction`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Enumerable\<[::Google::Cloud::Firestore::V1::ExecutePipelineResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ExecutePipelineResponse)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Enumerable\<[::Google::Cloud::Firestore::V1::ExecutePipelineResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ExecutePipelineResponse)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::ExecutePipelineRequest.new

# Call the execute_pipeline method to start streaming.
output = client.execute_pipeline request

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::Firestore::V1::ExecutePipelineResponse
output.each do |current_response|
  p current_response
end
```

### #get_document

    def get_document(request, options = nil) -> ::Google::Cloud::Firestore::V1::Document
    def get_document(name: nil, mask: nil, transaction: nil, read_time: nil) -> ::Google::Cloud::Firestore::V1::Document

Gets a single document.
**Overloads**

    def get_document(request, options = nil) -> ::Google::Cloud::Firestore::V1::Document

Pass arguments to `get_document` via a request object, either of type [GetDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-GetDocumentRequest "Google::Cloud::Firestore::V1::GetDocumentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::GetDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-GetDocumentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_document(name: nil, mask: nil, transaction: nil, read_time: nil) -> ::Google::Cloud::Firestore::V1::Document

Pass arguments to `get_document` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name of the Document to get. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
- **mask** ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask), ::Hash) --- 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.
- **transaction** (::String) --- Reads the document in a transaction.


  Note: The following parameters are mutually exclusive: `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **read_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Timestamp), ::Hash) --- 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.

  Note: The following parameters are mutually exclusive: `read_time`, `transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::GetDocumentRequest.new

# Call the get_document method.
result = client.get_document request

# The returned object is of type Google::Cloud::Firestore::V1::Document.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new Firestore client object.
**Yields**

- (config) --- Configure the Firestore client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_collection_ids

    def list_collection_ids(request, options = nil) -> ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse
    def list_collection_ids(parent: nil, page_size: nil, page_token: nil, read_time: nil) -> ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse

Lists all the collection IDs underneath a document.
**Overloads**

    def list_collection_ids(request, options = nil) -> ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse

Pass arguments to `list_collection_ids` via a request object, either of type [ListCollectionIdsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListCollectionIdsRequest "Google::Cloud::Firestore::V1::ListCollectionIdsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::ListCollectionIdsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListCollectionIdsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_collection_ids(parent: nil, page_size: nil, page_token: nil, read_time: nil) -> ::Google::Cloud::Firestore::V1::ListCollectionIdsResponse

Pass arguments to `list_collection_ids` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **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`


  Use `projects/{project_id}/databases/{database_id}/documents` to list
  top-level collections.
- **page_size** (::Integer) --- The maximum number of results to return.
- **page_token** (::String) --- A page token. Must be a value from [ListCollectionIdsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListCollectionIdsResponse "Google::Cloud::Firestore::V1::ListCollectionIdsResponse (class)").
- **read_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Timestamp), ::Hash) --- 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.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Firestore::V1::ListCollectionIdsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListCollectionIdsResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Firestore::V1::ListCollectionIdsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListCollectionIdsResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new

# Call the list_collection_ids method.
result = client.list_collection_ids request

# The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse.
p result
```

### #list_documents

    def list_documents(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>
    def list_documents(parent: nil, collection_id: nil, page_size: nil, page_token: nil, order_by: nil, mask: nil, transaction: nil, read_time: nil, show_missing: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>

Lists documents.
**Overloads**

    def list_documents(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>

Pass arguments to `list_documents` via a request object, either of type [ListDocumentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListDocumentsRequest "Google::Cloud::Firestore::V1::ListDocumentsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::ListDocumentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListDocumentsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_documents(parent: nil, collection_id: nil, page_size: nil, page_token: nil, order_by: nil, mask: nil, transaction: nil, read_time: nil, show_missing: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Document>

Pass arguments to `list_documents` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::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`
- **collection_id** (::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`.
- **page_size** (::Integer) --- Optional. The maximum number of documents to return in a single response.


  Firestore may return fewer than this value.
- **page_token** (::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.
- **order_by** (::String) --- Optional. The optional ordering of the documents to return.


  For example: `priority desc, __name__ desc`.

  This mirrors the [`ORDER BY`](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-StructuredQuery#Google__Cloud__Firestore__V1__StructuredQuery_order_by_instance_ "Google::Cloud::Firestore::V1::StructuredQuery#order_by (method)")
  used in Firestore queries but in a string representation. When absent,
  documents are ordered based on `__name__ ASC`.
- **mask** ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask), ::Hash) --- 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.
- **transaction** (::String) --- Perform the read as part of an already active transaction.


  Note: The following parameters are mutually exclusive: `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **read_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Timestamp), ::Hash) --- 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.

  Note: The following parameters are mutually exclusive: `read_time`, `transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **show_missing** (::Boolean) --- 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`](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document#Google__Cloud__Firestore__V1__Document_create_time_instance_ "Google::Cloud::Firestore::V1::Document#create_time (method)"), or
  [`update_time`](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document#Google__Cloud__Firestore__V1__Document_update_time_instance_ "Google::Cloud::Firestore::V1::Document#update_time (method)") set.

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

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new

# Call the list_documents method.
result = client.list_documents request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Firestore::V1::Document.
  p item
end
```

### #listen

    def listen(request, options = nil) { |response, operation| ... } -> ::Enumerable<::Google::Cloud::Firestore::V1::ListenResponse>

Listens to changes. This method is only available via gRPC or WebChannel
(not REST).
**Parameters**

- **request** (::Gapic::StreamInput, ::Enumerable\<[::Google::Cloud::Firestore::V1::ListenRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListenRequest), ::Hash\>) --- An enumerable of [ListenRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListenRequest "Google::Cloud::Firestore::V1::ListenRequest (class)") instances.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Enumerable\<[::Google::Cloud::Firestore::V1::ListenResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListenResponse)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Enumerable\<[::Google::Cloud::Firestore::V1::ListenResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ListenResponse)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create an input stream.
input = Gapic::StreamInput.new

# Call the listen method to start streaming.
output = client.listen input

# Send requests on the stream. For each request object, set fields by
# passing keyword arguments. Be sure to close the stream when done.
input << Google::Cloud::Firestore::V1::ListenRequest.new
input << Google::Cloud::Firestore::V1::ListenRequest.new
input.close

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::Firestore::V1::ListenResponse
output.each do |current_response|
  p current_response
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #partition_query

    def partition_query(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>
    def partition_query(parent: nil, structured_query: nil, partition_count: nil, page_token: nil, page_size: nil, read_time: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>

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.
**Overloads**

    def partition_query(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>

Pass arguments to `partition_query` via a request object, either of type [PartitionQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-PartitionQueryRequest "Google::Cloud::Firestore::V1::PartitionQueryRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::PartitionQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-PartitionQueryRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def partition_query(parent: nil, structured_query: nil, partition_count: nil, page_token: nil, page_size: nil, read_time: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::V1::Cursor>

Pass arguments to `partition_query` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **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.
- **structured_query** ([::Google::Cloud::Firestore::V1::StructuredQuery](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-StructuredQuery), ::Hash) --- 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.
- **partition_count** (::Integer) --- 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.
- **page_token** (::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
- **page_size** (::Integer) --- 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`.
- **read_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Timestamp), ::Hash) --- 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.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Firestore::V1::Cursor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Cursor)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Firestore::V1::Cursor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Cursor)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new

# Call the partition_query method.
result = client.partition_query request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Firestore::V1::Cursor.
  p item
end
```

### #rollback

    def rollback(request, options = nil) -> ::Google::Protobuf::Empty
    def rollback(database: nil, transaction: nil) -> ::Google::Protobuf::Empty

Rolls back a transaction.
**Overloads**

    def rollback(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `rollback` via a request object, either of type [RollbackRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-RollbackRequest "Google::Cloud::Firestore::V1::RollbackRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::RollbackRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-RollbackRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def rollback(database: nil, transaction: nil) -> ::Google::Protobuf::Empty

Pass arguments to `rollback` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **database** (::String) --- Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`.
- **transaction** (::String) --- Required. The transaction to roll back.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::RollbackRequest.new

# Call the rollback method.
result = client.rollback request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #run_aggregation_query

    def run_aggregation_query(request, options = nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::RunAggregationQueryResponse>
    def run_aggregation_query(parent: nil, structured_aggregation_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::RunAggregationQueryResponse>

Runs an aggregation query.


Rather than producing [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document "Google::Cloud::Firestore::V1::Document (class)") results like
[Firestore.RunQuery](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client#Google__Cloud__Firestore__V1__Firestore__Client_run_query_instance_ "Google::Cloud::Firestore::V1::Firestore::Client#run_query (method)"), this API
allows running an aggregation to produce a series of
[AggregationResult](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-AggregationResult "Google::Cloud::Firestore::V1::AggregationResult (class)") server-side.

High-Level Example:

<br />

`
-- Return the number of documents in table given a filter.
SELECT COUNT(*) FROM ( SELECT * FROM k where a = true );
`
**Overloads**

    def run_aggregation_query(request, options = nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::RunAggregationQueryResponse>

Pass arguments to `run_aggregation_query` via a request object, either of type [RunAggregationQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-RunAggregationQueryRequest "Google::Cloud::Firestore::V1::RunAggregationQueryRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::RunAggregationQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-RunAggregationQueryRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def run_aggregation_query(parent: nil, structured_aggregation_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::RunAggregationQueryResponse>

Pass arguments to `run_aggregation_query` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::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`
- **structured_aggregation_query** ([::Google::Cloud::Firestore::V1::StructuredAggregationQuery](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-StructuredAggregationQuery), ::Hash) --- An aggregation query.
- **transaction** (::String) --- Run the aggregation within an already active transaction.


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

  Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **new_transaction** ([::Google::Cloud::Firestore::V1::TransactionOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-TransactionOptions), ::Hash) --- 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.

  Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **read_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Timestamp), ::Hash) --- 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.

  Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **explain_options** ([::Google::Cloud::Firestore::V1::ExplainOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ExplainOptions), ::Hash) --- Optional. Explain options for the query. If set, additional query statistics will be returned. If not, only query results will be returned.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Enumerable\<[::Google::Cloud::Firestore::V1::RunAggregationQueryResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-RunAggregationQueryResponse)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Enumerable\<[::Google::Cloud::Firestore::V1::RunAggregationQueryResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-RunAggregationQueryResponse)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new

# Call the run_aggregation_query method to start streaming.
output = client.run_aggregation_query request

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse
output.each do |current_response|
  p current_response
end
```

### #run_query

    def run_query(request, options = nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::RunQueryResponse>
    def run_query(parent: nil, structured_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::RunQueryResponse>

Runs a query.
**Overloads**

    def run_query(request, options = nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::RunQueryResponse>

Pass arguments to `run_query` via a request object, either of type [RunQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-RunQueryRequest "Google::Cloud::Firestore::V1::RunQueryRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::RunQueryRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-RunQueryRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def run_query(parent: nil, structured_query: nil, transaction: nil, new_transaction: nil, read_time: nil, explain_options: nil) -> ::Enumerable<::Google::Cloud::Firestore::V1::RunQueryResponse>

Pass arguments to `run_query` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::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`
- **structured_query** ([::Google::Cloud::Firestore::V1::StructuredQuery](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-StructuredQuery), ::Hash) --- A structured query.
- **transaction** (::String) --- Run the query within an already active transaction.


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

  Note: The following parameters are mutually exclusive: `transaction`, `new_transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **new_transaction** ([::Google::Cloud::Firestore::V1::TransactionOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-TransactionOptions), ::Hash) --- 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.


  Note: The following parameters are mutually exclusive: `new_transaction`, `transaction`, `read_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **read_time** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Protobuf-Timestamp), ::Hash) --- 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.

  Note: The following parameters are mutually exclusive: `read_time`, `transaction`, `new_transaction`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **explain_options** ([::Google::Cloud::Firestore::V1::ExplainOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-ExplainOptions), ::Hash) --- Optional. Explain options for the query. If set, additional query statistics will be returned. If not, only query results will be returned.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Enumerable\<[::Google::Cloud::Firestore::V1::RunQueryResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-RunQueryResponse)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Enumerable\<[::Google::Cloud::Firestore::V1::RunQueryResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-RunQueryResponse)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::RunQueryRequest.new

# Call the run_query method to start streaming.
output = client.run_query request

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::Firestore::V1::RunQueryResponse
output.each do |current_response|
  p current_response
end
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_document

    def update_document(request, options = nil) -> ::Google::Cloud::Firestore::V1::Document
    def update_document(document: nil, update_mask: nil, mask: nil, current_document: nil) -> ::Google::Cloud::Firestore::V1::Document

Updates or inserts a document.
**Overloads**

    def update_document(request, options = nil) -> ::Google::Cloud::Firestore::V1::Document

Pass arguments to `update_document` via a request object, either of type [UpdateDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-UpdateDocumentRequest "Google::Cloud::Firestore::V1::UpdateDocumentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Firestore::V1::UpdateDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-UpdateDocumentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def update_document(document: nil, update_mask: nil, mask: nil, current_document: nil) -> ::Google::Cloud::Firestore::V1::Document

Pass arguments to `update_document` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **document** ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document), ::Hash) --- Required. The updated document. Creates the document if it does not already exist.
- **update_mask** ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask), ::Hash) --- 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.
- **mask** ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask), ::Hash) --- 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.
- **current_document** ([::Google::Cloud::Firestore::V1::Precondition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Precondition), ::Hash) --- An optional precondition on the document. The request will fail if this is set and not met by the target document.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new

# Call the update_document method.
result = client.update_document request

# The returned object is of type Google::Cloud::Firestore::V1::Document.
p result
```

### #write

    def write(request, options = nil) { |response, operation| ... } -> ::Enumerable<::Google::Cloud::Firestore::V1::WriteResponse>

Streams batches of document updates and deletes, in order. This method is
only available via gRPC or WebChannel (not REST).
**Parameters**

- **request** (::Gapic::StreamInput, ::Enumerable\<[::Google::Cloud::Firestore::V1::WriteRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-WriteRequest), ::Hash\>) --- An enumerable of [WriteRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-WriteRequest "Google::Cloud::Firestore::V1::WriteRequest (class)") instances.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Enumerable\<[::Google::Cloud::Firestore::V1::WriteResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-WriteResponse)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Enumerable\<[::Google::Cloud::Firestore::V1::WriteResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-WriteResponse)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/firestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Firestore::V1::Firestore::Client.new

# Create an input stream.
input = Gapic::StreamInput.new

# Call the write method to start streaming.
output = client.write input

# Send requests on the stream. For each request object, set fields by
# passing keyword arguments. Be sure to close the stream when done.
input << Google::Cloud::Firestore::V1::WriteRequest.new
input << Google::Cloud::Firestore::V1::WriteRequest.new
input.close

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::Firestore::V1::WriteResponse
output.each do |current_response|
  p current_response
end
```