Class PublishRequest.Builder (1.134.2)

public static final class PublishRequest.Builder extends GeneratedMessageV3.Builder<PublishRequest.Builder> implements PublishRequestOrBuilder

Request for the Publish method.

Protobuf type google.pubsub.v1.PublishRequest

Static Methods

getDescriptor()

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

Methods

addAllMessages(Iterable<? extends PubsubMessage> values)

public PublishRequest.Builder addAllMessages(Iterable<? extends PubsubMessage> values)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<? extends com.google.pubsub.v1.PubsubMessage>
Returns
Type Description
PublishRequest.Builder

addMessages(PubsubMessage value)

public PublishRequest.Builder addMessages(PubsubMessage value)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value PubsubMessage
Returns
Type Description
PublishRequest.Builder

addMessages(PubsubMessage.Builder builderForValue)

public PublishRequest.Builder addMessages(PubsubMessage.Builder builderForValue)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue PubsubMessage.Builder
Returns
Type Description
PublishRequest.Builder

addMessages(int index, PubsubMessage value)

public PublishRequest.Builder addMessages(int index, PubsubMessage value)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
value PubsubMessage
Returns
Type Description
PublishRequest.Builder

addMessages(int index, PubsubMessage.Builder builderForValue)

public PublishRequest.Builder addMessages(int index, PubsubMessage.Builder builderForValue)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
builderForValue PubsubMessage.Builder
Returns
Type Description
PublishRequest.Builder

addMessagesBuilder()

public PubsubMessage.Builder addMessagesBuilder()

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
PubsubMessage.Builder

addMessagesBuilder(int index)

public PubsubMessage.Builder addMessagesBuilder(int index)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
PubsubMessage.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public PublishRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
PublishRequest.Builder
Overrides

build()

public PublishRequest build()
Returns
Type Description
PublishRequest

buildPartial()

public PublishRequest buildPartial()
Returns
Type Description
PublishRequest

clear()

public PublishRequest.Builder clear()
Returns
Type Description
PublishRequest.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public PublishRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
PublishRequest.Builder
Overrides

clearMessages()

public PublishRequest.Builder clearMessages()

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
PublishRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public PublishRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
PublishRequest.Builder
Overrides

clearTopic()

public PublishRequest.Builder clearTopic()

Required. The messages in the request will be published on this topic. Format is projects/{project}/topics/{topic}.

string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
PublishRequest.Builder

This builder for chaining.

clone()

public PublishRequest.Builder clone()
Returns
Type Description
PublishRequest.Builder
Overrides

getDefaultInstanceForType()

public PublishRequest getDefaultInstanceForType()
Returns
Type Description
PublishRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMessages(int index)

public PubsubMessage getMessages(int index)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
PubsubMessage

getMessagesBuilder(int index)

public PubsubMessage.Builder getMessagesBuilder(int index)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
PubsubMessage.Builder

getMessagesBuilderList()

public List<PubsubMessage.Builder> getMessagesBuilderList()

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<Builder>

getMessagesCount()

public int getMessagesCount()

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

getMessagesList()

public List<PubsubMessage> getMessagesList()

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<PubsubMessage>

getMessagesOrBuilder(int index)

public PubsubMessageOrBuilder getMessagesOrBuilder(int index)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
PubsubMessageOrBuilder

getMessagesOrBuilderList()

public List<? extends PubsubMessageOrBuilder> getMessagesOrBuilderList()

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<? extends com.google.pubsub.v1.PubsubMessageOrBuilder>

getTopic()

public String getTopic()

Required. The messages in the request will be published on this topic. Format is projects/{project}/topics/{topic}.

string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The topic.

getTopicBytes()

public ByteString getTopicBytes()

Required. The messages in the request will be published on this topic. Format is projects/{project}/topics/{topic}.

string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for topic.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public PublishRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PublishRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public PublishRequest.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
PublishRequest.Builder
Overrides

mergeFrom(PublishRequest other)

public PublishRequest.Builder mergeFrom(PublishRequest other)
Parameter
Name Description
other PublishRequest
Returns
Type Description
PublishRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PublishRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
PublishRequest.Builder
Overrides

removeMessages(int index)

public PublishRequest.Builder removeMessages(int index)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
PublishRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public PublishRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
PublishRequest.Builder
Overrides

setMessages(int index, PubsubMessage value)

public PublishRequest.Builder setMessages(int index, PubsubMessage value)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
value PubsubMessage
Returns
Type Description
PublishRequest.Builder

setMessages(int index, PubsubMessage.Builder builderForValue)

public PublishRequest.Builder setMessages(int index, PubsubMessage.Builder builderForValue)

Required. The messages to publish.

repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
builderForValue PubsubMessage.Builder
Returns
Type Description
PublishRequest.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public PublishRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
PublishRequest.Builder
Overrides

setTopic(String value)

public PublishRequest.Builder setTopic(String value)

Required. The messages in the request will be published on this topic. Format is projects/{project}/topics/{topic}.

string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The topic to set.

Returns
Type Description
PublishRequest.Builder

This builder for chaining.

setTopicBytes(ByteString value)

public PublishRequest.Builder setTopicBytes(ByteString value)

Required. The messages in the request will be published on this topic. Format is projects/{project}/topics/{topic}.

string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for topic to set.

Returns
Type Description
PublishRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final PublishRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
PublishRequest.Builder
Overrides