Class Notification.Builder (2.5.1)

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
TypeDescription
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
NameDescription
valuesIterable<String>

The eventTypes to add.

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

The eventTypes to add.

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

The bytes of the eventTypes to add.

Returns
TypeDescription
Notification.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Notification build()
Returns
TypeDescription
Notification

buildPartial()

public Notification buildPartial()
Returns
TypeDescription
Notification

clear()

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

clearCustomAttributes()

public Notification.Builder clearCustomAttributes()
Returns
TypeDescription
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
TypeDescription
Notification.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Notification.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
Notification.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

This builder for chaining.

clone()

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

getCustomAttributes()

public Map<String,String> getCustomAttributes()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
keyString
defaultValueString
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
String

getDefaultInstanceForType()

public Notification getDefaultInstanceForType()
Returns
TypeDescription
Notification

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
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)

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

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
TypeDescription
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
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 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
TypeDescription
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
TypeDescription
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
TypeDescription
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
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 Notification.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Notification.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

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

mergeFrom(Notification other)

public Notification.Builder mergeFrom(Notification other)
Parameter
NameDescription
otherNotification
Returns
TypeDescription
Notification.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

The index to set the value at.

valueString

The eventTypes to set.

Returns
TypeDescription
Notification.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Notification.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The name to set.

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

The bytes for name to set.

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

The objectNamePrefix to set.

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

The bytes for objectNamePrefix to set.

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

The payloadFormat to set.

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

The bytes for payloadFormat to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The topic to set.

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

The bytes for topic to set.

Returns
TypeDescription
Notification.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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