Class CreateSnapshotRequest.Builder (1.134.2)

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
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public CreateSnapshotRequest build()
Returns
Type Description
CreateSnapshotRequest

buildPartial()

public CreateSnapshotRequest buildPartial()
Returns
Type Description
CreateSnapshotRequest

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearLabels()

public CreateSnapshotRequest.Builder clearLabels()
Returns
Type Description
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 resource name rules. Format is projects/{project}/snapshots/{snap}.

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

Returns
Type Description
CreateSnapshotRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CreateSnapshotRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
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
Type Description
CreateSnapshotRequest.Builder

This builder for chaining.

clone()

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

containsLabels(String key)

public boolean containsLabels(String key)

Optional. See Creating and managing labels.

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

Parameter
Name Description
key String
Returns
Type Description
boolean

getDefaultInstanceForType()

public CreateSnapshotRequest getDefaultInstanceForType()
Returns
Type Description
CreateSnapshotRequest

getDescriptorForType()

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

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Optional. See Creating and managing labels.

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

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Optional. See Creating and managing labels.

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

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Optional. See Creating and managing labels.

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

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Optional. See Creating and managing labels.

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

Parameter
Name Description
key String
Returns
Type Description
String

getMutableLabels() (deprecated)

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
Type Description
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 resource name rules. Format is projects/{project}/snapshots/{snap}.

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

Returns
Type Description
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 resource name rules. Format is projects/{project}/snapshots/{snap}.

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

Returns
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for subscription.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CreateSnapshotRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CreateSnapshotRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

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

mergeFrom(CreateSnapshotRequest other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllLabels(Map<String,String> values)

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

Optional. See Creating and managing labels.

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

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

putLabels(String key, String value)

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

Optional. See Creating and managing labels.

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

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

removeLabels(String key)

public CreateSnapshotRequest.Builder removeLabels(String key)

Optional. See Creating and managing labels.

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

Parameter
Name Description
key String
Returns
Type Description
CreateSnapshotRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public CreateSnapshotRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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 resource name rules. Format is projects/{project}/snapshots/{snap}.

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

Parameter
Name Description
value String

The name to set.

Returns
Type Description
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 resource name rules. Format is projects/{project}/snapshots/{snap}.

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

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
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
Name Description
value String

The subscription to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for subscription to set.

Returns
Type Description
CreateSnapshotRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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