Class PubsubTarget.Builder (2.52.0)

publicstaticfinalclass PubsubTarget.BuilderextendsGeneratedMessageV3.Builder<PubsubTarget.Builder>implementsPubsubTargetOrBuilder

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

Protobuf type google.cloud.scheduler.v1.PubsubTarget

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicPubsubTarget.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
PubsubTarget.Builder
Overrides

build()

publicPubsubTargetbuild()
Returns
Type Description
PubsubTarget

buildPartial()

publicPubsubTargetbuildPartial()
Returns
Type Description
PubsubTarget

clear()

publicPubsubTarget.Builderclear()
Returns
Type Description
PubsubTarget.Builder
Overrides

clearAttributes()

publicPubsubTarget.BuilderclearAttributes()
Returns
Type Description
PubsubTarget.Builder

clearData()

publicPubsubTarget.BuilderclearData()

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)

publicPubsubTarget.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
PubsubTarget.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicPubsubTarget.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
PubsubTarget.Builder
Overrides

clearTopicName()

publicPubsubTarget.BuilderclearTopicName()

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()

publicPubsubTarget.Builderclone()
Returns
Type Description
PubsubTarget.Builder
Overrides

containsAttributes(String key)

publicbooleancontainsAttributes(Stringkey)

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)

publicMap<String,String>getAttributes()

Use #getAttributesMap() instead.

Returns
Type Description
Map<String,String>

getAttributesCount()

publicintgetAttributesCount()

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()

publicMap<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)

publicStringgetAttributesOrDefault(Stringkey,StringdefaultValue)

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)

publicStringgetAttributesOrThrow(Stringkey)

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()

publicByteStringgetData()

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()

publicPubsubTargetgetDefaultInstanceForType()
Returns
Type Description
PubsubTarget

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMutableAttributes() (deprecated)

publicMap<String,String>getMutableAttributes()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getTopicName()

publicStringgetTopicName()

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()

publicByteStringgetTopicNameBytes()

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()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protectedMapFieldReflectionAccessorinternalGetMapFieldReflection(intnumber)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

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

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(PubsubTarget other)

publicPubsubTarget.BuildermergeFrom(PubsubTargetother)
Parameter
Name Description
other PubsubTarget
Returns
Type Description
PubsubTarget.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicPubsubTarget.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PubsubTarget.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicPubsubTarget.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
PubsubTarget.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalPubsubTarget.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
PubsubTarget.Builder
Overrides

putAllAttributes(Map<String,String> values)

publicPubsubTarget.BuilderputAllAttributes(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)

publicPubsubTarget.BuilderputAttributes(Stringkey,Stringvalue)

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)

publicPubsubTarget.BuilderremoveAttributes(Stringkey)

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)

publicPubsubTarget.BuildersetData(ByteStringvalue)

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)

publicPubsubTarget.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
PubsubTarget.Builder
Overrides

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

publicPubsubTarget.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
PubsubTarget.Builder
Overrides

setTopicName(String value)

publicPubsubTarget.BuildersetTopicName(Stringvalue)

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)

publicPubsubTarget.BuildersetTopicNameBytes(ByteStringvalue)

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)

publicfinalPubsubTarget.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
PubsubTarget.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.