Class PublishRequest.Builder (1.116.4)

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
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.pubsub.v1.PubsubMessage>
Returns
TypeDescription
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
NameDescription
valuePubsubMessage
Returns
TypeDescription
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
NameDescription
builderForValuePubsubMessage.Builder
Returns
TypeDescription
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
NameDescription
indexint
valuePubsubMessage
Returns
TypeDescription
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
NameDescription
indexint
builderForValuePubsubMessage.Builder
Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
PubsubMessage.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public PublishRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PublishRequest.Builder
Overrides

build()

public PublishRequest build()
Returns
TypeDescription
PublishRequest

buildPartial()

public PublishRequest buildPartial()
Returns
TypeDescription
PublishRequest

clear()

public PublishRequest.Builder clear()
Returns
TypeDescription
PublishRequest.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public PublishRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
PublishRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public PublishRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
PublishRequest.Builder

This builder for chaining.

clone()

public PublishRequest.Builder clone()
Returns
TypeDescription
PublishRequest.Builder
Overrides

getDefaultInstanceForType()

public PublishRequest getDefaultInstanceForType()
Returns
TypeDescription
PublishRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
List<Builder>

getMessagesCount()

public int getMessagesCount()

Required. The messages to publish.

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

Returns
TypeDescription
int

getMessagesList()

public List<PubsubMessage> getMessagesList()

Required. The messages to publish.

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

Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for topic.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public PublishRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PublishRequest.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public PublishRequest.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
PublishRequest.Builder
Overrides

mergeFrom(PublishRequest other)

public PublishRequest.Builder mergeFrom(PublishRequest other)
Parameter
NameDescription
otherPublishRequest
Returns
TypeDescription
PublishRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PublishRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
PublishRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public PublishRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
indexint
valuePubsubMessage
Returns
TypeDescription
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
NameDescription
indexint
builderForValuePubsubMessage.Builder
Returns
TypeDescription
PublishRequest.Builder

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

public PublishRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The topic to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for topic to set.

Returns
TypeDescription
PublishRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final PublishRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PublishRequest.Builder
Overrides