Class NotificationConfig.Builder (2.28.0)

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
Type Description
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
Name Description
values Iterable<String>

The eventTypes to add.

Returns
Type Description
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
Name Description
value String

The eventTypes to add.

Returns
Type Description
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
Name Description
value ByteString

The bytes of the eventTypes to add.

Returns
Type Description
NotificationConfig.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public NotificationConfig build()
Returns
Type Description
NotificationConfig

buildPartial()

public NotificationConfig buildPartial()
Returns
Type Description
NotificationConfig

clear()

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

clearCustomAttributes()

public NotificationConfig.Builder clearCustomAttributes()
Returns
Type Description
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
Type Description
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
Type Description
NotificationConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public NotificationConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
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
Type Description
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
Type Description
NotificationConfig.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public NotificationConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
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
Type Description
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
Type Description
NotificationConfig.Builder

This builder for chaining.

clone()

public NotificationConfig.Builder clone()
Returns
Type Description
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
Name Description
key String
Returns
Type Description
boolean

getCustomAttributes()

public Map<String,String> getCustomAttributes()
Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
key String
defaultValue String
Returns
Type Description
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
Name Description
key String
Returns
Type Description
String

getDefaultInstanceForType()

public NotificationConfig getDefaultInstanceForType()
Returns
Type Description
NotificationConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
index int

The index of the element to return.

Returns
Type Description
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
Name Description
index int

The index of the value to return.

Returns
Type Description
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
Type Description
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
Type Description
ProtocolStringList

A list containing the eventTypes.

getMutableCustomAttributes()

public Map<String,String> getMutableCustomAttributes()

Use alternate mutation accessors instead.

Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
String

The payloadFormat.

getPayloadFormatBytes()

public ByteString getPayloadFormatBytes()

Required. The desired content of the Payload.

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

Returns
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for topic.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
Name Description
number int
Returns
Type Description
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
Name Description
number int
Returns
Type Description
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeFrom(NotificationConfig other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final NotificationConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
values Map<String,String>
Returns
Type Description
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
Name Description
key String
value String
Returns
Type Description
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
Name Description
key String
Returns
Type Description
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
Name Description
value String

The etag to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for etag to set.

Returns
Type Description
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
Name Description
index int

The index to set the value at.

value String

The eventTypes to set.

Returns
Type Description
NotificationConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public NotificationConfig.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value String

The name to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
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
Name Description
value String

The objectNamePrefix to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for objectNamePrefix to set.

Returns
Type Description
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
Name Description
value String

The payloadFormat to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for payloadFormat to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
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
Name Description
value String

The topic to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for topic to set.

Returns
Type Description
NotificationConfig.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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