Class CreateSnapshotRequest.Builder (1.118.0)

public static final class CreateSnapshotRequest.Builder extends GeneratedMessageV3.Builder<CreateSnapshotRequest.Builder> implements CreateSnapshotRequestOrBuilder

Request for the CreateSnapshot method.

Protobuf type google.pubsub.v1.CreateSnapshotRequest

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public CreateSnapshotRequest build()
Returns
TypeDescription
CreateSnapshotRequest

buildPartial()

public CreateSnapshotRequest buildPartial()
Returns
TypeDescription
CreateSnapshotRequest

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearLabels()

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

clearName()

public CreateSnapshotRequest.Builder clearName()

Required. User-provided name for this snapshot. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription. Note that for REST API requests, you must specify a name. See the <a href="https://cloud.google.com/pubsub/docs/admin#resource_names">; resource name rules</a>. Format is projects/{project}/snapshots/{snap}.

string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
CreateSnapshotRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearSubscription()

public CreateSnapshotRequest.Builder clearSubscription()

Required. The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.

string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
CreateSnapshotRequest.Builder

This builder for chaining.

clone()

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

containsLabels(String key)

public boolean containsLabels(String key)

See <a href="https://cloud.google.com/pubsub/docs/labels">; Creating and managing labels</a>.

map<string, string> labels = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public CreateSnapshotRequest getDefaultInstanceForType()
Returns
TypeDescription
CreateSnapshotRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
Map<String,String>

getLabelsCount()

public int getLabelsCount()

See <a href="https://cloud.google.com/pubsub/docs/labels">; Creating and managing labels</a>.

map<string, string> labels = 3;

Returns
TypeDescription
int

getLabelsMap()

public Map<String,String> getLabelsMap()

See <a href="https://cloud.google.com/pubsub/docs/labels">; Creating and managing labels</a>.

map<string, string> labels = 3;

Returns
TypeDescription
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

See <a href="https://cloud.google.com/pubsub/docs/labels">; Creating and managing labels</a>.

map<string, string> labels = 3;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

See <a href="https://cloud.google.com/pubsub/docs/labels">; Creating and managing labels</a>.

map<string, string> labels = 3;

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

Required. User-provided name for this snapshot. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription. Note that for REST API requests, you must specify a name. See the <a href="https://cloud.google.com/pubsub/docs/admin#resource_names">; resource name rules</a>. Format is projects/{project}/snapshots/{snap}.

string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Required. User-provided name for this snapshot. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription. Note that for REST API requests, you must specify a name. See the <a href="https://cloud.google.com/pubsub/docs/admin#resource_names">; resource name rules</a>. Format is projects/{project}/snapshots/{snap}.

string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for name.

getSubscription()

public String getSubscription()

Required. The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.

string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The subscription.

getSubscriptionBytes()

public ByteString getSubscriptionBytes()

Required. The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.

string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for subscription.

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

mergeFrom(Message other)

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

mergeFrom(CreateSnapshotRequest other)

public CreateSnapshotRequest.Builder mergeFrom(CreateSnapshotRequest other)
Parameter
NameDescription
otherCreateSnapshotRequest
Returns
TypeDescription
CreateSnapshotRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllLabels(Map<String,String> values)

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

See <a href="https://cloud.google.com/pubsub/docs/labels">; Creating and managing labels</a>.

map<string, string> labels = 3;

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

putLabels(String key, String value)

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

See <a href="https://cloud.google.com/pubsub/docs/labels">; Creating and managing labels</a>.

map<string, string> labels = 3;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
CreateSnapshotRequest.Builder

removeLabels(String key)

public CreateSnapshotRequest.Builder removeLabels(String key)

See <a href="https://cloud.google.com/pubsub/docs/labels">; Creating and managing labels</a>.

map<string, string> labels = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
CreateSnapshotRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setName(String value)

public CreateSnapshotRequest.Builder setName(String value)

Required. User-provided name for this snapshot. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription. Note that for REST API requests, you must specify a name. See the <a href="https://cloud.google.com/pubsub/docs/admin#resource_names">; resource name rules</a>. Format is projects/{project}/snapshots/{snap}.

string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
CreateSnapshotRequest.Builder

This builder for chaining.

setNameBytes(ByteString value)

public CreateSnapshotRequest.Builder setNameBytes(ByteString value)

Required. User-provided name for this snapshot. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription. Note that for REST API requests, you must specify a name. See the <a href="https://cloud.google.com/pubsub/docs/admin#resource_names">; resource name rules</a>. Format is projects/{project}/snapshots/{snap}.

string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
CreateSnapshotRequest.Builder

This builder for chaining.

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

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

setSubscription(String value)

public CreateSnapshotRequest.Builder setSubscription(String value)

Required. The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.

string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The subscription to set.

Returns
TypeDescription
CreateSnapshotRequest.Builder

This builder for chaining.

setSubscriptionBytes(ByteString value)

public CreateSnapshotRequest.Builder setSubscriptionBytes(ByteString value)

Required. The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.

string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for subscription to set.

Returns
TypeDescription
CreateSnapshotRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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