4.6.0 (latest) 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.5.0 2.4.0 2.3.0

    public sealed class WriteRequest : IMessage<WriteRequest>, IEquatable<WriteRequest>, IDeepCloneable<WriteRequest>, IBufferMessage, IMessage

Reference documentation and code samples for the Firestore v1 API class 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.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> WriteRequest

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[WriteRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.WriteRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[WriteRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.WriteRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[WriteRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.WriteRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Firestore.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1)

## Assembly

Google.Cloud.Firestore.V1.dll

## Constructors

### WriteRequest()

    public WriteRequest()

### WriteRequest(WriteRequest)

    public WriteRequest(WriteRequest other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.WriteRequest` |

## Properties

### Database

    public string Database { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Labels

    public MapField<string, string> Labels { get; }

Labels associated with this write request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.MapField-2.htmlhttps://learn.microsoft.com/dotnet/api/system.stringhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### RequestOptions

    public RequestOptions RequestOptions { get; set; }

Optional. Any additional options for the request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.RequestOptions` |   |

### StreamId

    public string StreamId { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### StreamToken

    public ByteString StreamToken { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString.html` |   |

### Writes

    public RepeatedField<Write> Writes { get; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.Write` |   |