All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.pubsub.v1.Subscription Maven / Gradle / Ivy

There is a newer version: 1.116.2
Show newest version
// 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 { private static final long serialVersionUID = 0L; // Use Subscription.newBuilder() to construct. private Subscription(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Subscription() { name_ = ""; topic_ = ""; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Subscription( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: 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; } case 56: { retainAckedMessages_ = input.readBool(); break; } case 66: { com.google.protobuf.Duration.Builder subBuilder = null; if (messageRetentionDuration_ != null) { subBuilder = messageRetentionDuration_.toBuilder(); } messageRetentionDuration_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(messageRetentionDuration_); messageRetentionDuration_ = subBuilder.buildPartial(); } break; } case 74: { if (!((mutable_bitField0_ & 0x00000040) != 0)) { labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000040; } com.google.protobuf.MapEntry labels__ = input.readMessage( LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); break; } case 80: { enableMessageOrdering_ = input.readBool(); break; } case 90: { com.google.pubsub.v1.ExpirationPolicy.Builder subBuilder = null; if (expirationPolicy_ != null) { subBuilder = expirationPolicy_.toBuilder(); } expirationPolicy_ = input.readMessage( com.google.pubsub.v1.ExpirationPolicy.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(expirationPolicy_); expirationPolicy_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } 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 { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.pubsub.v1.PubsubProto .internal_static_google_pubsub_v1_Subscription_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override protected com.google.protobuf.MapField internalGetMapField(int number) { switch (number) { case 9: return internalGetLabels(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override 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); } private int bitField0_; 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"`.
   * 
* * 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"`.
   * 
* * 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.
   * Format is `projects/{project}/topics/{topic}`.
   * The value of this field will be `_deleted-topic_` if the topic has been
   * deleted.
   * 
* * 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.
   * Format is `projects/{project}/topics/{topic}`.
   * The value of this field will be `_deleted-topic_` if the topic has been
   * deleted.
   * 
* * 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.
   * 
* * .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.
   * 
* * .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.
   * 
* * .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_; /** * * *
   * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
   * the subscriber to acknowledge receipt before resending the message. In the
   * interval after the message is delivered and before it is acknowledged, it
   * is considered to be <i>outstanding</i>. During that time period, the
   * message will not be redelivered (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
   * non-streaming pull or send the `ack_id` in a
   * `StreamingModifyAckDeadlineRequest` if using streaming pull.
   * The minimum custom deadline you can specify is 10 seconds.
   * The maximum custom deadline you can specify is 600 seconds (10 minutes).
   * If this parameter is 0, a default value of 10 seconds is used.
   * 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.
   * 
* * int32 ack_deadline_seconds = 5; */ public int getAckDeadlineSeconds() { return ackDeadlineSeconds_; } public static final int RETAIN_ACKED_MESSAGES_FIELD_NUMBER = 7; private boolean retainAckedMessages_; /** * * *
   * Indicates whether to retain acknowledged messages. If true, then
   * messages are not expunged from the subscription's backlog, even if they are
   * acknowledged, until they fall out of the `message_retention_duration`
   * window. This must be true if you would like to
   * <a
   * href="https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time">
   * Seek to a timestamp</a>.
   * 
* * bool retain_acked_messages = 7; */ public boolean getRetainAckedMessages() { return retainAckedMessages_; } public static final int MESSAGE_RETENTION_DURATION_FIELD_NUMBER = 8; private com.google.protobuf.Duration messageRetentionDuration_; /** * * *
   * How long to retain unacknowledged messages in the subscription's backlog,
   * from the moment a message is published.
   * If `retain_acked_messages` is true, then this also configures the retention
   * of acknowledged messages, and thus configures how far back in time a `Seek`
   * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
   * minutes.
   * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public boolean hasMessageRetentionDuration() { return messageRetentionDuration_ != null; } /** * * *
   * How long to retain unacknowledged messages in the subscription's backlog,
   * from the moment a message is published.
   * If `retain_acked_messages` is true, then this also configures the retention
   * of acknowledged messages, and thus configures how far back in time a `Seek`
   * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
   * minutes.
   * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public com.google.protobuf.Duration getMessageRetentionDuration() { return messageRetentionDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : messageRetentionDuration_; } /** * * *
   * How long to retain unacknowledged messages in the subscription's backlog,
   * from the moment a message is published.
   * If `retain_acked_messages` is true, then this also configures the retention
   * of acknowledged messages, and thus configures how far back in time a `Seek`
   * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
   * minutes.
   * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public com.google.protobuf.DurationOrBuilder getMessageRetentionDurationOrBuilder() { return getMessageRetentionDuration(); } public static final int LABELS_FIELD_NUMBER = 9; private static final class LabelsDefaultEntryHolder { static final com.google.protobuf.MapEntry defaultEntry = com.google.protobuf.MapEntry.newDefaultInstance( com.google.pubsub.v1.PubsubProto .internal_static_google_pubsub_v1_Subscription_LabelsEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.STRING, ""); } private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { if (labels_ == null) { return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); } return labels_; } public int getLabelsCount() { return internalGetLabels().getMap().size(); } /** * * *
   * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
   * managing labels</a>.
   * 
* * map<string, string> labels = 9; */ public boolean containsLabels(java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetLabels().getMap().containsKey(key); } /** Use {@link #getLabelsMap()} instead. */ @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } /** * * *
   * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
   * managing labels</a>.
   * 
* * map<string, string> labels = 9; */ public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } /** * * *
   * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
   * managing labels</a>.
   * 
* * map<string, string> labels = 9; */ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
   * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
   * managing labels</a>.
   * 
* * map<string, string> labels = 9; */ public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetLabels().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int ENABLE_MESSAGE_ORDERING_FIELD_NUMBER = 10; private boolean enableMessageOrdering_; /** * * *
   * If true, messages published with the same `ordering_key` in `PubsubMessage`
   * will be delivered to the subscribers in the order in which they
   * are received by the Pub/Sub system. Otherwise, they may be delivered in
   * any order.
   * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
   * API might be changed in backward-incompatible ways and is not recommended
   * for production use. It is not subject to any SLA or deprecation policy.
   * 
* * bool enable_message_ordering = 10; */ public boolean getEnableMessageOrdering() { return enableMessageOrdering_; } public static final int EXPIRATION_POLICY_FIELD_NUMBER = 11; private com.google.pubsub.v1.ExpirationPolicy expirationPolicy_; /** * * *
   * A policy that specifies the conditions for this subscription's expiration.
   * A subscription is considered active as long as any connected subscriber is
   * successfully consuming messages from the subscription or is issuing
   * operations on the subscription. If `expiration_policy` is not set, a
   * *default policy* with `ttl` of 31 days will be used. The minimum allowed
   * value for `expiration_policy.ttl` is 1 day.
   * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public boolean hasExpirationPolicy() { return expirationPolicy_ != null; } /** * * *
   * A policy that specifies the conditions for this subscription's expiration.
   * A subscription is considered active as long as any connected subscriber is
   * successfully consuming messages from the subscription or is issuing
   * operations on the subscription. If `expiration_policy` is not set, a
   * *default policy* with `ttl` of 31 days will be used. The minimum allowed
   * value for `expiration_policy.ttl` is 1 day.
   * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public com.google.pubsub.v1.ExpirationPolicy getExpirationPolicy() { return expirationPolicy_ == null ? com.google.pubsub.v1.ExpirationPolicy.getDefaultInstance() : expirationPolicy_; } /** * * *
   * A policy that specifies the conditions for this subscription's expiration.
   * A subscription is considered active as long as any connected subscriber is
   * successfully consuming messages from the subscription or is issuing
   * operations on the subscription. If `expiration_policy` is not set, a
   * *default policy* with `ttl` of 31 days will be used. The minimum allowed
   * value for `expiration_policy.ttl` is 1 day.
   * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public com.google.pubsub.v1.ExpirationPolicyOrBuilder getExpirationPolicyOrBuilder() { return getExpirationPolicy(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override 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_); } if (retainAckedMessages_ != false) { output.writeBool(7, retainAckedMessages_); } if (messageRetentionDuration_ != null) { output.writeMessage(8, getMessageRetentionDuration()); } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 9); if (enableMessageOrdering_ != false) { output.writeBool(10, enableMessageOrdering_); } if (expirationPolicy_ != null) { output.writeMessage(11, getExpirationPolicy()); } unknownFields.writeTo(output); } @java.lang.Override 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_); } if (retainAckedMessages_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, retainAckedMessages_); } if (messageRetentionDuration_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 8, getMessageRetentionDuration()); } for (java.util.Map.Entry entry : internalGetLabels().getMap().entrySet()) { com.google.protobuf.MapEntry labels__ = LabelsDefaultEntryHolder.defaultEntry .newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, labels__); } if (enableMessageOrdering_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, enableMessageOrdering_); } if (expirationPolicy_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getExpirationPolicy()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @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; if (!getName().equals(other.getName())) return false; if (!getTopic().equals(other.getTopic())) return false; if (hasPushConfig() != other.hasPushConfig()) return false; if (hasPushConfig()) { if (!getPushConfig().equals(other.getPushConfig())) return false; } if (getAckDeadlineSeconds() != other.getAckDeadlineSeconds()) return false; if (getRetainAckedMessages() != other.getRetainAckedMessages()) return false; if (hasMessageRetentionDuration() != other.hasMessageRetentionDuration()) return false; if (hasMessageRetentionDuration()) { if (!getMessageRetentionDuration().equals(other.getMessageRetentionDuration())) return false; } if (!internalGetLabels().equals(other.internalGetLabels())) return false; if (getEnableMessageOrdering() != other.getEnableMessageOrdering()) return false; if (hasExpirationPolicy() != other.hasExpirationPolicy()) return false; if (hasExpirationPolicy()) { if (!getExpirationPolicy().equals(other.getExpirationPolicy())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().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 = (37 * hash) + RETAIN_ACKED_MESSAGES_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRetainAckedMessages()); if (hasMessageRetentionDuration()) { hash = (37 * hash) + MESSAGE_RETENTION_DURATION_FIELD_NUMBER; hash = (53 * hash) + getMessageRetentionDuration().hashCode(); } if (!internalGetLabels().getMap().isEmpty()) { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode(); } hash = (37 * hash) + ENABLE_MESSAGE_ORDERING_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableMessageOrdering()); if (hasExpirationPolicy()) { hash = (37 * hash) + EXPIRATION_POLICY_FIELD_NUMBER; hash = (53 * hash) + getExpirationPolicy().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.pubsub.v1.Subscription parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.pubsub.v1.Subscription parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } 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); } @java.lang.Override 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); } @java.lang.Override 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; } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMapField(int number) { switch (number) { case 9: return internalGetLabels(); default: throw new RuntimeException("Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMutableMapField(int number) { switch (number) { case 9: return internalGetMutableLabels(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override 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) {} } @java.lang.Override public Builder clear() { super.clear(); name_ = ""; topic_ = ""; if (pushConfigBuilder_ == null) { pushConfig_ = null; } else { pushConfig_ = null; pushConfigBuilder_ = null; } ackDeadlineSeconds_ = 0; retainAckedMessages_ = false; if (messageRetentionDurationBuilder_ == null) { messageRetentionDuration_ = null; } else { messageRetentionDuration_ = null; messageRetentionDurationBuilder_ = null; } internalGetMutableLabels().clear(); enableMessageOrdering_ = false; if (expirationPolicyBuilder_ == null) { expirationPolicy_ = null; } else { expirationPolicy_ = null; expirationPolicyBuilder_ = null; } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.pubsub.v1.PubsubProto .internal_static_google_pubsub_v1_Subscription_descriptor; } @java.lang.Override public com.google.pubsub.v1.Subscription getDefaultInstanceForType() { return com.google.pubsub.v1.Subscription.getDefaultInstance(); } @java.lang.Override public com.google.pubsub.v1.Subscription build() { com.google.pubsub.v1.Subscription result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.pubsub.v1.Subscription buildPartial() { com.google.pubsub.v1.Subscription result = new com.google.pubsub.v1.Subscription(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.name_ = name_; result.topic_ = topic_; if (pushConfigBuilder_ == null) { result.pushConfig_ = pushConfig_; } else { result.pushConfig_ = pushConfigBuilder_.build(); } result.ackDeadlineSeconds_ = ackDeadlineSeconds_; result.retainAckedMessages_ = retainAckedMessages_; if (messageRetentionDurationBuilder_ == null) { result.messageRetentionDuration_ = messageRetentionDuration_; } else { result.messageRetentionDuration_ = messageRetentionDurationBuilder_.build(); } result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); result.enableMessageOrdering_ = enableMessageOrdering_; if (expirationPolicyBuilder_ == null) { result.expirationPolicy_ = expirationPolicy_; } else { result.expirationPolicy_ = expirationPolicyBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override 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()); } if (other.getRetainAckedMessages() != false) { setRetainAckedMessages(other.getRetainAckedMessages()); } if (other.hasMessageRetentionDuration()) { mergeMessageRetentionDuration(other.getMessageRetentionDuration()); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); if (other.getEnableMessageOrdering() != false) { setEnableMessageOrdering(other.getEnableMessageOrdering()); } if (other.hasExpirationPolicy()) { mergeExpirationPolicy(other.getExpirationPolicy()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override 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 int bitField0_; 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"`.
     * 
* * 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"`.
     * 
* * 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"`.
     * 
* * 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"`.
     * 
* * 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"`.
     * 
* * 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.
     * Format is `projects/{project}/topics/{topic}`.
     * The value of this field will be `_deleted-topic_` if the topic has been
     * deleted.
     * 
* * 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.
     * Format is `projects/{project}/topics/{topic}`.
     * The value of this field will be `_deleted-topic_` if the topic has been
     * deleted.
     * 
* * 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.
     * Format is `projects/{project}/topics/{topic}`.
     * The value of this field will be `_deleted-topic_` if the topic has been
     * deleted.
     * 
* * 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.
     * Format is `projects/{project}/topics/{topic}`.
     * The value of this field will be `_deleted-topic_` if the topic has been
     * deleted.
     * 
* * string topic = 2; */ public Builder clearTopic() { topic_ = getDefaultInstance().getTopic(); onChanged(); return this; } /** * * *
     * The name of the topic from which this subscription is receiving messages.
     * Format is `projects/{project}/topics/{topic}`.
     * The value of this field will be `_deleted-topic_` if the topic has been
     * deleted.
     * 
* * 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_; 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.
     * 
* * .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.
     * 
* * .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.
     * 
* * .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.
     * 
* * .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.
     * 
* * .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.
     * 
* * .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.
     * 
* * .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.
     * 
* * .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.
     * 
* * .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_; /** * * *
     * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
     * the subscriber to acknowledge receipt before resending the message. In the
     * interval after the message is delivered and before it is acknowledged, it
     * is considered to be <i>outstanding</i>. During that time period, the
     * message will not be redelivered (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
     * non-streaming pull or send the `ack_id` in a
     * `StreamingModifyAckDeadlineRequest` if using streaming pull.
     * The minimum custom deadline you can specify is 10 seconds.
     * The maximum custom deadline you can specify is 600 seconds (10 minutes).
     * If this parameter is 0, a default value of 10 seconds is used.
     * 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.
     * 
* * int32 ack_deadline_seconds = 5; */ public int getAckDeadlineSeconds() { return ackDeadlineSeconds_; } /** * * *
     * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
     * the subscriber to acknowledge receipt before resending the message. In the
     * interval after the message is delivered and before it is acknowledged, it
     * is considered to be <i>outstanding</i>. During that time period, the
     * message will not be redelivered (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
     * non-streaming pull or send the `ack_id` in a
     * `StreamingModifyAckDeadlineRequest` if using streaming pull.
     * The minimum custom deadline you can specify is 10 seconds.
     * The maximum custom deadline you can specify is 600 seconds (10 minutes).
     * If this parameter is 0, a default value of 10 seconds is used.
     * 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.
     * 
* * int32 ack_deadline_seconds = 5; */ public Builder setAckDeadlineSeconds(int value) { ackDeadlineSeconds_ = value; onChanged(); return this; } /** * * *
     * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
     * the subscriber to acknowledge receipt before resending the message. In the
     * interval after the message is delivered and before it is acknowledged, it
     * is considered to be <i>outstanding</i>. During that time period, the
     * message will not be redelivered (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
     * non-streaming pull or send the `ack_id` in a
     * `StreamingModifyAckDeadlineRequest` if using streaming pull.
     * The minimum custom deadline you can specify is 10 seconds.
     * The maximum custom deadline you can specify is 600 seconds (10 minutes).
     * If this parameter is 0, a default value of 10 seconds is used.
     * 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.
     * 
* * int32 ack_deadline_seconds = 5; */ public Builder clearAckDeadlineSeconds() { ackDeadlineSeconds_ = 0; onChanged(); return this; } private boolean retainAckedMessages_; /** * * *
     * Indicates whether to retain acknowledged messages. If true, then
     * messages are not expunged from the subscription's backlog, even if they are
     * acknowledged, until they fall out of the `message_retention_duration`
     * window. This must be true if you would like to
     * <a
     * href="https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time">
     * Seek to a timestamp</a>.
     * 
* * bool retain_acked_messages = 7; */ public boolean getRetainAckedMessages() { return retainAckedMessages_; } /** * * *
     * Indicates whether to retain acknowledged messages. If true, then
     * messages are not expunged from the subscription's backlog, even if they are
     * acknowledged, until they fall out of the `message_retention_duration`
     * window. This must be true if you would like to
     * <a
     * href="https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time">
     * Seek to a timestamp</a>.
     * 
* * bool retain_acked_messages = 7; */ public Builder setRetainAckedMessages(boolean value) { retainAckedMessages_ = value; onChanged(); return this; } /** * * *
     * Indicates whether to retain acknowledged messages. If true, then
     * messages are not expunged from the subscription's backlog, even if they are
     * acknowledged, until they fall out of the `message_retention_duration`
     * window. This must be true if you would like to
     * <a
     * href="https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time">
     * Seek to a timestamp</a>.
     * 
* * bool retain_acked_messages = 7; */ public Builder clearRetainAckedMessages() { retainAckedMessages_ = false; onChanged(); return this; } private com.google.protobuf.Duration messageRetentionDuration_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> messageRetentionDurationBuilder_; /** * * *
     * How long to retain unacknowledged messages in the subscription's backlog,
     * from the moment a message is published.
     * If `retain_acked_messages` is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a `Seek`
     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
     * minutes.
     * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public boolean hasMessageRetentionDuration() { return messageRetentionDurationBuilder_ != null || messageRetentionDuration_ != null; } /** * * *
     * How long to retain unacknowledged messages in the subscription's backlog,
     * from the moment a message is published.
     * If `retain_acked_messages` is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a `Seek`
     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
     * minutes.
     * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public com.google.protobuf.Duration getMessageRetentionDuration() { if (messageRetentionDurationBuilder_ == null) { return messageRetentionDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : messageRetentionDuration_; } else { return messageRetentionDurationBuilder_.getMessage(); } } /** * * *
     * How long to retain unacknowledged messages in the subscription's backlog,
     * from the moment a message is published.
     * If `retain_acked_messages` is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a `Seek`
     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
     * minutes.
     * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public Builder setMessageRetentionDuration(com.google.protobuf.Duration value) { if (messageRetentionDurationBuilder_ == null) { if (value == null) { throw new NullPointerException(); } messageRetentionDuration_ = value; onChanged(); } else { messageRetentionDurationBuilder_.setMessage(value); } return this; } /** * * *
     * How long to retain unacknowledged messages in the subscription's backlog,
     * from the moment a message is published.
     * If `retain_acked_messages` is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a `Seek`
     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
     * minutes.
     * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public Builder setMessageRetentionDuration( com.google.protobuf.Duration.Builder builderForValue) { if (messageRetentionDurationBuilder_ == null) { messageRetentionDuration_ = builderForValue.build(); onChanged(); } else { messageRetentionDurationBuilder_.setMessage(builderForValue.build()); } return this; } /** * * *
     * How long to retain unacknowledged messages in the subscription's backlog,
     * from the moment a message is published.
     * If `retain_acked_messages` is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a `Seek`
     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
     * minutes.
     * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public Builder mergeMessageRetentionDuration(com.google.protobuf.Duration value) { if (messageRetentionDurationBuilder_ == null) { if (messageRetentionDuration_ != null) { messageRetentionDuration_ = com.google.protobuf.Duration.newBuilder(messageRetentionDuration_) .mergeFrom(value) .buildPartial(); } else { messageRetentionDuration_ = value; } onChanged(); } else { messageRetentionDurationBuilder_.mergeFrom(value); } return this; } /** * * *
     * How long to retain unacknowledged messages in the subscription's backlog,
     * from the moment a message is published.
     * If `retain_acked_messages` is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a `Seek`
     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
     * minutes.
     * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public Builder clearMessageRetentionDuration() { if (messageRetentionDurationBuilder_ == null) { messageRetentionDuration_ = null; onChanged(); } else { messageRetentionDuration_ = null; messageRetentionDurationBuilder_ = null; } return this; } /** * * *
     * How long to retain unacknowledged messages in the subscription's backlog,
     * from the moment a message is published.
     * If `retain_acked_messages` is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a `Seek`
     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
     * minutes.
     * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public com.google.protobuf.Duration.Builder getMessageRetentionDurationBuilder() { onChanged(); return getMessageRetentionDurationFieldBuilder().getBuilder(); } /** * * *
     * How long to retain unacknowledged messages in the subscription's backlog,
     * from the moment a message is published.
     * If `retain_acked_messages` is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a `Seek`
     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
     * minutes.
     * 
* * .google.protobuf.Duration message_retention_duration = 8; */ public com.google.protobuf.DurationOrBuilder getMessageRetentionDurationOrBuilder() { if (messageRetentionDurationBuilder_ != null) { return messageRetentionDurationBuilder_.getMessageOrBuilder(); } else { return messageRetentionDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : messageRetentionDuration_; } } /** * * *
     * How long to retain unacknowledged messages in the subscription's backlog,
     * from the moment a message is published.
     * If `retain_acked_messages` is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a `Seek`
     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
     * minutes.
     * 
* * .google.protobuf.Duration message_retention_duration = 8; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> getMessageRetentionDurationFieldBuilder() { if (messageRetentionDurationBuilder_ == null) { messageRetentionDurationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( getMessageRetentionDuration(), getParentForChildren(), isClean()); messageRetentionDuration_ = null; } return messageRetentionDurationBuilder_; } private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { if (labels_ == null) { return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); } return labels_; } private com.google.protobuf.MapField internalGetMutableLabels() { onChanged(); ; if (labels_ == null) { labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); } if (!labels_.isMutable()) { labels_ = labels_.copy(); } return labels_; } public int getLabelsCount() { return internalGetLabels().getMap().size(); } /** * * *
     * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
     * managing labels</a>.
     * 
* * map<string, string> labels = 9; */ public boolean containsLabels(java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetLabels().getMap().containsKey(key); } /** Use {@link #getLabelsMap()} instead. */ @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } /** * * *
     * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
     * managing labels</a>.
     * 
* * map<string, string> labels = 9; */ public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } /** * * *
     * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
     * managing labels</a>.
     * 
* * map<string, string> labels = 9; */ public java.lang.String getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
     * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
     * managing labels</a>.
     * 
* * map<string, string> labels = 9; */ public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetLabels().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearLabels() { internalGetMutableLabels().getMutableMap().clear(); return this; } /** * * *
     * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
     * managing labels</a>.
     * 
* * map<string, string> labels = 9; */ public Builder removeLabels(java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableLabels().getMutableMap().remove(key); return this; } /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableLabels() { return internalGetMutableLabels().getMutableMap(); } /** * * *
     * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
     * managing labels</a>.
     * 
* * map<string, string> labels = 9; */ public Builder putLabels(java.lang.String key, java.lang.String value) { if (key == null) { throw new java.lang.NullPointerException(); } if (value == null) { throw new java.lang.NullPointerException(); } internalGetMutableLabels().getMutableMap().put(key, value); return this; } /** * * *
     * See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
     * managing labels</a>.
     * 
* * map<string, string> labels = 9; */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); return this; } private boolean enableMessageOrdering_; /** * * *
     * If true, messages published with the same `ordering_key` in `PubsubMessage`
     * will be delivered to the subscribers in the order in which they
     * are received by the Pub/Sub system. Otherwise, they may be delivered in
     * any order.
     * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
     * API might be changed in backward-incompatible ways and is not recommended
     * for production use. It is not subject to any SLA or deprecation policy.
     * 
* * bool enable_message_ordering = 10; */ public boolean getEnableMessageOrdering() { return enableMessageOrdering_; } /** * * *
     * If true, messages published with the same `ordering_key` in `PubsubMessage`
     * will be delivered to the subscribers in the order in which they
     * are received by the Pub/Sub system. Otherwise, they may be delivered in
     * any order.
     * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
     * API might be changed in backward-incompatible ways and is not recommended
     * for production use. It is not subject to any SLA or deprecation policy.
     * 
* * bool enable_message_ordering = 10; */ public Builder setEnableMessageOrdering(boolean value) { enableMessageOrdering_ = value; onChanged(); return this; } /** * * *
     * If true, messages published with the same `ordering_key` in `PubsubMessage`
     * will be delivered to the subscribers in the order in which they
     * are received by the Pub/Sub system. Otherwise, they may be delivered in
     * any order.
     * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
     * API might be changed in backward-incompatible ways and is not recommended
     * for production use. It is not subject to any SLA or deprecation policy.
     * 
* * bool enable_message_ordering = 10; */ public Builder clearEnableMessageOrdering() { enableMessageOrdering_ = false; onChanged(); return this; } private com.google.pubsub.v1.ExpirationPolicy expirationPolicy_; private com.google.protobuf.SingleFieldBuilderV3< com.google.pubsub.v1.ExpirationPolicy, com.google.pubsub.v1.ExpirationPolicy.Builder, com.google.pubsub.v1.ExpirationPolicyOrBuilder> expirationPolicyBuilder_; /** * * *
     * A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber is
     * successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If `expiration_policy` is not set, a
     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
     * value for `expiration_policy.ttl` is 1 day.
     * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public boolean hasExpirationPolicy() { return expirationPolicyBuilder_ != null || expirationPolicy_ != null; } /** * * *
     * A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber is
     * successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If `expiration_policy` is not set, a
     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
     * value for `expiration_policy.ttl` is 1 day.
     * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public com.google.pubsub.v1.ExpirationPolicy getExpirationPolicy() { if (expirationPolicyBuilder_ == null) { return expirationPolicy_ == null ? com.google.pubsub.v1.ExpirationPolicy.getDefaultInstance() : expirationPolicy_; } else { return expirationPolicyBuilder_.getMessage(); } } /** * * *
     * A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber is
     * successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If `expiration_policy` is not set, a
     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
     * value for `expiration_policy.ttl` is 1 day.
     * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public Builder setExpirationPolicy(com.google.pubsub.v1.ExpirationPolicy value) { if (expirationPolicyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } expirationPolicy_ = value; onChanged(); } else { expirationPolicyBuilder_.setMessage(value); } return this; } /** * * *
     * A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber is
     * successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If `expiration_policy` is not set, a
     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
     * value for `expiration_policy.ttl` is 1 day.
     * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public Builder setExpirationPolicy( com.google.pubsub.v1.ExpirationPolicy.Builder builderForValue) { if (expirationPolicyBuilder_ == null) { expirationPolicy_ = builderForValue.build(); onChanged(); } else { expirationPolicyBuilder_.setMessage(builderForValue.build()); } return this; } /** * * *
     * A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber is
     * successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If `expiration_policy` is not set, a
     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
     * value for `expiration_policy.ttl` is 1 day.
     * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public Builder mergeExpirationPolicy(com.google.pubsub.v1.ExpirationPolicy value) { if (expirationPolicyBuilder_ == null) { if (expirationPolicy_ != null) { expirationPolicy_ = com.google.pubsub.v1.ExpirationPolicy.newBuilder(expirationPolicy_) .mergeFrom(value) .buildPartial(); } else { expirationPolicy_ = value; } onChanged(); } else { expirationPolicyBuilder_.mergeFrom(value); } return this; } /** * * *
     * A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber is
     * successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If `expiration_policy` is not set, a
     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
     * value for `expiration_policy.ttl` is 1 day.
     * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public Builder clearExpirationPolicy() { if (expirationPolicyBuilder_ == null) { expirationPolicy_ = null; onChanged(); } else { expirationPolicy_ = null; expirationPolicyBuilder_ = null; } return this; } /** * * *
     * A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber is
     * successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If `expiration_policy` is not set, a
     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
     * value for `expiration_policy.ttl` is 1 day.
     * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public com.google.pubsub.v1.ExpirationPolicy.Builder getExpirationPolicyBuilder() { onChanged(); return getExpirationPolicyFieldBuilder().getBuilder(); } /** * * *
     * A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber is
     * successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If `expiration_policy` is not set, a
     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
     * value for `expiration_policy.ttl` is 1 day.
     * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ public com.google.pubsub.v1.ExpirationPolicyOrBuilder getExpirationPolicyOrBuilder() { if (expirationPolicyBuilder_ != null) { return expirationPolicyBuilder_.getMessageOrBuilder(); } else { return expirationPolicy_ == null ? com.google.pubsub.v1.ExpirationPolicy.getDefaultInstance() : expirationPolicy_; } } /** * * *
     * A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber is
     * successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If `expiration_policy` is not set, a
     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
     * value for `expiration_policy.ttl` is 1 day.
     * 
* * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.pubsub.v1.ExpirationPolicy, com.google.pubsub.v1.ExpirationPolicy.Builder, com.google.pubsub.v1.ExpirationPolicyOrBuilder> getExpirationPolicyFieldBuilder() { if (expirationPolicyBuilder_ == null) { expirationPolicyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.pubsub.v1.ExpirationPolicy, com.google.pubsub.v1.ExpirationPolicy.Builder, com.google.pubsub.v1.ExpirationPolicyOrBuilder>( getExpirationPolicy(), getParentForChildren(), isClean()); expirationPolicy_ = null; } return expirationPolicyBuilder_; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@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() { @java.lang.Override 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; } @java.lang.Override public com.google.pubsub.v1.Subscription getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy