Class MessageStoragePolicy.Builder (1.126.6)

public static final class MessageStoragePolicy.Builder extends GeneratedMessageV3.Builder<MessageStoragePolicy.Builder> implements MessageStoragePolicyOrBuilder

A policy constraining the storage of messages published to the topic.

Protobuf type google.pubsub.v1.MessageStoragePolicy

Static Methods

getDescriptor()

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

Methods

addAllAllowedPersistenceRegions(Iterable<String> values)

public MessageStoragePolicy.Builder addAllAllowedPersistenceRegions(Iterable<String> values)

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuesIterable<String>

The allowedPersistenceRegions to add.

Returns
TypeDescription
MessageStoragePolicy.Builder

This builder for chaining.

addAllowedPersistenceRegions(String value)

public MessageStoragePolicy.Builder addAllowedPersistenceRegions(String value)

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueString

The allowedPersistenceRegions to add.

Returns
TypeDescription
MessageStoragePolicy.Builder

This builder for chaining.

addAllowedPersistenceRegionsBytes(ByteString value)

public MessageStoragePolicy.Builder addAllowedPersistenceRegionsBytes(ByteString value)

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueByteString

The bytes of the allowedPersistenceRegions to add.

Returns
TypeDescription
MessageStoragePolicy.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public MessageStoragePolicy build()
Returns
TypeDescription
MessageStoragePolicy

buildPartial()

public MessageStoragePolicy buildPartial()
Returns
TypeDescription
MessageStoragePolicy

clear()

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

clearAllowedPersistenceRegions()

public MessageStoragePolicy.Builder clearAllowedPersistenceRegions()

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
MessageStoragePolicy.Builder

This builder for chaining.

clearEnforceInTransit()

public MessageStoragePolicy.Builder clearEnforceInTransit()

Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.

bool enforce_in_transit = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
MessageStoragePolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getAllowedPersistenceRegions(int index)

public String getAllowedPersistenceRegions(int index)

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The allowedPersistenceRegions at the given index.

getAllowedPersistenceRegionsBytes(int index)

public ByteString getAllowedPersistenceRegionsBytes(int index)

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the allowedPersistenceRegions at the given index.

getAllowedPersistenceRegionsCount()

public int getAllowedPersistenceRegionsCount()

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The count of allowedPersistenceRegions.

getAllowedPersistenceRegionsList()

public ProtocolStringList getAllowedPersistenceRegionsList()

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ProtocolStringList

A list containing the allowedPersistenceRegions.

getDefaultInstanceForType()

public MessageStoragePolicy getDefaultInstanceForType()
Returns
TypeDescription
MessageStoragePolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getEnforceInTransit()

public boolean getEnforceInTransit()

Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.

bool enforce_in_transit = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

The enforceInTransit.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeFrom(MessageStoragePolicy other)

public MessageStoragePolicy.Builder mergeFrom(MessageStoragePolicy other)
Parameter
NameDescription
otherMessageStoragePolicy
Returns
TypeDescription
MessageStoragePolicy.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setAllowedPersistenceRegions(int index, String value)

public MessageStoragePolicy.Builder setAllowedPersistenceRegions(int index, String value)

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

repeated string allowed_persistence_regions = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The allowedPersistenceRegions to set.

Returns
TypeDescription
MessageStoragePolicy.Builder

This builder for chaining.

setEnforceInTransit(boolean value)

public MessageStoragePolicy.Builder setEnforceInTransit(boolean value)

Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.

bool enforce_in_transit = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueboolean

The enforceInTransit to set.

Returns
TypeDescription
MessageStoragePolicy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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