Class PubsubTarget.Builder (2.16.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public PubsubTarget build()
Returns
TypeDescription
PubsubTarget

buildPartial()

public PubsubTarget buildPartial()
Returns
TypeDescription
PubsubTarget

clear()

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

clearAttributes()

public PubsubTarget.Builder clearAttributes()
Returns
TypeDescription
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
TypeDescription
PubsubTarget.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public PubsubTarget.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
PubsubTarget.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

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

This builder for chaining.

clone()

public PubsubTarget.Builder clone()
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
boolean

getAttributes()

public Map<String,String> getAttributes()

Use #getAttributesMap() instead.

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

The data.

getDefaultInstanceForType()

public PubsubTarget getDefaultInstanceForType()
Returns
TypeDescription
PubsubTarget

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMutableAttributes()

public Map<String,String> getMutableAttributes()

Use alternate mutation accessors instead.

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

The bytes for topicName.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

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

internalGetMutableMapField(int number)

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

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(PubsubTarget other)

public PubsubTarget.Builder mergeFrom(PubsubTarget other)
Parameter
NameDescription
otherPubsubTarget
Returns
TypeDescription
PubsubTarget.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PubsubTarget.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valuesMap<String,String>
Returns
TypeDescription
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
NameDescription
keyString
valueString
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
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
NameDescription
valueByteString

The data to set.

Returns
TypeDescription
PubsubTarget.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

The topicName to set.

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

The bytes for topicName to set.

Returns
TypeDescription
PubsubTarget.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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