Class PubsubTarget.Builder (2.46.0)

public static final class PubsubTarget.Builder extends GeneratedMessageV3.Builder<PubsubTarget.Builder> implements PubsubTargetOrBuilder

Pub/Sub target. The job will be delivered by publishing a message to the given Pub/Sub topic.

Protobuf type google.cloud.scheduler.v1beta1.PubsubTarget

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public PubsubTarget build()
Returns
Type Description
PubsubTarget

buildPartial()

public PubsubTarget buildPartial()
Returns
Type Description
PubsubTarget

clear()

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

clearAttributes()

public PubsubTarget.Builder clearAttributes()
Returns
Type Description
PubsubTarget.Builder

clearData()

public PubsubTarget.Builder clearData()

The message payload for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

bytes data = 3;

Returns
Type Description
PubsubTarget.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearTopicName()

public PubsubTarget.Builder clearTopicName()

Required. The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's PublishRequest.name, for example projects/PROJECT_ID/topics/TOPIC_ID.

The topic must be in the same project as the Cloud Scheduler job.

string topic_name = 1 [(.google.api.resource_reference) = { ... }

Returns
Type Description
PubsubTarget.Builder

This builder for chaining.

clone()

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

containsAttributes(String key)

public boolean containsAttributes(String key)

Attributes for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

map<string, string> attributes = 4;

Parameter
Name Description
key String
Returns
Type Description
boolean

getAttributes() (deprecated)

public Map<String,String> getAttributes()

Use #getAttributesMap() instead.

Returns
Type Description
Map<String,String>

getAttributesCount()

public int getAttributesCount()

Attributes for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

map<string, string> attributes = 4;

Returns
Type Description
int

getAttributesMap()

public Map<String,String> getAttributesMap()

Attributes for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

map<string, string> attributes = 4;

Returns
Type Description
Map<String,String>

getAttributesOrDefault(String key, String defaultValue)

public String getAttributesOrDefault(String key, String defaultValue)

Attributes for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

map<string, string> attributes = 4;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getAttributesOrThrow(String key)

public String getAttributesOrThrow(String key)

Attributes for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

map<string, string> attributes = 4;

Parameter
Name Description
key String
Returns
Type Description
String

getData()

public ByteString getData()

The message payload for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

bytes data = 3;

Returns
Type Description
ByteString

The data.

getDefaultInstanceForType()

public PubsubTarget getDefaultInstanceForType()
Returns
Type Description
PubsubTarget

getDescriptorForType()

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

getMutableAttributes() (deprecated)

public Map<String,String> getMutableAttributes()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getTopicName()

public String getTopicName()

Required. The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's PublishRequest.name, for example projects/PROJECT_ID/topics/TOPIC_ID.

The topic must be in the same project as the Cloud Scheduler job.

string topic_name = 1 [(.google.api.resource_reference) = { ... }

Returns
Type Description
String

The topicName.

getTopicNameBytes()

public ByteString getTopicNameBytes()

Required. The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's PublishRequest.name, for example projects/PROJECT_ID/topics/TOPIC_ID.

The topic must be in the same project as the Cloud Scheduler job.

string topic_name = 1 [(.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for topicName.

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.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(PubsubTarget other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllAttributes(Map<String,String> values)

public PubsubTarget.Builder putAllAttributes(Map<String,String> values)

Attributes for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

map<string, string> attributes = 4;

Parameter
Name Description
values Map<String,String>
Returns
Type Description
PubsubTarget.Builder

putAttributes(String key, String value)

public PubsubTarget.Builder putAttributes(String key, String value)

Attributes for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

map<string, string> attributes = 4;

Parameters
Name Description
key String
value String
Returns
Type Description
PubsubTarget.Builder

removeAttributes(String key)

public PubsubTarget.Builder removeAttributes(String key)

Attributes for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

map<string, string> attributes = 4;

Parameter
Name Description
key String
Returns
Type Description
PubsubTarget.Builder

setData(ByteString value)

public PubsubTarget.Builder setData(ByteString value)

The message payload for PubsubMessage.

Pubsub message must contain either non-empty data, or at least one attribute.

bytes data = 3;

Parameter
Name Description
value ByteString

The data to set.

Returns
Type Description
PubsubTarget.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setTopicName(String value)

public PubsubTarget.Builder setTopicName(String value)

Required. The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's PublishRequest.name, for example projects/PROJECT_ID/topics/TOPIC_ID.

The topic must be in the same project as the Cloud Scheduler job.

string topic_name = 1 [(.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The topicName to set.

Returns
Type Description
PubsubTarget.Builder

This builder for chaining.

setTopicNameBytes(ByteString value)

public PubsubTarget.Builder setTopicNameBytes(ByteString value)

Required. The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's PublishRequest.name, for example projects/PROJECT_ID/topics/TOPIC_ID.

The topic must be in the same project as the Cloud Scheduler job.

string topic_name = 1 [(.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for topicName to set.

Returns
Type Description
PubsubTarget.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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