Class WriteRequest (3.25.1)

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
Type Description
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
Type Description
int

STREAM_ID_FIELD_NUMBER

public static final int STREAM_ID_FIELD_NUMBER
Field Value
Type Description
int

STREAM_TOKEN_FIELD_NUMBER

public static final int STREAM_TOKEN_FIELD_NUMBER
Field Value
Type Description
int

WRITES_FIELD_NUMBER

public static final int WRITES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static WriteRequest getDefaultInstance()
Returns
Type Description
WriteRequest

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static WriteRequest.Builder newBuilder()
Returns
Type Description
WriteRequest.Builder

newBuilder(WriteRequest prototype)

public static WriteRequest.Builder newBuilder(WriteRequest prototype)
Parameter
Name Description
prototype WriteRequest
Returns
Type Description
WriteRequest.Builder

parseDelimitedFrom(InputStream input)

public static WriteRequest parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
WriteRequest
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WriteRequest
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static WriteRequest parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
WriteRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WriteRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static WriteRequest parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
WriteRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WriteRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static WriteRequest parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
WriteRequest
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WriteRequest
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static WriteRequest parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
WriteRequest
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WriteRequest
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static WriteRequest parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
WriteRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WriteRequest
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<WriteRequest> parser()
Returns
Type Description
Parser<WriteRequest>

Methods

containsLabels(String key)

public boolean containsLabels(String key)

Labels associated with this write request.

map<string, string> labels = 5;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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
Type Description
ByteString

The bytes for database.

getDefaultInstanceForType()

public WriteRequest getDefaultInstanceForType()
Returns
Type Description
WriteRequest

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Labels associated with this write request.

map<string, string> labels = 5;

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Labels associated with this write request.

map<string, string> labels = 5;

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Labels associated with this write request.

map<string, string> labels = 5;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Labels associated with this write request.

map<string, string> labels = 5;

Parameter
Name Description
key String
Returns
Type Description
String

getParserForType()

public Parser<WriteRequest> getParserForType()
Returns
Type Description
Parser<WriteRequest>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
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
Type Description
ByteString

The bytes for streamId.

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
Type Description
ByteString

The streamToken.

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
Name Description
index int
Returns
Type Description
Write

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
Type Description
int

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
Type Description
List<Write>

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
Name Description
index int
Returns
Type Description
WriteOrBuilder

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()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public WriteRequest.Builder newBuilderForType()
Returns
Type Description
WriteRequest.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected WriteRequest.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
WriteRequest.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public WriteRequest.Builder toBuilder()
Returns
Type Description
WriteRequest.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException