Class NotificationConfig.Builder (2.22.2)

public static final class NotificationConfig.Builder extends GeneratedMessageV3.Builder<NotificationConfig.Builder> implements NotificationConfigOrBuilder

A directive to publish Pub/Sub notifications upon changes to a bucket.

Protobuf type google.storage.v2.NotificationConfig

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllEventTypes(Iterable<String> values)

public NotificationConfig.Builder addAllEventTypes(Iterable<String> values)

If present, only send notifications about listed event types. If empty, sent notifications for all event types.

repeated string event_types = 3;

Parameter
NameDescription
valuesIterable<String>

The eventTypes to add.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

addEventTypes(String value)

public NotificationConfig.Builder addEventTypes(String value)

If present, only send notifications about listed event types. If empty, sent notifications for all event types.

repeated string event_types = 3;

Parameter
NameDescription
valueString

The eventTypes to add.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

addEventTypesBytes(ByteString value)

public NotificationConfig.Builder addEventTypesBytes(ByteString value)

If present, only send notifications about listed event types. If empty, sent notifications for all event types.

repeated string event_types = 3;

Parameter
NameDescription
valueByteString

The bytes of the eventTypes to add.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public NotificationConfig build()
Returns
TypeDescription
NotificationConfig

buildPartial()

public NotificationConfig buildPartial()
Returns
TypeDescription
NotificationConfig

clear()

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

clearCustomAttributes()

public NotificationConfig.Builder clearCustomAttributes()
Returns
TypeDescription
NotificationConfig.Builder

clearEtag()

public NotificationConfig.Builder clearEtag()

The etag of the NotificationConfig. If included in the metadata of GetNotificationConfigRequest, the operation will only be performed if the etag matches that of the NotificationConfig.

string etag = 7;

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

clearEventTypes()

public NotificationConfig.Builder clearEventTypes()

If present, only send notifications about listed event types. If empty, sent notifications for all event types.

repeated string event_types = 3;

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearName()

public NotificationConfig.Builder clearName()

Required. The resource name of this NotificationConfig. Format: projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig} The {project} portion may be _ for globally unique buckets.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

clearObjectNamePrefix()

public NotificationConfig.Builder clearObjectNamePrefix()

If present, only apply this NotificationConfig to object names that begin with this prefix.

string object_name_prefix = 5;

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public NotificationConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
NotificationConfig.Builder
Overrides

clearPayloadFormat()

public NotificationConfig.Builder clearPayloadFormat()

Required. The desired content of the Payload.

string payload_format = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

clearTopic()

public NotificationConfig.Builder clearTopic()

Required. The Pub/Sub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'

string topic = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

clone()

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

containsCustomAttributes(String key)

public boolean containsCustomAttributes(String key)

A list of additional attributes to attach to each Pub/Sub message published for this NotificationConfig.

map<string, string> custom_attributes = 4;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getCustomAttributes()

public Map<String,String> getCustomAttributes()
Returns
TypeDescription
Map<String,String>

getCustomAttributesCount()

public int getCustomAttributesCount()

A list of additional attributes to attach to each Pub/Sub message published for this NotificationConfig.

map<string, string> custom_attributes = 4;

Returns
TypeDescription
int

getCustomAttributesMap()

public Map<String,String> getCustomAttributesMap()

A list of additional attributes to attach to each Pub/Sub message published for this NotificationConfig.

map<string, string> custom_attributes = 4;

Returns
TypeDescription
Map<String,String>

getCustomAttributesOrDefault(String key, String defaultValue)

public String getCustomAttributesOrDefault(String key, String defaultValue)

A list of additional attributes to attach to each Pub/Sub message published for this NotificationConfig.

map<string, string> custom_attributes = 4;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getCustomAttributesOrThrow(String key)

public String getCustomAttributesOrThrow(String key)

A list of additional attributes to attach to each Pub/Sub message published for this NotificationConfig.

map<string, string> custom_attributes = 4;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getDefaultInstanceForType()

public NotificationConfig getDefaultInstanceForType()
Returns
TypeDescription
NotificationConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getEtag()

public String getEtag()

The etag of the NotificationConfig. If included in the metadata of GetNotificationConfigRequest, the operation will only be performed if the etag matches that of the NotificationConfig.

string etag = 7;

Returns
TypeDescription
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

The etag of the NotificationConfig. If included in the metadata of GetNotificationConfigRequest, the operation will only be performed if the etag matches that of the NotificationConfig.

string etag = 7;

Returns
TypeDescription
ByteString

The bytes for etag.

getEventTypes(int index)

public String getEventTypes(int index)

If present, only send notifications about listed event types. If empty, sent notifications for all event types.

repeated string event_types = 3;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The eventTypes at the given index.

getEventTypesBytes(int index)

public ByteString getEventTypesBytes(int index)

If present, only send notifications about listed event types. If empty, sent notifications for all event types.

repeated string event_types = 3;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the eventTypes at the given index.

getEventTypesCount()

public int getEventTypesCount()

If present, only send notifications about listed event types. If empty, sent notifications for all event types.

repeated string event_types = 3;

Returns
TypeDescription
int

The count of eventTypes.

getEventTypesList()

public ProtocolStringList getEventTypesList()

If present, only send notifications about listed event types. If empty, sent notifications for all event types.

repeated string event_types = 3;

Returns
TypeDescription
ProtocolStringList

A list containing the eventTypes.

getMutableCustomAttributes()

public Map<String,String> getMutableCustomAttributes()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getName()

public String getName()

Required. The resource name of this NotificationConfig. Format: projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig} The {project} portion may be _ for globally unique buckets.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Required. The resource name of this NotificationConfig. Format: projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig} The {project} portion may be _ for globally unique buckets.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for name.

getObjectNamePrefix()

public String getObjectNamePrefix()

If present, only apply this NotificationConfig to object names that begin with this prefix.

string object_name_prefix = 5;

Returns
TypeDescription
String

The objectNamePrefix.

getObjectNamePrefixBytes()

public ByteString getObjectNamePrefixBytes()

If present, only apply this NotificationConfig to object names that begin with this prefix.

string object_name_prefix = 5;

Returns
TypeDescription
ByteString

The bytes for objectNamePrefix.

getPayloadFormat()

public String getPayloadFormat()

Required. The desired content of the Payload.

string payload_format = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The payloadFormat.

getPayloadFormatBytes()

public ByteString getPayloadFormatBytes()

Required. The desired content of the Payload.

string payload_format = 6 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for payloadFormat.

getTopic()

public String getTopic()

Required. The Pub/Sub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'

string topic = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The topic.

getTopicBytes()

public ByteString getTopicBytes()

Required. The Pub/Sub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'

string topic = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for topic.

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(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeFrom(NotificationConfig other)

public NotificationConfig.Builder mergeFrom(NotificationConfig other)
Parameter
NameDescription
otherNotificationConfig
Returns
TypeDescription
NotificationConfig.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final NotificationConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
NotificationConfig.Builder
Overrides

putAllCustomAttributes(Map<String,String> values)

public NotificationConfig.Builder putAllCustomAttributes(Map<String,String> values)

A list of additional attributes to attach to each Pub/Sub message published for this NotificationConfig.

map<string, string> custom_attributes = 4;

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
NotificationConfig.Builder

putCustomAttributes(String key, String value)

public NotificationConfig.Builder putCustomAttributes(String key, String value)

A list of additional attributes to attach to each Pub/Sub message published for this NotificationConfig.

map<string, string> custom_attributes = 4;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
NotificationConfig.Builder

removeCustomAttributes(String key)

public NotificationConfig.Builder removeCustomAttributes(String key)

A list of additional attributes to attach to each Pub/Sub message published for this NotificationConfig.

map<string, string> custom_attributes = 4;

Parameter
NameDescription
keyString
Returns
TypeDescription
NotificationConfig.Builder

setEtag(String value)

public NotificationConfig.Builder setEtag(String value)

The etag of the NotificationConfig. If included in the metadata of GetNotificationConfigRequest, the operation will only be performed if the etag matches that of the NotificationConfig.

string etag = 7;

Parameter
NameDescription
valueString

The etag to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

setEtagBytes(ByteString value)

public NotificationConfig.Builder setEtagBytes(ByteString value)

The etag of the NotificationConfig. If included in the metadata of GetNotificationConfigRequest, the operation will only be performed if the etag matches that of the NotificationConfig.

string etag = 7;

Parameter
NameDescription
valueByteString

The bytes for etag to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

setEventTypes(int index, String value)

public NotificationConfig.Builder setEventTypes(int index, String value)

If present, only send notifications about listed event types. If empty, sent notifications for all event types.

repeated string event_types = 3;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The eventTypes to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setName(String value)

public NotificationConfig.Builder setName(String value)

Required. The resource name of this NotificationConfig. Format: projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig} The {project} portion may be _ for globally unique buckets.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

setNameBytes(ByteString value)

public NotificationConfig.Builder setNameBytes(ByteString value)

Required. The resource name of this NotificationConfig. Format: projects/{project}/buckets/{bucket}/notificationConfigs/{notificationConfig} The {project} portion may be _ for globally unique buckets.

string name = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

setObjectNamePrefix(String value)

public NotificationConfig.Builder setObjectNamePrefix(String value)

If present, only apply this NotificationConfig to object names that begin with this prefix.

string object_name_prefix = 5;

Parameter
NameDescription
valueString

The objectNamePrefix to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

setObjectNamePrefixBytes(ByteString value)

public NotificationConfig.Builder setObjectNamePrefixBytes(ByteString value)

If present, only apply this NotificationConfig to object names that begin with this prefix.

string object_name_prefix = 5;

Parameter
NameDescription
valueByteString

The bytes for objectNamePrefix to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

setPayloadFormat(String value)

public NotificationConfig.Builder setPayloadFormat(String value)

Required. The desired content of the Payload.

string payload_format = 6 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The payloadFormat to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

setPayloadFormatBytes(ByteString value)

public NotificationConfig.Builder setPayloadFormatBytes(ByteString value)

Required. The desired content of the Payload.

string payload_format = 6 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for payloadFormat to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

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

public NotificationConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
NotificationConfig.Builder
Overrides

setTopic(String value)

public NotificationConfig.Builder setTopic(String value)

Required. The Pub/Sub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'

string topic = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The topic to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

setTopicBytes(ByteString value)

public NotificationConfig.Builder setTopicBytes(ByteString value)

Required. The Pub/Sub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'

string topic = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for topic to set.

Returns
TypeDescription
NotificationConfig.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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