Class Notification.Builder (2.4.5)

public static final class Notification.Builder extends GeneratedMessageV3.Builder<Notification.Builder> implements NotificationOrBuilder

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

Protobuf type google.storage.v2.Notification

Static Methods

getDescriptor()

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

Methods

addAllEventTypes(Iterable<String> values)

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

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

repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<String>

The eventTypes to add.

Returns
Type Description
Notification.Builder

This builder for chaining.

addEventTypes(String value)

public Notification.Builder addEventTypes(String value)

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

repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The eventTypes to add.

Returns
Type Description
Notification.Builder

This builder for chaining.

addEventTypesBytes(ByteString value)

public Notification.Builder addEventTypesBytes(ByteString value)

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

repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes of the eventTypes to add.

Returns
Type Description
Notification.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Notification build()
Returns
Type Description
Notification

buildPartial()

public Notification buildPartial()
Returns
Type Description
Notification

clear()

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

clearCustomAttributes()

public Notification.Builder clearCustomAttributes()
Returns
Type Description
Notification.Builder

clearEventTypes()

public Notification.Builder clearEventTypes()

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

repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Notification.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearName()

public Notification.Builder clearName()

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

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

Returns
Type Description
Notification.Builder

This builder for chaining.

clearObjectNamePrefix()

public Notification.Builder clearObjectNamePrefix()

Optional. If present, only apply this notification config to object names that begin with this prefix.

string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Notification.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPayloadFormat()

public Notification.Builder clearPayloadFormat()

Required. The desired content of the Payload.

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

Returns
Type Description
Notification.Builder

This builder for chaining.

clearTopic()

public Notification.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
Notification.Builder

This builder for chaining.

clone()

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

containsCustomAttributes(String key)

public boolean containsCustomAttributes(String key)

Optional. An optional list of additional attributes to attach to each Pub/Sub message published for this notification subscription.

map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL];

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

Optional. An optional list of additional attributes to attach to each Pub/Sub message published for this notification subscription.

map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getCustomAttributesMap()

public Map<String,String> getCustomAttributesMap()

Optional. An optional list of additional attributes to attach to each Pub/Sub message published for this notification subscription.

map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Map<String,String>

getCustomAttributesOrDefault(String key, String defaultValue)

public String getCustomAttributesOrDefault(String key, String defaultValue)

Optional. An optional list of additional attributes to attach to each Pub/Sub message published for this notification subscription.

map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getCustomAttributesOrThrow(String key)

public String getCustomAttributesOrThrow(String key)

Optional. An optional list of additional attributes to attach to each Pub/Sub message published for this notification subscription.

map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
String

getDefaultInstanceForType()

public Notification getDefaultInstanceForType()
Returns
Type Description
Notification

getDescriptorForType()

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

getEventTypes(int index)

public String getEventTypes(int index)

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

repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL];

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)

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

repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL];

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

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

repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The count of eventTypes.

getEventTypesList()

public ProtocolStringList getEventTypesList()

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

repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL];

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 notification. Format: projects/{project}/buckets/{bucket}/notificationConfigs/{notification} 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 notification. Format: projects/{project}/buckets/{bucket}/notificationConfigs/{notification} 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()

Optional. If present, only apply this notification config to object names that begin with this prefix.

string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The objectNamePrefix.

getObjectNamePrefixBytes()

public ByteString getObjectNamePrefixBytes()

Optional. If present, only apply this notification config to object names that begin with this prefix.

string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL];

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 Notification.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Notification.Builder
Overrides Exceptions
Type Description
IOException

mergeFrom(Message other)

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

mergeFrom(Notification other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllCustomAttributes(Map<String,String> values)

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

Optional. An optional list of additional attributes to attach to each Pub/Sub message published for this notification subscription.

map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL];

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

putCustomAttributes(String key, String value)

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

Optional. An optional list of additional attributes to attach to each Pub/Sub message published for this notification subscription.

map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL];

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

removeCustomAttributes(String key)

public Notification.Builder removeCustomAttributes(String key)

Optional. An optional list of additional attributes to attach to each Pub/Sub message published for this notification subscription.

map<string, string> custom_attributes = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
Notification.Builder

setEventTypes(int index, String value)

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

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

repeated string event_types = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int

The index to set the value at.

value String

The eventTypes to set.

Returns
Type Description
Notification.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setName(String value)

public Notification.Builder setName(String value)

Required. The resource name of this notification. Format: projects/{project}/buckets/{bucket}/notificationConfigs/{notification} 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
Notification.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Notification.Builder setNameBytes(ByteString value)

Required. The resource name of this notification. Format: projects/{project}/buckets/{bucket}/notificationConfigs/{notification} 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
Notification.Builder

This builder for chaining.

setObjectNamePrefix(String value)

public Notification.Builder setObjectNamePrefix(String value)

Optional. If present, only apply this notification config to object names that begin with this prefix.

string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The objectNamePrefix to set.

Returns
Type Description
Notification.Builder

This builder for chaining.

setObjectNamePrefixBytes(ByteString value)

public Notification.Builder setObjectNamePrefixBytes(ByteString value)

Optional. If present, only apply this notification config to object names that begin with this prefix.

string object_name_prefix = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for objectNamePrefix to set.

Returns
Type Description
Notification.Builder

This builder for chaining.

setPayloadFormat(String value)

public Notification.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
Notification.Builder

This builder for chaining.

setPayloadFormatBytes(ByteString value)

public Notification.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
Notification.Builder

This builder for chaining.

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

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

setTopic(String value)

public Notification.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
Notification.Builder

This builder for chaining.

setTopicBytes(ByteString value)

public Notification.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
Notification.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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