public final class WriteRequest extends GeneratedMessageV3 implements WriteRequestOrBuilder
The request for 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.
Protobuf type google.firestore.v1.WriteRequest
Static Fields
DATABASE_FIELD_NUMBER
public static final int DATABASE_FIELD_NUMBER
Field Value
LABELS_FIELD_NUMBER
public static final int LABELS_FIELD_NUMBER
Field Value
STREAM_ID_FIELD_NUMBER
public static final int STREAM_ID_FIELD_NUMBER
Field Value
STREAM_TOKEN_FIELD_NUMBER
public static final int STREAM_TOKEN_FIELD_NUMBER
Field Value
WRITES_FIELD_NUMBER
public static final int WRITES_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static WriteRequest getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static WriteRequest.Builder newBuilder()
Returns
newBuilder(WriteRequest prototype)
public static WriteRequest.Builder newBuilder(WriteRequest prototype)
Parameter
Returns
public static WriteRequest parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static WriteRequest parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static WriteRequest parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static WriteRequest parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static WriteRequest parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static WriteRequest parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static WriteRequest parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static WriteRequest parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static WriteRequest parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static WriteRequest parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static WriteRequest parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static WriteRequest parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<WriteRequest> parser()
Returns
Methods
containsLabels(String key)
public boolean containsLabels(String key)
Labels associated with this write request.
map<string, string> labels = 5;
Parameter
Returns
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getDatabase()
public String getDatabase()
Required. The database name. In the format:
projects/{project_id}/databases/{database_id}
.
This is only required in the first message.
string database = 1 [(.google.api.field_behavior) = REQUIRED];
Returns
Type | Description |
String | The database.
|
getDatabaseBytes()
public ByteString getDatabaseBytes()
Required. The database name. In the format:
projects/{project_id}/databases/{database_id}
.
This is only required in the first message.
string database = 1 [(.google.api.field_behavior) = REQUIRED];
Returns
getDefaultInstanceForType()
public WriteRequest getDefaultInstanceForType()
Returns
getLabels()
public Map<String,String> getLabels()
Returns
getLabelsCount()
public int getLabelsCount()
Labels associated with this write request.
map<string, string> labels = 5;
Returns
getLabelsMap()
public Map<String,String> getLabelsMap()
Labels associated with this write request.
map<string, string> labels = 5;
Returns
getLabelsOrDefault(String key, String defaultValue)
public String getLabelsOrDefault(String key, String defaultValue)
Labels associated with this write request.
map<string, string> labels = 5;
Parameters
Returns
getLabelsOrThrow(String key)
public String getLabelsOrThrow(String key)
Labels associated with this write request.
map<string, string> labels = 5;
Parameter
Returns
getParserForType()
public Parser<WriteRequest> getParserForType()
Returns
Overrides
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
getStreamId()
public String getStreamId()
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.
string stream_id = 2;
Returns
Type | Description |
String | The streamId.
|
getStreamIdBytes()
public ByteString getStreamIdBytes()
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.
string stream_id = 2;
Returns
getStreamToken()
public ByteString getStreamToken()
A stream token that was previously sent by the server.
The client should set this field to the token from the most recent
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.
bytes stream_token = 4;
Returns
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
getWrites(int index)
public Write getWrites(int index)
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.
repeated .google.firestore.v1.Write writes = 3;
Parameter
Returns
getWritesCount()
public int getWritesCount()
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.
repeated .google.firestore.v1.Write writes = 3;
Returns
getWritesList()
public List<Write> getWritesList()
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.
repeated .google.firestore.v1.Write writes = 3;
Returns
getWritesOrBuilder(int index)
public WriteOrBuilder getWritesOrBuilder(int index)
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.
repeated .google.firestore.v1.Write writes = 3;
Parameter
Returns
getWritesOrBuilderList()
public List<? extends WriteOrBuilder> getWritesOrBuilderList()
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.
repeated .google.firestore.v1.Write writes = 3;
Returns
Type | Description |
List<? extends com.google.firestore.v1.WriteOrBuilder> | |
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Parameter
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public WriteRequest.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected WriteRequest.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public WriteRequest.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions