Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/pubsub/v1/pubsub.proto
// Protobuf Java Version: 3.25.5
package com.google.pubsub.v1;
/**
*
*
*
* A subscription resource. If none of `push_config`, `bigquery_config`, or
* `cloud_storage_config` is set, then the subscriber will pull and ack messages
* using API methods. At most one of these fields may be set.
*
*
* 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_ = "";
filter_ = "";
state_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Subscription();
}
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.MapFieldReflectionAccessor internalGetMapFieldReflection(
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);
}
/**
*
*
*
* Possible states for a subscription.
*
*
* Protobuf enum {@code google.pubsub.v1.Subscription.State}
*/
public enum State implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
*
* The subscription can actively receive messages
*
*
* ACTIVE = 1;
*/
ACTIVE(1),
/**
*
*
*
* The subscription cannot receive messages because of an error with the
* resource to which it pushes messages. See the more detailed error state
* in the corresponding configuration.
*
*
* STATE_UNSPECIFIED = 0;
*/
public static final int STATE_UNSPECIFIED_VALUE = 0;
/**
*
*
*
* The subscription can actively receive messages
*
*
* ACTIVE = 1;
*/
public static final int ACTIVE_VALUE = 1;
/**
*
*
*
* The subscription cannot receive messages because of an error with the
* resource to which it pushes messages. See the more detailed error state
* in the corresponding configuration.
*
*
* RESOURCE_ERROR = 2;
*/
public static final int RESOURCE_ERROR_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static State valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static State forNumber(int value) {
switch (value) {
case 0:
return STATE_UNSPECIFIED;
case 1:
return ACTIVE;
case 2:
return RESOURCE_ERROR;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public State findValueByNumber(int number) {
return State.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.pubsub.v1.Subscription.getDescriptor().getEnumTypes().get(0);
}
private static final State[] VALUES = values();
public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private State(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.pubsub.v1.Subscription.State)
}
public interface AnalyticsHubSubscriptionInfoOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* Optional. The name of the associated Analytics Hub listing resource.
* Pattern:
* "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
*
* Optional. The name of the associated Analytics Hub listing resource.
* Pattern:
* "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
*
* Optional. The name of the associated Analytics Hub subscription resource.
* Pattern:
* "projects/{project}/locations/{location}/subscriptions/{subscription}"
*
* Optional. The name of the associated Analytics Hub subscription resource.
* Pattern:
* "projects/{project}/locations/{location}/subscriptions/{subscription}"
*
* Information about an associated Analytics Hub subscription
* (https://cloud.google.com/bigquery/docs/analytics-hub-manage-subscriptions).
*
*
* Protobuf type {@code google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo}
*/
public static final class AnalyticsHubSubscriptionInfo
extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo)
AnalyticsHubSubscriptionInfoOrBuilder {
private static final long serialVersionUID = 0L;
// Use AnalyticsHubSubscriptionInfo.newBuilder() to construct.
private AnalyticsHubSubscriptionInfo(
com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private AnalyticsHubSubscriptionInfo() {
listing_ = "";
subscription_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new AnalyticsHubSubscriptionInfo();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_Subscription_AnalyticsHubSubscriptionInfo_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_Subscription_AnalyticsHubSubscriptionInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.class,
com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.Builder.class);
}
public static final int LISTING_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object listing_ = "";
/**
*
*
*
* Optional. The name of the associated Analytics Hub listing resource.
* Pattern:
* "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
*
* Optional. The name of the associated Analytics Hub listing resource.
* Pattern:
* "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
*
*
* string listing = 1 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The bytes for listing.
*/
@java.lang.Override
public com.google.protobuf.ByteString getListingBytes() {
java.lang.Object ref = listing_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
listing_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SUBSCRIPTION_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object subscription_ = "";
/**
*
*
*
* Optional. The name of the associated Analytics Hub subscription resource.
* Pattern:
* "projects/{project}/locations/{location}/subscriptions/{subscription}"
*
* Optional. The name of the associated Analytics Hub subscription resource.
* Pattern:
* "projects/{project}/locations/{location}/subscriptions/{subscription}"
*
*
* string subscription = 2 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The bytes for subscription.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSubscriptionBytes() {
java.lang.Object ref = subscription_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
subscription_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(listing_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, listing_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subscription_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(listing_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, listing_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subscription_);
}
size += getUnknownFields().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.AnalyticsHubSubscriptionInfo)) {
return super.equals(obj);
}
com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo other =
(com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo) obj;
if (!getListing().equals(other.getListing())) return false;
if (!getSubscription().equals(other.getSubscription())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LISTING_FIELD_NUMBER;
hash = (53 * hash) + getListing().hashCode();
hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER;
hash = (53 * hash) + getSubscription().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo 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.AnalyticsHubSubscriptionInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo 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.AnalyticsHubSubscriptionInfo parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo 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.AnalyticsHubSubscriptionInfo parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo 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.AnalyticsHubSubscriptionInfo parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo 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.AnalyticsHubSubscriptionInfo 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.AnalyticsHubSubscriptionInfo 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.AnalyticsHubSubscriptionInfo 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;
}
/**
*
*
*
* Information about an associated Analytics Hub subscription
* (https://cloud.google.com/bigquery/docs/analytics-hub-manage-subscriptions).
*
*
* Protobuf type {@code google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo)
com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_Subscription_AnalyticsHubSubscriptionInfo_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_Subscription_AnalyticsHubSubscriptionInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.class,
com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.Builder.class);
}
// Construct using com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
listing_ = "";
subscription_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.pubsub.v1.PubsubProto
.internal_static_google_pubsub_v1_Subscription_AnalyticsHubSubscriptionInfo_descriptor;
}
@java.lang.Override
public com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo
getDefaultInstanceForType() {
return com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.getDefaultInstance();
}
@java.lang.Override
public com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo build() {
com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo buildPartial() {
com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo result =
new com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(
com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.listing_ = listing_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.subscription_ = subscription_;
}
}
@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.AnalyticsHubSubscriptionInfo) {
return mergeFrom((com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo other) {
if (other
== com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo.getDefaultInstance())
return this;
if (!other.getListing().isEmpty()) {
listing_ = other.listing_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getSubscription().isEmpty()) {
subscription_ = other.subscription_;
bitField0_ |= 0x00000002;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
listing_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
subscription_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object listing_ = "";
/**
*
*
*
* Optional. The name of the associated Analytics Hub listing resource.
* Pattern:
* "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
*
* Optional. The name of the associated Analytics Hub listing resource.
* Pattern:
* "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
*
* Optional. The name of the associated Analytics Hub listing resource.
* Pattern:
* "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
*
*
* string listing = 1 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The listing to set.
* @return This builder for chaining.
*/
public Builder setListing(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
listing_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Optional. The name of the associated Analytics Hub listing resource.
* Pattern:
* "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
*
* Optional. The name of the associated Analytics Hub listing resource.
* Pattern:
* "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
*
*
* string listing = 1 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The bytes for listing to set.
* @return This builder for chaining.
*/
public Builder setListingBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
listing_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object subscription_ = "";
/**
*
*
*
* Optional. The name of the associated Analytics Hub subscription resource.
* Pattern:
* "projects/{project}/locations/{location}/subscriptions/{subscription}"
*
* Optional. The name of the associated Analytics Hub subscription resource.
* Pattern:
* "projects/{project}/locations/{location}/subscriptions/{subscription}"
*
* Optional. The name of the associated Analytics Hub subscription resource.
* Pattern:
* "projects/{project}/locations/{location}/subscriptions/{subscription}"
*
*
* string subscription = 2 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The subscription to set.
* @return This builder for chaining.
*/
public Builder setSubscription(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
subscription_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Optional. The name of the associated Analytics Hub subscription resource.
* Pattern:
* "projects/{project}/locations/{location}/subscriptions/{subscription}"
*
* Optional. The name of the associated Analytics Hub subscription resource.
* Pattern:
* "projects/{project}/locations/{location}/subscriptions/{subscription}"
*
*
* string subscription = 2 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The bytes for subscription to set.
* @return This builder for chaining.
*/
public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
subscription_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
@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.AnalyticsHubSubscriptionInfo)
}
// @@protoc_insertion_point(class_scope:google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo)
private static final com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo();
}
public static com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public AnalyticsHubSubscriptionInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException()
.setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
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.AnalyticsHubSubscriptionInfo
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int bitField0_;
public static final int NAME_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object name_ = "";
/**
*
*
*
* Required. 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"`.
*
* Required. 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 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for name.
*/
@java.lang.Override
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;
@SuppressWarnings("serial")
private volatile java.lang.Object topic_ = "";
/**
*
*
*
* Required. 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.
*
* Required. 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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
*
*
* @return The bytes for topic.
*/
@java.lang.Override
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_;
/**
*
*
*
* Optional. If push delivery is used with this subscription, this field is
* used to configure it.
*
*
* .google.pubsub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the pushConfig field is set.
*/
@java.lang.Override
public boolean hasPushConfig() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* Optional. If push delivery is used with this subscription, this field is
* used to configure it.
*
* Optional. If delivery to Google Cloud Storage is used with this
* subscription, this field is used to configure it.
*
*
*
* .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public com.google.pubsub.v1.CloudStorageConfigOrBuilder getCloudStorageConfigOrBuilder() {
return cloudStorageConfig_ == null
? com.google.pubsub.v1.CloudStorageConfig.getDefaultInstance()
: cloudStorageConfig_;
}
public static final int ACK_DEADLINE_SECONDS_FIELD_NUMBER = 5;
private int ackDeadlineSeconds_ = 0;
/**
*
*
*
* Optional. 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 _outstanding_. 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 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The ackDeadlineSeconds.
*/
@java.lang.Override
public int getAckDeadlineSeconds() {
return ackDeadlineSeconds_;
}
public static final int RETAIN_ACKED_MESSAGES_FIELD_NUMBER = 7;
private boolean retainAckedMessages_ = false;
/**
*
*
*
* Optional. 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 [`Seek` to a timestamp]
* (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
* the past to replay previously-acknowledged messages.
*
*
* bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The retainAckedMessages.
*/
@java.lang.Override
public boolean getRetainAckedMessages() {
return retainAckedMessages_;
}
public static final int MESSAGE_RETENTION_DURATION_FIELD_NUMBER = 8;
private com.google.protobuf.Duration messageRetentionDuration_;
/**
*
*
*
* Optional. 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 31 days or less than 10 minutes.
*
*
*
* .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the messageRetentionDuration field is set.
*/
@java.lang.Override
public boolean hasMessageRetentionDuration() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
*
*
* Optional. 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 31 days or less than 10 minutes.
*
* Optional. 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 31 days or less than 10 minutes.
*
*
*
* .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public com.google.protobuf.DurationOrBuilder getMessageRetentionDurationOrBuilder() {
return messageRetentionDuration_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: messageRetentionDuration_;
}
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,
"");
}
@SuppressWarnings("serial")
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();
}
/**
*
*
*
* Optional. See [Creating and managing
* labels](https://cloud.google.com/pubsub/docs/labels).
*
*
* map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public boolean containsLabels(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetLabels().getMap().containsKey(key);
}
/** Use {@link #getLabelsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getLabels() {
return getLabelsMap();
}
/**
*
*
*
* Optional. See [Creating and managing
* labels](https://cloud.google.com/pubsub/docs/labels).
*
* Optional. See [Creating and managing
* labels](https://cloud.google.com/pubsub/docs/labels).
*
*
* map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public java.lang.String getLabelsOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
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_ = false;
/**
*
*
*
* Optional. 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.
*
*
* bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The enableMessageOrdering.
*/
@java.lang.Override
public boolean getEnableMessageOrdering() {
return enableMessageOrdering_;
}
public static final int EXPIRATION_POLICY_FIELD_NUMBER = 11;
private com.google.pubsub.v1.ExpirationPolicy expirationPolicy_;
/**
*
*
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
*
*
* .google.pubsub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the expirationPolicy field is set.
*/
@java.lang.Override
public boolean hasExpirationPolicy() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
*
*
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
*
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
*
*
* string filter = 12 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The bytes for filter.
*/
@java.lang.Override
public com.google.protobuf.ByteString getFilterBytes() {
java.lang.Object ref = filter_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
filter_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DEAD_LETTER_POLICY_FIELD_NUMBER = 13;
private com.google.pubsub.v1.DeadLetterPolicy deadLetterPolicy_;
/**
*
*
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
*
*
* .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the deadLetterPolicy field is set.
*/
@java.lang.Override
public boolean hasDeadLetterPolicy() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
*
*
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
*
*
* .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public com.google.pubsub.v1.DeadLetterPolicyOrBuilder getDeadLetterPolicyOrBuilder() {
return deadLetterPolicy_ == null
? com.google.pubsub.v1.DeadLetterPolicy.getDefaultInstance()
: deadLetterPolicy_;
}
public static final int RETRY_POLICY_FIELD_NUMBER = 14;
private com.google.pubsub.v1.RetryPolicy retryPolicy_;
/**
*
*
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
*
*
* .google.pubsub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the retryPolicy field is set.
*/
@java.lang.Override
public boolean hasRetryPolicy() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
*
*
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Optional. Indicates whether the subscription is detached from its topic.
* Detached subscriptions don't receive messages from their topic and don't
* retain any backlog. `Pull` and `StreamingPull` requests will return
* FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
* the endpoint will not be made.
*
*
* bool detached = 15 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The detached.
*/
@java.lang.Override
public boolean getDetached() {
return detached_;
}
public static final int ENABLE_EXACTLY_ONCE_DELIVERY_FIELD_NUMBER = 16;
private boolean enableExactlyOnceDelivery_ = false;
/**
*
*
*
* Optional. If true, Pub/Sub provides the following guarantees for the
* delivery of a message with a given value of `message_id` on this
* subscription:
*
* * The message sent to a subscriber is guaranteed not to be resent
* before the message's acknowledgement deadline expires.
* * An acknowledged message will not be resent to a subscriber.
*
* Note that subscribers may still receive multiple copies of a message
* when `enable_exactly_once_delivery` is true if the message was published
* multiple times by a publisher client. These copies are considered distinct
* by Pub/Sub and have distinct `message_id` values.
*
*
* bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The enableExactlyOnceDelivery.
*/
@java.lang.Override
public boolean getEnableExactlyOnceDelivery() {
return enableExactlyOnceDelivery_;
}
public static final int TOPIC_MESSAGE_RETENTION_DURATION_FIELD_NUMBER = 17;
private com.google.protobuf.Duration topicMessageRetentionDuration_;
/**
*
*
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
*
*
* .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return Whether the topicMessageRetentionDuration field is set.
*/
@java.lang.Override
public boolean hasTopicMessageRetentionDuration() {
return ((bitField0_ & 0x00000080) != 0);
}
/**
*
*
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
*
*
* .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*/
@java.lang.Override
public com.google.protobuf.DurationOrBuilder getTopicMessageRetentionDurationOrBuilder() {
return topicMessageRetentionDuration_ == null
? com.google.protobuf.Duration.getDefaultInstance()
: topicMessageRetentionDuration_;
}
public static final int STATE_FIELD_NUMBER = 19;
private int state_ = 0;
/**
*
*
*
* Output only. An output-only field indicating whether or not the
* subscription can receive messages.
*
*
*
* .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return The enum numeric value on the wire for state.
*/
@java.lang.Override
public int getStateValue() {
return state_;
}
/**
*
*
*
* Output only. An output-only field indicating whether or not the
* subscription can receive messages.
*
*
*
* .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return The state.
*/
@java.lang.Override
public com.google.pubsub.v1.Subscription.State getState() {
com.google.pubsub.v1.Subscription.State result =
com.google.pubsub.v1.Subscription.State.forNumber(state_);
return result == null ? com.google.pubsub.v1.Subscription.State.UNRECOGNIZED : result;
}
public static final int ANALYTICS_HUB_SUBSCRIPTION_INFO_FIELD_NUMBER = 23;
private com.google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo
analyticsHubSubscriptionInfo_;
/**
*
*
*
* Output only. Information about the associated Analytics Hub subscription.
* Only set if the subscritpion is created by Analytics Hub.
*
*
*
* .google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo analytics_hub_subscription_info = 23 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return Whether the analyticsHubSubscriptionInfo field is set.
*/
@java.lang.Override
public boolean hasAnalyticsHubSubscriptionInfo() {
return ((bitField0_ & 0x00000100) != 0);
}
/**
*
*
*
* Output only. Information about the associated Analytics Hub subscription.
* Only set if the subscritpion is created by Analytics Hub.
*
* A subscription resource. If none of `push_config`, `bigquery_config`, or
* `cloud_storage_config` is set, then the subscriber will pull and ack messages
* using API methods. At most one of these fields may be set.
*
*
* 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.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 9:
return internalGetLabels();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
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) {
getPushConfigFieldBuilder();
getBigqueryConfigFieldBuilder();
getCloudStorageConfigFieldBuilder();
getMessageRetentionDurationFieldBuilder();
getExpirationPolicyFieldBuilder();
getDeadLetterPolicyFieldBuilder();
getRetryPolicyFieldBuilder();
getTopicMessageRetentionDurationFieldBuilder();
getAnalyticsHubSubscriptionInfoFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
name_ = "";
topic_ = "";
pushConfig_ = null;
if (pushConfigBuilder_ != null) {
pushConfigBuilder_.dispose();
pushConfigBuilder_ = null;
}
bigqueryConfig_ = null;
if (bigqueryConfigBuilder_ != null) {
bigqueryConfigBuilder_.dispose();
bigqueryConfigBuilder_ = null;
}
cloudStorageConfig_ = null;
if (cloudStorageConfigBuilder_ != null) {
cloudStorageConfigBuilder_.dispose();
cloudStorageConfigBuilder_ = null;
}
ackDeadlineSeconds_ = 0;
retainAckedMessages_ = false;
messageRetentionDuration_ = null;
if (messageRetentionDurationBuilder_ != null) {
messageRetentionDurationBuilder_.dispose();
messageRetentionDurationBuilder_ = null;
}
internalGetMutableLabels().clear();
enableMessageOrdering_ = false;
expirationPolicy_ = null;
if (expirationPolicyBuilder_ != null) {
expirationPolicyBuilder_.dispose();
expirationPolicyBuilder_ = null;
}
filter_ = "";
deadLetterPolicy_ = null;
if (deadLetterPolicyBuilder_ != null) {
deadLetterPolicyBuilder_.dispose();
deadLetterPolicyBuilder_ = null;
}
retryPolicy_ = null;
if (retryPolicyBuilder_ != null) {
retryPolicyBuilder_.dispose();
retryPolicyBuilder_ = null;
}
detached_ = false;
enableExactlyOnceDelivery_ = false;
topicMessageRetentionDuration_ = null;
if (topicMessageRetentionDurationBuilder_ != null) {
topicMessageRetentionDurationBuilder_.dispose();
topicMessageRetentionDurationBuilder_ = null;
}
state_ = 0;
analyticsHubSubscriptionInfo_ = null;
if (analyticsHubSubscriptionInfoBuilder_ != null) {
analyticsHubSubscriptionInfoBuilder_.dispose();
analyticsHubSubscriptionInfoBuilder_ = 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);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(com.google.pubsub.v1.Subscription result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.name_ = name_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.topic_ = topic_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000004) != 0)) {
result.pushConfig_ = pushConfigBuilder_ == null ? pushConfig_ : pushConfigBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.bigqueryConfig_ =
bigqueryConfigBuilder_ == null ? bigqueryConfig_ : bigqueryConfigBuilder_.build();
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.cloudStorageConfig_ =
cloudStorageConfigBuilder_ == null
? cloudStorageConfig_
: cloudStorageConfigBuilder_.build();
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.ackDeadlineSeconds_ = ackDeadlineSeconds_;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.retainAckedMessages_ = retainAckedMessages_;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.messageRetentionDuration_ =
messageRetentionDurationBuilder_ == null
? messageRetentionDuration_
: messageRetentionDurationBuilder_.build();
to_bitField0_ |= 0x00000008;
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.labels_ = internalGetLabels();
result.labels_.makeImmutable();
}
if (((from_bitField0_ & 0x00000200) != 0)) {
result.enableMessageOrdering_ = enableMessageOrdering_;
}
if (((from_bitField0_ & 0x00000400) != 0)) {
result.expirationPolicy_ =
expirationPolicyBuilder_ == null ? expirationPolicy_ : expirationPolicyBuilder_.build();
to_bitField0_ |= 0x00000010;
}
if (((from_bitField0_ & 0x00000800) != 0)) {
result.filter_ = filter_;
}
if (((from_bitField0_ & 0x00001000) != 0)) {
result.deadLetterPolicy_ =
deadLetterPolicyBuilder_ == null ? deadLetterPolicy_ : deadLetterPolicyBuilder_.build();
to_bitField0_ |= 0x00000020;
}
if (((from_bitField0_ & 0x00002000) != 0)) {
result.retryPolicy_ =
retryPolicyBuilder_ == null ? retryPolicy_ : retryPolicyBuilder_.build();
to_bitField0_ |= 0x00000040;
}
if (((from_bitField0_ & 0x00004000) != 0)) {
result.detached_ = detached_;
}
if (((from_bitField0_ & 0x00008000) != 0)) {
result.enableExactlyOnceDelivery_ = enableExactlyOnceDelivery_;
}
if (((from_bitField0_ & 0x00010000) != 0)) {
result.topicMessageRetentionDuration_ =
topicMessageRetentionDurationBuilder_ == null
? topicMessageRetentionDuration_
: topicMessageRetentionDurationBuilder_.build();
to_bitField0_ |= 0x00000080;
}
if (((from_bitField0_ & 0x00020000) != 0)) {
result.state_ = state_;
}
if (((from_bitField0_ & 0x00040000) != 0)) {
result.analyticsHubSubscriptionInfo_ =
analyticsHubSubscriptionInfoBuilder_ == null
? analyticsHubSubscriptionInfo_
: analyticsHubSubscriptionInfoBuilder_.build();
to_bitField0_ |= 0x00000100;
}
result.bitField0_ |= to_bitField0_;
}
@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_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getTopic().isEmpty()) {
topic_ = other.topic_;
bitField0_ |= 0x00000002;
onChanged();
}
if (other.hasPushConfig()) {
mergePushConfig(other.getPushConfig());
}
if (other.hasBigqueryConfig()) {
mergeBigqueryConfig(other.getBigqueryConfig());
}
if (other.hasCloudStorageConfig()) {
mergeCloudStorageConfig(other.getCloudStorageConfig());
}
if (other.getAckDeadlineSeconds() != 0) {
setAckDeadlineSeconds(other.getAckDeadlineSeconds());
}
if (other.getRetainAckedMessages() != false) {
setRetainAckedMessages(other.getRetainAckedMessages());
}
if (other.hasMessageRetentionDuration()) {
mergeMessageRetentionDuration(other.getMessageRetentionDuration());
}
internalGetMutableLabels().mergeFrom(other.internalGetLabels());
bitField0_ |= 0x00000100;
if (other.getEnableMessageOrdering() != false) {
setEnableMessageOrdering(other.getEnableMessageOrdering());
}
if (other.hasExpirationPolicy()) {
mergeExpirationPolicy(other.getExpirationPolicy());
}
if (!other.getFilter().isEmpty()) {
filter_ = other.filter_;
bitField0_ |= 0x00000800;
onChanged();
}
if (other.hasDeadLetterPolicy()) {
mergeDeadLetterPolicy(other.getDeadLetterPolicy());
}
if (other.hasRetryPolicy()) {
mergeRetryPolicy(other.getRetryPolicy());
}
if (other.getDetached() != false) {
setDetached(other.getDetached());
}
if (other.getEnableExactlyOnceDelivery() != false) {
setEnableExactlyOnceDelivery(other.getEnableExactlyOnceDelivery());
}
if (other.hasTopicMessageRetentionDuration()) {
mergeTopicMessageRetentionDuration(other.getTopicMessageRetentionDuration());
}
if (other.state_ != 0) {
setStateValue(other.getStateValue());
}
if (other.hasAnalyticsHubSubscriptionInfo()) {
mergeAnalyticsHubSubscriptionInfo(other.getAnalyticsHubSubscriptionInfo());
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
name_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
topic_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 34:
{
input.readMessage(getPushConfigFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000004;
break;
} // case 34
case 40:
{
ackDeadlineSeconds_ = input.readInt32();
bitField0_ |= 0x00000020;
break;
} // case 40
case 56:
{
retainAckedMessages_ = input.readBool();
bitField0_ |= 0x00000040;
break;
} // case 56
case 66:
{
input.readMessage(
getMessageRetentionDurationFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000080;
break;
} // case 66
case 74:
{
com.google.protobuf.MapEntry labels__ =
input.readMessage(
LabelsDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableLabels()
.getMutableMap()
.put(labels__.getKey(), labels__.getValue());
bitField0_ |= 0x00000100;
break;
} // case 74
case 80:
{
enableMessageOrdering_ = input.readBool();
bitField0_ |= 0x00000200;
break;
} // case 80
case 90:
{
input.readMessage(
getExpirationPolicyFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000400;
break;
} // case 90
case 98:
{
filter_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000800;
break;
} // case 98
case 106:
{
input.readMessage(
getDeadLetterPolicyFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00001000;
break;
} // case 106
case 114:
{
input.readMessage(getRetryPolicyFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00002000;
break;
} // case 114
case 120:
{
detached_ = input.readBool();
bitField0_ |= 0x00004000;
break;
} // case 120
case 128:
{
enableExactlyOnceDelivery_ = input.readBool();
bitField0_ |= 0x00008000;
break;
} // case 128
case 138:
{
input.readMessage(
getTopicMessageRetentionDurationFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00010000;
break;
} // case 138
case 146:
{
input.readMessage(getBigqueryConfigFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000008;
break;
} // case 146
case 152:
{
state_ = input.readEnum();
bitField0_ |= 0x00020000;
break;
} // case 152
case 178:
{
input.readMessage(
getCloudStorageConfigFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000010;
break;
} // case 178
case 186:
{
input.readMessage(
getAnalyticsHubSubscriptionInfoFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00040000;
break;
} // case 186
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
*
*
*
* Required. 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"`.
*
* Required. 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 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for name.
*/
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;
}
}
/**
*
*
*
* Required. 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 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Required. 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 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* Required. 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 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object topic_ = "";
/**
*
*
*
* Required. 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.
*
* Required. 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.
*
* Required. 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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
*
*
* @param value The topic to set.
* @return This builder for chaining.
*/
public Builder setTopic(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
topic_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Required. 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.
*
* Required. 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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
*
*
* @param value The bytes for topic to set.
* @return This builder for chaining.
*/
public Builder setTopicBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
topic_ = value;
bitField0_ |= 0x00000002;
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_;
/**
*
*
*
* Optional. If push delivery is used with this subscription, this field is
* used to configure it.
*
*
* .google.pubsub.v1.PushConfig push_config = 4 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the pushConfig field is set.
*/
public boolean hasPushConfig() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*
*
* Optional. If push delivery is used with this subscription, this field is
* used to configure it.
*
* Optional. 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 _outstanding_. 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 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The ackDeadlineSeconds.
*/
@java.lang.Override
public int getAckDeadlineSeconds() {
return ackDeadlineSeconds_;
}
/**
*
*
*
* Optional. 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 _outstanding_. 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 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The ackDeadlineSeconds to set.
* @return This builder for chaining.
*/
public Builder setAckDeadlineSeconds(int value) {
ackDeadlineSeconds_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
*
* Optional. 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 _outstanding_. 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.
*
* Optional. 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 [`Seek` to a timestamp]
* (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
* the past to replay previously-acknowledged messages.
*
* Optional. 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 [`Seek` to a timestamp]
* (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
* the past to replay previously-acknowledged messages.
*
*
* bool retain_acked_messages = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The retainAckedMessages to set.
* @return This builder for chaining.
*/
public Builder setRetainAckedMessages(boolean value) {
retainAckedMessages_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* Optional. 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 [`Seek` to a timestamp]
* (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
* the past to replay previously-acknowledged messages.
*
* Optional. 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 31 days or less than 10 minutes.
*
*
*
* .google.protobuf.Duration message_retention_duration = 8 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the messageRetentionDuration field is set.
*/
public boolean hasMessageRetentionDuration() {
return ((bitField0_ & 0x00000080) != 0);
}
/**
*
*
*
* Optional. 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 31 days or less than 10 minutes.
*
* Optional. 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 31 days or less than 10 minutes.
*
* Optional. 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 31 days or less than 10 minutes.
*
* Optional. 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 31 days or less than 10 minutes.
*
* Optional. 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 31 days or less than 10 minutes.
*
* Optional. 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 31 days or less than 10 minutes.
*
* Optional. 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 31 days or less than 10 minutes.
*
* Optional. 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 31 days or less than 10 minutes.
*
* Optional. 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.
*
* Optional. 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.
*
*
* bool enable_message_ordering = 10 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The enableMessageOrdering to set.
* @return This builder for chaining.
*/
public Builder setEnableMessageOrdering(boolean value) {
enableMessageOrdering_ = value;
bitField0_ |= 0x00000200;
onChanged();
return this;
}
/**
*
*
*
* Optional. 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.
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
*
*
* .google.pubsub.v1.ExpirationPolicy expiration_policy = 11 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the expirationPolicy field is set.
*/
public boolean hasExpirationPolicy() {
return ((bitField0_ & 0x00000400) != 0);
}
/**
*
*
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Optional. 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. If `expiration_policy` is set,
* but `expiration_policy.ttl` is not set, the subscription never expires.
*
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
*
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
*
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
*
*
* string filter = 12 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The filter to set.
* @return This builder for chaining.
*/
public Builder setFilter(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
filter_ = value;
bitField0_ |= 0x00000800;
onChanged();
return this;
}
/**
*
*
*
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
*
* Optional. An expression written in the Pub/Sub [filter
* language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
* then only `PubsubMessage`s whose `attributes` field matches the filter are
* delivered on this subscription. If empty, then no messages are filtered
* out.
*
*
* string filter = 12 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The bytes for filter to set.
* @return This builder for chaining.
*/
public Builder setFilterBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
filter_ = value;
bitField0_ |= 0x00000800;
onChanged();
return this;
}
private com.google.pubsub.v1.DeadLetterPolicy deadLetterPolicy_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.pubsub.v1.DeadLetterPolicy,
com.google.pubsub.v1.DeadLetterPolicy.Builder,
com.google.pubsub.v1.DeadLetterPolicyOrBuilder>
deadLetterPolicyBuilder_;
/**
*
*
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
*
*
* .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the deadLetterPolicy field is set.
*/
public boolean hasDeadLetterPolicy() {
return ((bitField0_ & 0x00001000) != 0);
}
/**
*
*
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Optional. A policy that specifies the conditions for dead lettering
* messages in this subscription. If dead_letter_policy is not set, dead
* lettering is disabled.
*
* The Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
*
*
* .google.pubsub.v1.RetryPolicy retry_policy = 14 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @return Whether the retryPolicy field is set.
*/
public boolean hasRetryPolicy() {
return ((bitField0_ & 0x00002000) != 0);
}
/**
*
*
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Optional. A policy that specifies how Pub/Sub retries message delivery for
* this subscription.
*
* If not set, the default retry policy is applied. This generally implies
* that messages will be retried as soon as possible for healthy subscribers.
* RetryPolicy will be triggered on NACKs or acknowledgement deadline
* exceeded events for a given message.
*
* Optional. Indicates whether the subscription is detached from its topic.
* Detached subscriptions don't receive messages from their topic and don't
* retain any backlog. `Pull` and `StreamingPull` requests will return
* FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
* the endpoint will not be made.
*
* Optional. Indicates whether the subscription is detached from its topic.
* Detached subscriptions don't receive messages from their topic and don't
* retain any backlog. `Pull` and `StreamingPull` requests will return
* FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
* the endpoint will not be made.
*
*
* bool detached = 15 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The detached to set.
* @return This builder for chaining.
*/
public Builder setDetached(boolean value) {
detached_ = value;
bitField0_ |= 0x00004000;
onChanged();
return this;
}
/**
*
*
*
* Optional. Indicates whether the subscription is detached from its topic.
* Detached subscriptions don't receive messages from their topic and don't
* retain any backlog. `Pull` and `StreamingPull` requests will return
* FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
* the endpoint will not be made.
*
* Optional. If true, Pub/Sub provides the following guarantees for the
* delivery of a message with a given value of `message_id` on this
* subscription:
*
* * The message sent to a subscriber is guaranteed not to be resent
* before the message's acknowledgement deadline expires.
* * An acknowledged message will not be resent to a subscriber.
*
* Note that subscribers may still receive multiple copies of a message
* when `enable_exactly_once_delivery` is true if the message was published
* multiple times by a publisher client. These copies are considered distinct
* by Pub/Sub and have distinct `message_id` values.
*
* Optional. If true, Pub/Sub provides the following guarantees for the
* delivery of a message with a given value of `message_id` on this
* subscription:
*
* * The message sent to a subscriber is guaranteed not to be resent
* before the message's acknowledgement deadline expires.
* * An acknowledged message will not be resent to a subscriber.
*
* Note that subscribers may still receive multiple copies of a message
* when `enable_exactly_once_delivery` is true if the message was published
* multiple times by a publisher client. These copies are considered distinct
* by Pub/Sub and have distinct `message_id` values.
*
*
* bool enable_exactly_once_delivery = 16 [(.google.api.field_behavior) = OPTIONAL];
*
*
* @param value The enableExactlyOnceDelivery to set.
* @return This builder for chaining.
*/
public Builder setEnableExactlyOnceDelivery(boolean value) {
enableExactlyOnceDelivery_ = value;
bitField0_ |= 0x00008000;
onChanged();
return this;
}
/**
*
*
*
* Optional. If true, Pub/Sub provides the following guarantees for the
* delivery of a message with a given value of `message_id` on this
* subscription:
*
* * The message sent to a subscriber is guaranteed not to be resent
* before the message's acknowledgement deadline expires.
* * An acknowledged message will not be resent to a subscriber.
*
* Note that subscribers may still receive multiple copies of a message
* when `enable_exactly_once_delivery` is true if the message was published
* multiple times by a publisher client. These copies are considered distinct
* by Pub/Sub and have distinct `message_id` values.
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
*
*
* .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return Whether the topicMessageRetentionDuration field is set.
*/
public boolean hasTopicMessageRetentionDuration() {
return ((bitField0_ & 0x00010000) != 0);
}
/**
*
*
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
* Output only. Indicates the minimum duration for which a message is retained
* after it is published to the subscription's topic. If this field is set,
* messages published to the subscription's topic in the last
* `topic_message_retention_duration` are always available to subscribers. See
* the `message_retention_duration` field in `Topic`. This field is set only
* in responses from the server; it is ignored if it is set in any requests.
*
* Output only. An output-only field indicating whether or not the
* subscription can receive messages.
*
*
*
* .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return The enum numeric value on the wire for state.
*/
@java.lang.Override
public int getStateValue() {
return state_;
}
/**
*
*
*
* Output only. An output-only field indicating whether or not the
* subscription can receive messages.
*
*
*
* .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @param value The enum numeric value on the wire for state to set.
* @return This builder for chaining.
*/
public Builder setStateValue(int value) {
state_ = value;
bitField0_ |= 0x00020000;
onChanged();
return this;
}
/**
*
*
*
* Output only. An output-only field indicating whether or not the
* subscription can receive messages.
*
*
*
* .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return The state.
*/
@java.lang.Override
public com.google.pubsub.v1.Subscription.State getState() {
com.google.pubsub.v1.Subscription.State result =
com.google.pubsub.v1.Subscription.State.forNumber(state_);
return result == null ? com.google.pubsub.v1.Subscription.State.UNRECOGNIZED : result;
}
/**
*
*
*
* Output only. An output-only field indicating whether or not the
* subscription can receive messages.
*
*
*
* .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @param value The state to set.
* @return This builder for chaining.
*/
public Builder setState(com.google.pubsub.v1.Subscription.State value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00020000;
state_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* Output only. An output-only field indicating whether or not the
* subscription can receive messages.
*