Class WriteRequest (3.9.6)

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
TypeDescription
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
TypeDescription
int

STREAM_ID_FIELD_NUMBER

public static final int STREAM_ID_FIELD_NUMBER
Field Value
TypeDescription
int

STREAM_TOKEN_FIELD_NUMBER

public static final int STREAM_TOKEN_FIELD_NUMBER
Field Value
TypeDescription
int

WRITES_FIELD_NUMBER

public static final int WRITES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static WriteRequest getDefaultInstance()
Returns
TypeDescription
WriteRequest

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static WriteRequest.Builder newBuilder()
Returns
TypeDescription
WriteRequest.Builder

newBuilder(WriteRequest prototype)

public static WriteRequest.Builder newBuilder(WriteRequest prototype)
Parameter
NameDescription
prototypeWriteRequest
Returns
TypeDescription
WriteRequest.Builder

parseDelimitedFrom(InputStream input)

public static WriteRequest parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static WriteRequest parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static WriteRequest parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static WriteRequest parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static WriteRequest parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static WriteRequest parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static WriteRequest parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WriteRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<WriteRequest> parser()
Returns
TypeDescription
Parser<WriteRequest>

Methods

containsLabels(String key)

public boolean containsLabels(String key)

Labels associated with this write request.

map<string, string> labels = 5;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for database.

getDefaultInstanceForType()

public WriteRequest getDefaultInstanceForType()
Returns
TypeDescription
WriteRequest

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Labels associated with this write request.

map<string, string> labels = 5;

Returns
TypeDescription
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Labels associated with this write request.

map<string, string> labels = 5;

Returns
TypeDescription
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
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Labels associated with this write request.

map<string, string> labels = 5;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getParserForType()

public Parser<WriteRequest> getParserForType()
Returns
TypeDescription
Parser<WriteRequest>
Overrides

getSerializedSize()

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

The streamToken.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
List<? extends com.google.firestore.v1.WriteOrBuilder>

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public WriteRequest.Builder newBuilderForType()
Returns
TypeDescription
WriteRequest.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected WriteRequest.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
WriteRequest.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public WriteRequest.Builder toBuilder()
Returns
TypeDescription
WriteRequest.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException