com.google.pubsub.v1.Subscription Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grpc-google-cloud-pubsub-v1 Show documentation
Show all versions of grpc-google-cloud-pubsub-v1 Show documentation
GRPC library for grpc-google-cloud-pubsub-v1
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/pubsub/v1/pubsub.proto
package com.google.pubsub.v1;
/**
*
* A subscription resource.
*
*
* Protobuf type {@code google.pubsub.v1.Subscription}
*/
public final class Subscription extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.pubsub.v1.Subscription)
SubscriptionOrBuilder {
// Use Subscription.newBuilder() to construct.
private Subscription(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Subscription() {
name_ = "";
topic_ = "";
ackDeadlineSeconds_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private Subscription(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
topic_ = s;
break;
}
case 34: {
com.google.pubsub.v1.PushConfig.Builder subBuilder = null;
if (pushConfig_ != null) {
subBuilder = pushConfig_.toBuilder();
}
pushConfig_ = input.readMessage(com.google.pubsub.v1.PushConfig.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(pushConfig_);
pushConfig_ = subBuilder.buildPartial();
}
break;
}
case 40: {
ackDeadlineSeconds_ = input.readInt32();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Subscription_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Subscription_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.pubsub.v1.Subscription.class, com.google.pubsub.v1.Subscription.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
*
* The name of the subscription. It must have the format
* `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
* start with a letter, and contain only letters (`[A-Za-z]`), numbers
* (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
* plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
* in length, and it must not start with `"goog"`.
*
*
* optional string name = 1;
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
* The name of the subscription. It must have the format
* `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
* start with a letter, and contain only letters (`[A-Za-z]`), numbers
* (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
* plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
* in length, and it must not start with `"goog"`.
*
*
* optional string name = 1;
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TOPIC_FIELD_NUMBER = 2;
private volatile java.lang.Object topic_;
/**
*
* The name of the topic from which this subscription is receiving messages.
* The value of this field will be `_deleted-topic_` if the topic has been
* deleted.
*
*
* optional string topic = 2;
*/
public java.lang.String getTopic() {
java.lang.Object ref = topic_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
topic_ = s;
return s;
}
}
/**
*
* The name of the topic from which this subscription is receiving messages.
* The value of this field will be `_deleted-topic_` if the topic has been
* deleted.
*
*
* optional string topic = 2;
*/
public com.google.protobuf.ByteString
getTopicBytes() {
java.lang.Object ref = topic_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
topic_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PUSH_CONFIG_FIELD_NUMBER = 4;
private com.google.pubsub.v1.PushConfig pushConfig_;
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public boolean hasPushConfig() {
return pushConfig_ != null;
}
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public com.google.pubsub.v1.PushConfig getPushConfig() {
return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_;
}
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() {
return getPushConfig();
}
public static final int ACK_DEADLINE_SECONDS_FIELD_NUMBER = 5;
private int ackDeadlineSeconds_;
/**
*
* This value is the maximum time after a subscriber receives a message
* before the subscriber should acknowledge the message. After message
* delivery but before the ack deadline expires and before the message is
* acknowledged, it is an outstanding message and will not be delivered
* again during that time (on a best-effort basis).
* For pull subscriptions, this value is used as the initial value for the ack
* deadline. To override this value for a given message, call
* `ModifyAckDeadline` with the corresponding `ack_id` if using
* pull.
* The maximum custom deadline you can specify is 600 seconds (10 minutes).
* For push delivery, this value is also used to set the request timeout for
* the call to the push endpoint.
* If the subscriber never acknowledges the message, the Pub/Sub
* system will eventually redeliver the message.
* If this parameter is 0, a default value of 10 seconds is used.
*
*
* optional int32 ack_deadline_seconds = 5;
*/
public int getAckDeadlineSeconds() {
return ackDeadlineSeconds_;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (!getTopicBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, topic_);
}
if (pushConfig_ != null) {
output.writeMessage(4, getPushConfig());
}
if (ackDeadlineSeconds_ != 0) {
output.writeInt32(5, ackDeadlineSeconds_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (!getTopicBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, topic_);
}
if (pushConfig_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getPushConfig());
}
if (ackDeadlineSeconds_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(5, ackDeadlineSeconds_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.pubsub.v1.Subscription)) {
return super.equals(obj);
}
com.google.pubsub.v1.Subscription other = (com.google.pubsub.v1.Subscription) obj;
boolean result = true;
result = result && getName()
.equals(other.getName());
result = result && getTopic()
.equals(other.getTopic());
result = result && (hasPushConfig() == other.hasPushConfig());
if (hasPushConfig()) {
result = result && getPushConfig()
.equals(other.getPushConfig());
}
result = result && (getAckDeadlineSeconds()
== other.getAckDeadlineSeconds());
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + TOPIC_FIELD_NUMBER;
hash = (53 * hash) + getTopic().hashCode();
if (hasPushConfig()) {
hash = (37 * hash) + PUSH_CONFIG_FIELD_NUMBER;
hash = (53 * hash) + getPushConfig().hashCode();
}
hash = (37 * hash) + ACK_DEADLINE_SECONDS_FIELD_NUMBER;
hash = (53 * hash) + getAckDeadlineSeconds();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.pubsub.v1.Subscription parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.pubsub.v1.Subscription parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.pubsub.v1.Subscription parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.pubsub.v1.Subscription parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.pubsub.v1.Subscription parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.pubsub.v1.Subscription parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.pubsub.v1.Subscription parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.pubsub.v1.Subscription parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.pubsub.v1.Subscription parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.pubsub.v1.Subscription parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.pubsub.v1.Subscription prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* A subscription resource.
*
*
* Protobuf type {@code google.pubsub.v1.Subscription}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.pubsub.v1.Subscription)
com.google.pubsub.v1.SubscriptionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Subscription_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Subscription_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.pubsub.v1.Subscription.class, com.google.pubsub.v1.Subscription.Builder.class);
}
// Construct using com.google.pubsub.v1.Subscription.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
name_ = "";
topic_ = "";
if (pushConfigBuilder_ == null) {
pushConfig_ = null;
} else {
pushConfig_ = null;
pushConfigBuilder_ = null;
}
ackDeadlineSeconds_ = 0;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Subscription_descriptor;
}
public com.google.pubsub.v1.Subscription getDefaultInstanceForType() {
return com.google.pubsub.v1.Subscription.getDefaultInstance();
}
public com.google.pubsub.v1.Subscription build() {
com.google.pubsub.v1.Subscription result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.pubsub.v1.Subscription buildPartial() {
com.google.pubsub.v1.Subscription result = new com.google.pubsub.v1.Subscription(this);
result.name_ = name_;
result.topic_ = topic_;
if (pushConfigBuilder_ == null) {
result.pushConfig_ = pushConfig_;
} else {
result.pushConfig_ = pushConfigBuilder_.build();
}
result.ackDeadlineSeconds_ = ackDeadlineSeconds_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.pubsub.v1.Subscription) {
return mergeFrom((com.google.pubsub.v1.Subscription)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.pubsub.v1.Subscription other) {
if (other == com.google.pubsub.v1.Subscription.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (!other.getTopic().isEmpty()) {
topic_ = other.topic_;
onChanged();
}
if (other.hasPushConfig()) {
mergePushConfig(other.getPushConfig());
}
if (other.getAckDeadlineSeconds() != 0) {
setAckDeadlineSeconds(other.getAckDeadlineSeconds());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.pubsub.v1.Subscription parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.pubsub.v1.Subscription) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object name_ = "";
/**
*
* The name of the subscription. It must have the format
* `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
* start with a letter, and contain only letters (`[A-Za-z]`), numbers
* (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
* plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
* in length, and it must not start with `"goog"`.
*
*
* optional string name = 1;
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The name of the subscription. It must have the format
* `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
* start with a letter, and contain only letters (`[A-Za-z]`), numbers
* (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
* plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
* in length, and it must not start with `"goog"`.
*
*
* optional string name = 1;
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The name of the subscription. It must have the format
* `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
* start with a letter, and contain only letters (`[A-Za-z]`), numbers
* (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
* plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
* in length, and it must not start with `"goog"`.
*
*
* optional string name = 1;
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
* The name of the subscription. It must have the format
* `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
* start with a letter, and contain only letters (`[A-Za-z]`), numbers
* (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
* plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
* in length, and it must not start with `"goog"`.
*
*
* optional string name = 1;
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
* The name of the subscription. It must have the format
* `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
* start with a letter, and contain only letters (`[A-Za-z]`), numbers
* (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
* plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
* in length, and it must not start with `"goog"`.
*
*
* optional string name = 1;
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private java.lang.Object topic_ = "";
/**
*
* The name of the topic from which this subscription is receiving messages.
* The value of this field will be `_deleted-topic_` if the topic has been
* deleted.
*
*
* optional string topic = 2;
*/
public java.lang.String getTopic() {
java.lang.Object ref = topic_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
topic_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The name of the topic from which this subscription is receiving messages.
* The value of this field will be `_deleted-topic_` if the topic has been
* deleted.
*
*
* optional string topic = 2;
*/
public com.google.protobuf.ByteString
getTopicBytes() {
java.lang.Object ref = topic_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
topic_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The name of the topic from which this subscription is receiving messages.
* The value of this field will be `_deleted-topic_` if the topic has been
* deleted.
*
*
* optional string topic = 2;
*/
public Builder setTopic(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
topic_ = value;
onChanged();
return this;
}
/**
*
* The name of the topic from which this subscription is receiving messages.
* The value of this field will be `_deleted-topic_` if the topic has been
* deleted.
*
*
* optional string topic = 2;
*/
public Builder clearTopic() {
topic_ = getDefaultInstance().getTopic();
onChanged();
return this;
}
/**
*
* The name of the topic from which this subscription is receiving messages.
* The value of this field will be `_deleted-topic_` if the topic has been
* deleted.
*
*
* optional string topic = 2;
*/
public Builder setTopicBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
topic_ = value;
onChanged();
return this;
}
private com.google.pubsub.v1.PushConfig pushConfig_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.pubsub.v1.PushConfig, com.google.pubsub.v1.PushConfig.Builder, com.google.pubsub.v1.PushConfigOrBuilder> pushConfigBuilder_;
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public boolean hasPushConfig() {
return pushConfigBuilder_ != null || pushConfig_ != null;
}
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public com.google.pubsub.v1.PushConfig getPushConfig() {
if (pushConfigBuilder_ == null) {
return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_;
} else {
return pushConfigBuilder_.getMessage();
}
}
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public Builder setPushConfig(com.google.pubsub.v1.PushConfig value) {
if (pushConfigBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
pushConfig_ = value;
onChanged();
} else {
pushConfigBuilder_.setMessage(value);
}
return this;
}
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public Builder setPushConfig(
com.google.pubsub.v1.PushConfig.Builder builderForValue) {
if (pushConfigBuilder_ == null) {
pushConfig_ = builderForValue.build();
onChanged();
} else {
pushConfigBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public Builder mergePushConfig(com.google.pubsub.v1.PushConfig value) {
if (pushConfigBuilder_ == null) {
if (pushConfig_ != null) {
pushConfig_ =
com.google.pubsub.v1.PushConfig.newBuilder(pushConfig_).mergeFrom(value).buildPartial();
} else {
pushConfig_ = value;
}
onChanged();
} else {
pushConfigBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public Builder clearPushConfig() {
if (pushConfigBuilder_ == null) {
pushConfig_ = null;
onChanged();
} else {
pushConfig_ = null;
pushConfigBuilder_ = null;
}
return this;
}
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public com.google.pubsub.v1.PushConfig.Builder getPushConfigBuilder() {
onChanged();
return getPushConfigFieldBuilder().getBuilder();
}
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() {
if (pushConfigBuilder_ != null) {
return pushConfigBuilder_.getMessageOrBuilder();
} else {
return pushConfig_ == null ?
com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_;
}
}
/**
*
* If push delivery is used with this subscription, this field is
* used to configure it. An empty `pushConfig` signifies that the subscriber
* will pull and ack messages using API methods.
*
*
* optional .google.pubsub.v1.PushConfig push_config = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.pubsub.v1.PushConfig, com.google.pubsub.v1.PushConfig.Builder, com.google.pubsub.v1.PushConfigOrBuilder>
getPushConfigFieldBuilder() {
if (pushConfigBuilder_ == null) {
pushConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.pubsub.v1.PushConfig, com.google.pubsub.v1.PushConfig.Builder, com.google.pubsub.v1.PushConfigOrBuilder>(
getPushConfig(),
getParentForChildren(),
isClean());
pushConfig_ = null;
}
return pushConfigBuilder_;
}
private int ackDeadlineSeconds_ ;
/**
*
* This value is the maximum time after a subscriber receives a message
* before the subscriber should acknowledge the message. After message
* delivery but before the ack deadline expires and before the message is
* acknowledged, it is an outstanding message and will not be delivered
* again during that time (on a best-effort basis).
* For pull subscriptions, this value is used as the initial value for the ack
* deadline. To override this value for a given message, call
* `ModifyAckDeadline` with the corresponding `ack_id` if using
* pull.
* The maximum custom deadline you can specify is 600 seconds (10 minutes).
* For push delivery, this value is also used to set the request timeout for
* the call to the push endpoint.
* If the subscriber never acknowledges the message, the Pub/Sub
* system will eventually redeliver the message.
* If this parameter is 0, a default value of 10 seconds is used.
*
*
* optional int32 ack_deadline_seconds = 5;
*/
public int getAckDeadlineSeconds() {
return ackDeadlineSeconds_;
}
/**
*
* This value is the maximum time after a subscriber receives a message
* before the subscriber should acknowledge the message. After message
* delivery but before the ack deadline expires and before the message is
* acknowledged, it is an outstanding message and will not be delivered
* again during that time (on a best-effort basis).
* For pull subscriptions, this value is used as the initial value for the ack
* deadline. To override this value for a given message, call
* `ModifyAckDeadline` with the corresponding `ack_id` if using
* pull.
* The maximum custom deadline you can specify is 600 seconds (10 minutes).
* For push delivery, this value is also used to set the request timeout for
* the call to the push endpoint.
* If the subscriber never acknowledges the message, the Pub/Sub
* system will eventually redeliver the message.
* If this parameter is 0, a default value of 10 seconds is used.
*
*
* optional int32 ack_deadline_seconds = 5;
*/
public Builder setAckDeadlineSeconds(int value) {
ackDeadlineSeconds_ = value;
onChanged();
return this;
}
/**
*
* This value is the maximum time after a subscriber receives a message
* before the subscriber should acknowledge the message. After message
* delivery but before the ack deadline expires and before the message is
* acknowledged, it is an outstanding message and will not be delivered
* again during that time (on a best-effort basis).
* For pull subscriptions, this value is used as the initial value for the ack
* deadline. To override this value for a given message, call
* `ModifyAckDeadline` with the corresponding `ack_id` if using
* pull.
* The maximum custom deadline you can specify is 600 seconds (10 minutes).
* For push delivery, this value is also used to set the request timeout for
* the call to the push endpoint.
* If the subscriber never acknowledges the message, the Pub/Sub
* system will eventually redeliver the message.
* If this parameter is 0, a default value of 10 seconds is used.
*
*
* optional int32 ack_deadline_seconds = 5;
*/
public Builder clearAckDeadlineSeconds() {
ackDeadlineSeconds_ = 0;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:google.pubsub.v1.Subscription)
}
// @@protoc_insertion_point(class_scope:google.pubsub.v1.Subscription)
private static final com.google.pubsub.v1.Subscription DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.pubsub.v1.Subscription();
}
public static com.google.pubsub.v1.Subscription getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public Subscription parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Subscription(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public com.google.pubsub.v1.Subscription getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}