Class Snapshot.Builder (1.118.0)

public static final class Snapshot.Builder extends GeneratedMessageV3.Builder<Snapshot.Builder> implements SnapshotOrBuilder

A snapshot resource. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

Protobuf type google.pubsub.v1.Snapshot

Implements

SnapshotOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Snapshot build()
Returns
TypeDescription
Snapshot

buildPartial()

public Snapshot buildPartial()
Returns
TypeDescription
Snapshot

clear()

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

clearExpireTime()

public Snapshot.Builder clearExpireTime()

The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.

.google.protobuf.Timestamp expire_time = 3;

Returns
TypeDescription
Snapshot.Builder

clearField(Descriptors.FieldDescriptor field)

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

clearLabels()

public Snapshot.Builder clearLabels()
Returns
TypeDescription
Snapshot.Builder

clearName()

public Snapshot.Builder clearName()

The name of the snapshot.

string name = 1;

Returns
TypeDescription
Snapshot.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearTopic()

public Snapshot.Builder clearTopic()

The name of the topic from which this snapshot is retaining messages.

string topic = 2 [(.google.api.resource_reference) = { ... }

Returns
TypeDescription
Snapshot.Builder

This builder for chaining.

clone()

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

containsLabels(String key)

public boolean containsLabels(String key)

See Creating and managing labels.

map<string, string> labels = 4;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public Snapshot getDefaultInstanceForType()
Returns
TypeDescription
Snapshot

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getExpireTime()

public Timestamp getExpireTime()

The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.

.google.protobuf.Timestamp expire_time = 3;

Returns
TypeDescription
Timestamp

The expireTime.

getExpireTimeBuilder()

public Timestamp.Builder getExpireTimeBuilder()

The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.

.google.protobuf.Timestamp expire_time = 3;

Returns
TypeDescription
Builder

getExpireTimeOrBuilder()

public TimestampOrBuilder getExpireTimeOrBuilder()

The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.

.google.protobuf.Timestamp expire_time = 3;

Returns
TypeDescription
TimestampOrBuilder

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
Map<String,String>

getLabelsCount()

public int getLabelsCount()

See Creating and managing labels.

map<string, string> labels = 4;

Returns
TypeDescription
int

getLabelsMap()

public Map<String,String> getLabelsMap()

See Creating and managing labels.

map<string, string> labels = 4;

Returns
TypeDescription
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

See Creating and managing labels.

map<string, string> labels = 4;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

See Creating and managing labels.

map<string, string> labels = 4;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMutableLabels()

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getName()

public String getName()

The name of the snapshot.

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

The name of the snapshot.

string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getTopic()

public String getTopic()

The name of the topic from which this snapshot is retaining messages.

string topic = 2 [(.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The topic.

getTopicBytes()

public ByteString getTopicBytes()

The name of the topic from which this snapshot is retaining messages.

string topic = 2 [(.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for topic.

hasExpireTime()

public boolean hasExpireTime()

The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.

.google.protobuf.Timestamp expire_time = 3;

Returns
TypeDescription
boolean

Whether the expireTime field is set.

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

mergeExpireTime(Timestamp value)

public Snapshot.Builder mergeExpireTime(Timestamp value)

The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.

.google.protobuf.Timestamp expire_time = 3;

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Snapshot.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeFrom(Snapshot other)

public Snapshot.Builder mergeFrom(Snapshot other)
Parameter
NameDescription
otherSnapshot
Returns
TypeDescription
Snapshot.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllLabels(Map<String,String> values)

public Snapshot.Builder putAllLabels(Map<String,String> values)

See Creating and managing labels.

map<string, string> labels = 4;

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

putLabels(String key, String value)

public Snapshot.Builder putLabels(String key, String value)

See Creating and managing labels.

map<string, string> labels = 4;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
Snapshot.Builder

removeLabels(String key)

public Snapshot.Builder removeLabels(String key)

See Creating and managing labels.

map<string, string> labels = 4;

Parameter
NameDescription
keyString
Returns
TypeDescription
Snapshot.Builder

setExpireTime(Timestamp value)

public Snapshot.Builder setExpireTime(Timestamp value)

The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.

.google.protobuf.Timestamp expire_time = 3;

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Snapshot.Builder

setExpireTime(Timestamp.Builder builderForValue)

public Snapshot.Builder setExpireTime(Timestamp.Builder builderForValue)

The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.

.google.protobuf.Timestamp expire_time = 3;

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Snapshot.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setName(String value)

public Snapshot.Builder setName(String value)

The name of the snapshot.

string name = 1;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
Snapshot.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Snapshot.Builder setNameBytes(ByteString value)

The name of the snapshot.

string name = 1;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
Snapshot.Builder

This builder for chaining.

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

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

setTopic(String value)

public Snapshot.Builder setTopic(String value)

The name of the topic from which this snapshot is retaining messages.

string topic = 2 [(.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The topic to set.

Returns
TypeDescription
Snapshot.Builder

This builder for chaining.

setTopicBytes(ByteString value)

public Snapshot.Builder setTopicBytes(ByteString value)

The name of the topic from which this snapshot is retaining messages.

string topic = 2 [(.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for topic to set.

Returns
TypeDescription
Snapshot.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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