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.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eWriteRequest\u003c/code\u003e class is part of the Firestore v1 API and is used to send write operations to the Firestore database.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of \u003ccode\u003eWriteRequest\u003c/code\u003e is 3.10.0, and the page lists a history of versions ranging from 2.3.0 to 3.10.0.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eWriteRequest\u003c/code\u003e can either create a new stream or resume an existing one, based on the \u003ccode\u003eStreamId\u003c/code\u003e and \u003ccode\u003eStreamToken\u003c/code\u003e properties.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eWrites\u003c/code\u003e property contains the actual write operations that will be applied atomically and in order, and the \u003ccode\u003eDatabase\u003c/code\u003e property specifies the target database for these writes.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eWriteRequest\u003c/code\u003e class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and has two constructors: a default one and one that takes another \u003ccode\u003eWriteRequest\u003c/code\u003e as a parameter.\u003c/p\u003e\n"]]],[],null,["# Firestore v1 API - Class WriteRequest (3.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.10.0 (latest)](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.WriteRequest)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.9.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.8.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.7.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.6.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [3.5.1](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.5.1/Google.Cloud.Firestore.V1.WriteRequest)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.4.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.3.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.2.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.1.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.0.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.5.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.4.0/Google.Cloud.Firestore.V1.WriteRequest)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.3.0/Google.Cloud.Firestore.V1.WriteRequest) \n\n public sealed class WriteRequest : IMessage\u003cWriteRequest\u003e, IEquatable\u003cWriteRequest\u003e, IDeepCloneable\u003cWriteRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Firestore v1 API class WriteRequest.\n\nThe request for \\[Firestore.Write\\]\\[google.firestore.v1.Firestore.Write\\].\n\nThe first request creates a stream, or resumes an existing one from a token.\n\nWhen creating a new stream, the server replies with a response containing\nonly an ID and a token, to use in the next request.\n\nWhen resuming a stream, the server first streams any responses later than the\ngiven token, then a response containing only an up-to-date token, to use in\nthe next request. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e WriteRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[WriteRequest](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.WriteRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[WriteRequest](/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](/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) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Firestore.V1](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Firestore.V1.dll\n\nConstructors\n------------\n\n### WriteRequest()\n\n public WriteRequest()\n\n### WriteRequest(WriteRequest)\n\n public WriteRequest(WriteRequest other)\n\nProperties\n----------\n\n### Database\n\n public string Database { get; set; }\n\nRequired. The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.\nThis is only required in the first message.\n\n### Labels\n\n public MapField\u003cstring, string\u003e Labels { get; }\n\nLabels associated with this write request.\n\n### StreamId\n\n public string StreamId { get; set; }\n\nThe ID of the write stream to resume.\nThis may only be set in the first message. When left empty, a new write\nstream will be created.\n\n### StreamToken\n\n public ByteString StreamToken { get; set; }\n\nA stream token that was previously sent by the server.\n\nThe client should set this field to the token from the most recent\n\\[WriteResponse\\]\\[google.firestore.v1.WriteResponse\\] it has received. This\nacknowledges that the client has received responses up to this token. After\nsending this token, earlier tokens may not be used anymore.\n\nThe server may close the stream if there are too many unacknowledged\nresponses.\n\nLeave this field unset when creating a new stream. To resume a stream at\na specific point, set this field and the `stream_id` field.\n\nLeave this field unset when creating a new stream.\n\n### Writes\n\n public RepeatedField\u003cWrite\u003e Writes { get; }\n\nThe writes to apply.\n\nAlways executed atomically and in order.\nThis must be empty on the first request.\nThis may be empty on the last request.\nThis must not be empty on all other requests."]]