diff --git a/gcloud-java-pubsub/README.md b/gcloud-java-pubsub/README.md
new file mode 100644
index 000000000000..70393a4b7998
--- /dev/null
+++ b/gcloud-java-pubsub/README.md
@@ -0,0 +1,84 @@
+Google Cloud Java Client for Pub/Sub
+====================================
+
+Java idiomatic client for [Google Cloud Pub/Sub] (https://cloud.google.com/pubsub/).
+
+[![Build Status](https://travis-ci.org/GoogleCloudPlatform/gcloud-java.svg?branch=master)](https://travis-ci.org/GoogleCloudPlatform/gcloud-java)
+[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master)
+[![Maven](https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-pubsub.svg)]( https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-pubsub.svg)
+
+- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
+- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs)
+
+> Note: This client is a work-in-progress, and may occasionally
+> make backwards-incompatible changes.
+
+Quickstart
+----------
+Add this to your pom.xml file
+```xml
+
+ * Request for the Acknowledge method. + *+ */ +public final class AcknowledgeRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.AcknowledgeRequest) + AcknowledgeRequestOrBuilder { + // Use AcknowledgeRequest.newBuilder() to construct. + private AcknowledgeRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private AcknowledgeRequest() { + subscription_ = ""; + ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private AcknowledgeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + subscription_ = s; + break; + } + case 18: { + String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + ackIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + ackIds_.add(s); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + ackIds_ = ackIds_.getUnmodifiableView(); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_AcknowledgeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.AcknowledgeRequest.class, com.google.pubsub.v1.AcknowledgeRequest.Builder.class); + } + + private int bitField0_; + public static final int SUBSCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object subscription_; + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription whose message is being acknowledged. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription whose message is being acknowledged. + *+ */ + 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; + } + } + + public static final int ACK_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList ackIds_; + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public com.google.protobuf.ProtocolStringList + getAckIdsList() { + return ackIds_; + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public int getAckIdsCount() { + return ackIds_.size(); + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public java.lang.String getAckIds(int index) { + return ackIds_.get(index); + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public com.google.protobuf.ByteString + getAckIdsBytes(int index) { + return ackIds_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSubscriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, subscription_); + } + for (int i = 0; i < ackIds_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, ackIds_.getRaw(i)); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSubscriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, subscription_); + } + { + int dataSize = 0; + for (int i = 0; i < ackIds_.size(); i++) { + dataSize += computeStringSizeNoTag(ackIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getAckIdsList().size(); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.AcknowledgeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.AcknowledgeRequest 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.AcknowledgeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.AcknowledgeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.AcknowledgeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.AcknowledgeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.AcknowledgeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.AcknowledgeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.AcknowledgeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.AcknowledgeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.AcknowledgeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.AcknowledgeRequest} + * + *
+ * Request for the Acknowledge method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string subscription = 1;
+ *
+ * + * The subscription whose message is being acknowledged. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription whose message is being acknowledged. + *+ */ + public com.google.protobuf.ByteString + getSubscriptionBytes() { + java.lang.Object ref = subscription_; + if (ref instanceof 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; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription whose message is being acknowledged. + *+ */ + public Builder setSubscription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subscription_ = value; + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription whose message is being acknowledged. + *+ */ + public Builder clearSubscription() { + + subscription_ = getDefaultInstance().getSubscription(); + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription whose message is being acknowledged. + *+ */ + public Builder setSubscriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subscription_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureAckIdsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + ackIds_ = new com.google.protobuf.LazyStringArrayList(ackIds_); + bitField0_ |= 0x00000002; + } + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public com.google.protobuf.ProtocolStringList + getAckIdsList() { + return ackIds_.getUnmodifiableView(); + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public int getAckIdsCount() { + return ackIds_.size(); + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public java.lang.String getAckIds(int index) { + return ackIds_.get(index); + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public com.google.protobuf.ByteString + getAckIdsBytes(int index) { + return ackIds_.getByteString(index); + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public Builder setAckIds( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAckIdsIsMutable(); + ackIds_.set(index, value); + onChanged(); + return this; + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public Builder addAckIds( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAckIdsIsMutable(); + ackIds_.add(value); + onChanged(); + return this; + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public Builder addAllAckIds( + java.lang.Iterable
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public Builder clearAckIds() { + ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + public Builder addAckIdsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAckIdsIsMutable(); + ackIds_.add(value); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.AcknowledgeRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.AcknowledgeRequest) + private static final com.google.pubsub.v1.AcknowledgeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.AcknowledgeRequest(); + } + + public static com.google.pubsub.v1.AcknowledgeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string subscription = 1;
+ *
+ * + * The subscription whose message is being acknowledged. + *+ */ + java.lang.String getSubscription(); + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription whose message is being acknowledged. + *+ */ + com.google.protobuf.ByteString + getSubscriptionBytes(); + + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + com.google.protobuf.ProtocolStringList + getAckIdsList(); + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + int getAckIdsCount(); + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + java.lang.String getAckIds(int index); + /** + *
repeated string ack_ids = 2;
+ *
+ * + * The acknowledgment ID for the messages being acknowledged that was returned + * by the Pub/Sub system in the Pull response. Must not be empty. + *+ */ + com.google.protobuf.ByteString + getAckIdsBytes(int index); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java new file mode 100644 index 000000000000..acdfd0d71c83 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java @@ -0,0 +1,476 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.DeleteSubscriptionRequest} + * + *
+ * Request for the DeleteSubscription method. + *+ */ +public final class DeleteSubscriptionRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.DeleteSubscriptionRequest) + DeleteSubscriptionRequestOrBuilder { + // Use DeleteSubscriptionRequest.newBuilder() to construct. + private DeleteSubscriptionRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private DeleteSubscriptionRequest() { + subscription_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private DeleteSubscriptionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + subscription_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_DeleteSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.DeleteSubscriptionRequest.class, com.google.pubsub.v1.DeleteSubscriptionRequest.Builder.class); + } + + public static final int SUBSCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object subscription_; + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription to delete. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription to delete. + *+ */ + 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSubscriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, subscription_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSubscriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, subscription_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.DeleteSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.DeleteSubscriptionRequest 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.DeleteSubscriptionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.DeleteSubscriptionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.DeleteSubscriptionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.DeleteSubscriptionRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.DeleteSubscriptionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.DeleteSubscriptionRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.DeleteSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.DeleteSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.DeleteSubscriptionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.DeleteSubscriptionRequest} + * + *
+ * Request for the DeleteSubscription method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string subscription = 1;
+ *
+ * + * The subscription to delete. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription to delete. + *+ */ + public com.google.protobuf.ByteString + getSubscriptionBytes() { + java.lang.Object ref = subscription_; + if (ref instanceof 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; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription to delete. + *+ */ + public Builder setSubscription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subscription_ = value; + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription to delete. + *+ */ + public Builder clearSubscription() { + + subscription_ = getDefaultInstance().getSubscription(); + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription to delete. + *+ */ + public Builder setSubscriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subscription_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.DeleteSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.DeleteSubscriptionRequest) + private static final com.google.pubsub.v1.DeleteSubscriptionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.DeleteSubscriptionRequest(); + } + + public static com.google.pubsub.v1.DeleteSubscriptionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string subscription = 1;
+ *
+ * + * The subscription to delete. + *+ */ + java.lang.String getSubscription(); + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription to delete. + *+ */ + com.google.protobuf.ByteString + getSubscriptionBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java new file mode 100644 index 000000000000..cb7dd1257eea --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java @@ -0,0 +1,476 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.DeleteTopicRequest} + * + *
+ * Request for the DeleteTopic method. + *+ */ +public final class DeleteTopicRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.DeleteTopicRequest) + DeleteTopicRequestOrBuilder { + // Use DeleteTopicRequest.newBuilder() to construct. + private DeleteTopicRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private DeleteTopicRequest() { + topic_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private DeleteTopicRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_DeleteTopicRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.DeleteTopicRequest.class, com.google.pubsub.v1.DeleteTopicRequest.Builder.class); + } + + public static final int TOPIC_FIELD_NUMBER = 1; + private volatile java.lang.Object topic_; + /** + *
optional string topic = 1;
+ *
+ * + * Name of the topic to delete. + *+ */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * Name of the topic to delete. + *+ */ + 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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, topic_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, topic_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.DeleteTopicRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.DeleteTopicRequest 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.DeleteTopicRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.DeleteTopicRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.DeleteTopicRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.DeleteTopicRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.DeleteTopicRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.DeleteTopicRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.DeleteTopicRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.DeleteTopicRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.DeleteTopicRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.DeleteTopicRequest} + * + *
+ * Request for the DeleteTopic method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string topic = 1;
+ *
+ * + * Name of the topic to delete. + *+ */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * Name of the topic to delete. + *+ */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * Name of the topic to delete. + *+ */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + *
optional string topic = 1;
+ *
+ * + * Name of the topic to delete. + *+ */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + *
optional string topic = 1;
+ *
+ * + * Name of the topic to delete. + *+ */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.DeleteTopicRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.DeleteTopicRequest) + private static final com.google.pubsub.v1.DeleteTopicRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.DeleteTopicRequest(); + } + + public static com.google.pubsub.v1.DeleteTopicRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string topic = 1;
+ *
+ * + * Name of the topic to delete. + *+ */ + java.lang.String getTopic(); + /** + *
optional string topic = 1;
+ *
+ * + * Name of the topic to delete. + *+ */ + com.google.protobuf.ByteString + getTopicBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java new file mode 100644 index 000000000000..b8bd3e5f0249 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java @@ -0,0 +1,476 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.GetSubscriptionRequest} + * + *
+ * Request for the GetSubscription method. + *+ */ +public final class GetSubscriptionRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.GetSubscriptionRequest) + GetSubscriptionRequestOrBuilder { + // Use GetSubscriptionRequest.newBuilder() to construct. + private GetSubscriptionRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private GetSubscriptionRequest() { + subscription_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private GetSubscriptionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + subscription_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_GetSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.GetSubscriptionRequest.class, com.google.pubsub.v1.GetSubscriptionRequest.Builder.class); + } + + public static final int SUBSCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object subscription_; + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription to get. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription to get. + *+ */ + 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; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSubscriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, subscription_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSubscriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, subscription_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.GetSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.GetSubscriptionRequest 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.GetSubscriptionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.GetSubscriptionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.GetSubscriptionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.GetSubscriptionRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.GetSubscriptionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.GetSubscriptionRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.GetSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.GetSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.GetSubscriptionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.GetSubscriptionRequest} + * + *
+ * Request for the GetSubscription method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string subscription = 1;
+ *
+ * + * The name of the subscription to get. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription to get. + *+ */ + public com.google.protobuf.ByteString + getSubscriptionBytes() { + java.lang.Object ref = subscription_; + if (ref instanceof 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; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription to get. + *+ */ + public Builder setSubscription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subscription_ = value; + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription to get. + *+ */ + public Builder clearSubscription() { + + subscription_ = getDefaultInstance().getSubscription(); + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription to get. + *+ */ + public Builder setSubscriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subscription_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.GetSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.GetSubscriptionRequest) + private static final com.google.pubsub.v1.GetSubscriptionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.GetSubscriptionRequest(); + } + + public static com.google.pubsub.v1.GetSubscriptionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string subscription = 1;
+ *
+ * + * The name of the subscription to get. + *+ */ + java.lang.String getSubscription(); + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription to get. + *+ */ + com.google.protobuf.ByteString + getSubscriptionBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetTopicRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetTopicRequest.java new file mode 100644 index 000000000000..17961ce28ab0 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetTopicRequest.java @@ -0,0 +1,476 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.GetTopicRequest} + * + *
+ * Request for the GetTopic method. + *+ */ +public final class GetTopicRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.GetTopicRequest) + GetTopicRequestOrBuilder { + // Use GetTopicRequest.newBuilder() to construct. + private GetTopicRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private GetTopicRequest() { + topic_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private GetTopicRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_GetTopicRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_GetTopicRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.GetTopicRequest.class, com.google.pubsub.v1.GetTopicRequest.Builder.class); + } + + public static final int TOPIC_FIELD_NUMBER = 1; + private volatile java.lang.Object topic_; + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic to get. + *+ */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic to get. + *+ */ + 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; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, topic_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, topic_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.GetTopicRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.GetTopicRequest 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.GetTopicRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.GetTopicRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.GetTopicRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.GetTopicRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.GetTopicRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.GetTopicRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.GetTopicRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.GetTopicRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.GetTopicRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.GetTopicRequest} + * + *
+ * Request for the GetTopic method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string topic = 1;
+ *
+ * + * The name of the topic to get. + *+ */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic to get. + *+ */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic to get. + *+ */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic to get. + *+ */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic to get. + *+ */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.GetTopicRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.GetTopicRequest) + private static final com.google.pubsub.v1.GetTopicRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.GetTopicRequest(); + } + + public static com.google.pubsub.v1.GetTopicRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string topic = 1;
+ *
+ * + * The name of the topic to get. + *+ */ + java.lang.String getTopic(); + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic to get. + *+ */ + com.google.protobuf.ByteString + getTopicBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequest.java new file mode 100644 index 000000000000..8b0cc2e8a04f --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequest.java @@ -0,0 +1,711 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.ListSubscriptionsRequest} + * + *
+ * Request for the ListSubscriptions method. + *+ */ +public final class ListSubscriptionsRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListSubscriptionsRequest) + ListSubscriptionsRequestOrBuilder { + // Use ListSubscriptionsRequest.newBuilder() to construct. + private ListSubscriptionsRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private ListSubscriptionsRequest() { + project_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private ListSubscriptionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + project_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListSubscriptionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListSubscriptionsRequest.class, com.google.pubsub.v1.ListSubscriptionsRequest.Builder.class); + } + + public static final int PROJECT_FIELD_NUMBER = 1; + private volatile java.lang.Object project_; + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that subscriptions belong to. + *+ */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that subscriptions belong to. + *+ */ + public com.google.protobuf.ByteString + getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of subscriptions to return. + *+ */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListSubscriptionsResponse; indicates that + * this is a continuation of a prior ListSubscriptions call, and that the + * system should return the next page of data. + *+ */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListSubscriptionsResponse; indicates that + * this is a continuation of a prior ListSubscriptions call, and that the + * system should return the next page of data. + *+ */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getProjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, project_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getProjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, project_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.ListSubscriptionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListSubscriptionsRequest 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.ListSubscriptionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListSubscriptionsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.ListSubscriptionsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListSubscriptionsRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListSubscriptionsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.ListSubscriptionsRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListSubscriptionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListSubscriptionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.ListSubscriptionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.ListSubscriptionsRequest} + * + *
+ * Request for the ListSubscriptions method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string project = 1;
+ *
+ * + * The name of the cloud project that subscriptions belong to. + *+ */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that subscriptions belong to. + *+ */ + public com.google.protobuf.ByteString + getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that subscriptions belong to. + *+ */ + public Builder setProject( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + project_ = value; + onChanged(); + return this; + } + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that subscriptions belong to. + *+ */ + public Builder clearProject() { + + project_ = getDefaultInstance().getProject(); + onChanged(); + return this; + } + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that subscriptions belong to. + *+ */ + public Builder setProjectBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + project_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of subscriptions to return. + *+ */ + public int getPageSize() { + return pageSize_; + } + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of subscriptions to return. + *+ */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of subscriptions to return. + *+ */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListSubscriptionsResponse; indicates that + * this is a continuation of a prior ListSubscriptions call, and that the + * system should return the next page of data. + *+ */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListSubscriptionsResponse; indicates that + * this is a continuation of a prior ListSubscriptions call, and that the + * system should return the next page of data. + *+ */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListSubscriptionsResponse; indicates that + * this is a continuation of a prior ListSubscriptions call, and that the + * system should return the next page of data. + *+ */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListSubscriptionsResponse; indicates that + * this is a continuation of a prior ListSubscriptions call, and that the + * system should return the next page of data. + *+ */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListSubscriptionsResponse; indicates that + * this is a continuation of a prior ListSubscriptions call, and that the + * system should return the next page of data. + *+ */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ListSubscriptionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSubscriptionsRequest) + private static final com.google.pubsub.v1.ListSubscriptionsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ListSubscriptionsRequest(); + } + + public static com.google.pubsub.v1.ListSubscriptionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string project = 1;
+ *
+ * + * The name of the cloud project that subscriptions belong to. + *+ */ + java.lang.String getProject(); + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that subscriptions belong to. + *+ */ + com.google.protobuf.ByteString + getProjectBytes(); + + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of subscriptions to return. + *+ */ + int getPageSize(); + + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListSubscriptionsResponse; indicates that + * this is a continuation of a prior ListSubscriptions call, and that the + * system should return the next page of data. + *+ */ + java.lang.String getPageToken(); + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListSubscriptionsResponse; indicates that + * this is a continuation of a prior ListSubscriptions call, and that the + * system should return the next page of data. + *+ */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponse.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponse.java new file mode 100644 index 000000000000..3ef3d6cea957 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponse.java @@ -0,0 +1,923 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.ListSubscriptionsResponse} + * + *
+ * Response for the ListSubscriptions method. + *+ */ +public final class ListSubscriptionsResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListSubscriptionsResponse) + ListSubscriptionsResponseOrBuilder { + // Use ListSubscriptionsResponse.newBuilder() to construct. + private ListSubscriptionsResponse(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private ListSubscriptionsResponse() { + subscriptions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private ListSubscriptionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + subscriptions_ = new java.util.ArrayList
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public java.util.List
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public java.util.List extends com.google.pubsub.v1.SubscriptionOrBuilder> + getSubscriptionsOrBuilderList() { + return subscriptions_; + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public int getSubscriptionsCount() { + return subscriptions_.size(); + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public com.google.pubsub.v1.Subscription getSubscriptions(int index) { + return subscriptions_.get(index); + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public com.google.pubsub.v1.SubscriptionOrBuilder getSubscriptionsOrBuilder( + int index) { + return subscriptions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new ListSubscriptionsRequest + * to get more subscriptions. + *+ */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new ListSubscriptionsRequest + * to get more subscriptions. + *+ */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < subscriptions_.size(); i++) { + output.writeMessage(1, subscriptions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < subscriptions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, subscriptions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.ListSubscriptionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListSubscriptionsResponse 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.ListSubscriptionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListSubscriptionsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.ListSubscriptionsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListSubscriptionsResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListSubscriptionsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.ListSubscriptionsResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListSubscriptionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListSubscriptionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.ListSubscriptionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.ListSubscriptionsResponse} + * + *
+ * Response for the ListSubscriptions method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public java.util.List
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public int getSubscriptionsCount() { + if (subscriptionsBuilder_ == null) { + return subscriptions_.size(); + } else { + return subscriptionsBuilder_.getCount(); + } + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public com.google.pubsub.v1.Subscription getSubscriptions(int index) { + if (subscriptionsBuilder_ == null) { + return subscriptions_.get(index); + } else { + return subscriptionsBuilder_.getMessage(index); + } + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public Builder setSubscriptions( + int index, com.google.pubsub.v1.Subscription value) { + if (subscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.set(index, value); + onChanged(); + } else { + subscriptionsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public Builder setSubscriptions( + int index, com.google.pubsub.v1.Subscription.Builder builderForValue) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.set(index, builderForValue.build()); + onChanged(); + } else { + subscriptionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public Builder addSubscriptions(com.google.pubsub.v1.Subscription value) { + if (subscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.add(value); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public Builder addSubscriptions( + int index, com.google.pubsub.v1.Subscription value) { + if (subscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.add(index, value); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public Builder addSubscriptions( + com.google.pubsub.v1.Subscription.Builder builderForValue) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.add(builderForValue.build()); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public Builder addSubscriptions( + int index, com.google.pubsub.v1.Subscription.Builder builderForValue) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.add(index, builderForValue.build()); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public Builder addAllSubscriptions( + java.lang.Iterable extends com.google.pubsub.v1.Subscription> values) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, subscriptions_); + onChanged(); + } else { + subscriptionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public Builder clearSubscriptions() { + if (subscriptionsBuilder_ == null) { + subscriptions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + subscriptionsBuilder_.clear(); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public Builder removeSubscriptions(int index) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.remove(index); + onChanged(); + } else { + subscriptionsBuilder_.remove(index); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public com.google.pubsub.v1.Subscription.Builder getSubscriptionsBuilder( + int index) { + return getSubscriptionsFieldBuilder().getBuilder(index); + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public com.google.pubsub.v1.SubscriptionOrBuilder getSubscriptionsOrBuilder( + int index) { + if (subscriptionsBuilder_ == null) { + return subscriptions_.get(index); } else { + return subscriptionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public java.util.List extends com.google.pubsub.v1.SubscriptionOrBuilder> + getSubscriptionsOrBuilderList() { + if (subscriptionsBuilder_ != null) { + return subscriptionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(subscriptions_); + } + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public com.google.pubsub.v1.Subscription.Builder addSubscriptionsBuilder() { + return getSubscriptionsFieldBuilder().addBuilder( + com.google.pubsub.v1.Subscription.getDefaultInstance()); + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public com.google.pubsub.v1.Subscription.Builder addSubscriptionsBuilder( + int index) { + return getSubscriptionsFieldBuilder().addBuilder( + index, com.google.pubsub.v1.Subscription.getDefaultInstance()); + } + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + public java.util.List
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new ListSubscriptionsRequest + * to get more subscriptions. + *+ */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new ListSubscriptionsRequest + * to get more subscriptions. + *+ */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new ListSubscriptionsRequest + * to get more subscriptions. + *+ */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new ListSubscriptionsRequest + * to get more subscriptions. + *+ */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new ListSubscriptionsRequest + * to get more subscriptions. + *+ */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ListSubscriptionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSubscriptionsResponse) + private static final com.google.pubsub.v1.ListSubscriptionsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ListSubscriptionsResponse(); + } + + public static com.google.pubsub.v1.ListSubscriptionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + java.util.List
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + com.google.pubsub.v1.Subscription getSubscriptions(int index); + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + int getSubscriptionsCount(); + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + java.util.List extends com.google.pubsub.v1.SubscriptionOrBuilder> + getSubscriptionsOrBuilderList(); + /** + *
repeated .google.pubsub.v1.Subscription subscriptions = 1;
+ *
+ * + * The subscriptions that match the request. + *+ */ + com.google.pubsub.v1.SubscriptionOrBuilder getSubscriptionsOrBuilder( + int index); + + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new ListSubscriptionsRequest + * to get more subscriptions. + *+ */ + java.lang.String getNextPageToken(); + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new ListSubscriptionsRequest + * to get more subscriptions. + *+ */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequest.java new file mode 100644 index 000000000000..c0e56b784e13 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequest.java @@ -0,0 +1,711 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.ListTopicSubscriptionsRequest} + * + *
+ * Request for the ListTopicSubscriptions method. + *+ */ +public final class ListTopicSubscriptionsRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListTopicSubscriptionsRequest) + ListTopicSubscriptionsRequestOrBuilder { + // Use ListTopicSubscriptionsRequest.newBuilder() to construct. + private ListTopicSubscriptionsRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private ListTopicSubscriptionsRequest() { + topic_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private ListTopicSubscriptionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListTopicSubscriptionsRequest.class, com.google.pubsub.v1.ListTopicSubscriptionsRequest.Builder.class); + } + + public static final int TOPIC_FIELD_NUMBER = 1; + private volatile java.lang.Object topic_; + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic that subscriptions are attached to. + *+ */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic that subscriptions are attached to. + *+ */ + 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 PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of subscription names to return. + *+ */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicSubscriptionsResponse; indicates + * that this is a continuation of a prior ListTopicSubscriptions call, and + * that the system should return the next page of data. + *+ */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicSubscriptionsResponse; indicates + * that this is a continuation of a prior ListTopicSubscriptions call, and + * that the system should return the next page of data. + *+ */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, topic_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, topic_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsRequest 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.ListTopicSubscriptionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.ListTopicSubscriptionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.ListTopicSubscriptionsRequest} + * + *
+ * Request for the ListTopicSubscriptions method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string topic = 1;
+ *
+ * + * The name of the topic that subscriptions are attached to. + *+ */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic that subscriptions are attached to. + *+ */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic that subscriptions are attached to. + *+ */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic that subscriptions are attached to. + *+ */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic that subscriptions are attached to. + *+ */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of subscription names to return. + *+ */ + public int getPageSize() { + return pageSize_; + } + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of subscription names to return. + *+ */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of subscription names to return. + *+ */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicSubscriptionsResponse; indicates + * that this is a continuation of a prior ListTopicSubscriptions call, and + * that the system should return the next page of data. + *+ */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicSubscriptionsResponse; indicates + * that this is a continuation of a prior ListTopicSubscriptions call, and + * that the system should return the next page of data. + *+ */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicSubscriptionsResponse; indicates + * that this is a continuation of a prior ListTopicSubscriptions call, and + * that the system should return the next page of data. + *+ */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicSubscriptionsResponse; indicates + * that this is a continuation of a prior ListTopicSubscriptions call, and + * that the system should return the next page of data. + *+ */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicSubscriptionsResponse; indicates + * that this is a continuation of a prior ListTopicSubscriptions call, and + * that the system should return the next page of data. + *+ */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ListTopicSubscriptionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicSubscriptionsRequest) + private static final com.google.pubsub.v1.ListTopicSubscriptionsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ListTopicSubscriptionsRequest(); + } + + public static com.google.pubsub.v1.ListTopicSubscriptionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string topic = 1;
+ *
+ * + * The name of the topic that subscriptions are attached to. + *+ */ + java.lang.String getTopic(); + /** + *
optional string topic = 1;
+ *
+ * + * The name of the topic that subscriptions are attached to. + *+ */ + com.google.protobuf.ByteString + getTopicBytes(); + + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of subscription names to return. + *+ */ + int getPageSize(); + + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicSubscriptionsResponse; indicates + * that this is a continuation of a prior ListTopicSubscriptions call, and + * that the system should return the next page of data. + *+ */ + java.lang.String getPageToken(); + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicSubscriptionsResponse; indicates + * that this is a continuation of a prior ListTopicSubscriptions call, and + * that the system should return the next page of data. + *+ */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponse.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponse.java new file mode 100644 index 000000000000..3fe8e4ccf74b --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponse.java @@ -0,0 +1,711 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.ListTopicSubscriptionsResponse} + * + *
+ * Response for the ListTopicSubscriptions method. + *+ */ +public final class ListTopicSubscriptionsResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListTopicSubscriptionsResponse) + ListTopicSubscriptionsResponseOrBuilder { + // Use ListTopicSubscriptionsResponse.newBuilder() to construct. + private ListTopicSubscriptionsResponse(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private ListTopicSubscriptionsResponse() { + subscriptions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private ListTopicSubscriptionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + subscriptions_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + subscriptions_.add(s); + break; + } + case 18: { + String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + subscriptions_ = subscriptions_.getUnmodifiableView(); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListTopicSubscriptionsResponse.class, com.google.pubsub.v1.ListTopicSubscriptionsResponse.Builder.class); + } + + private int bitField0_; + public static final int SUBSCRIPTIONS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList subscriptions_; + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public com.google.protobuf.ProtocolStringList + getSubscriptionsList() { + return subscriptions_; + } + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public int getSubscriptionsCount() { + return subscriptions_.size(); + } + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public java.lang.String getSubscriptions(int index) { + return subscriptions_.get(index); + } + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public com.google.protobuf.ByteString + getSubscriptionsBytes(int index) { + return subscriptions_.getByteString(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * ListTopicSubscriptionsRequest to get more subscriptions. + *+ */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * ListTopicSubscriptionsRequest to get more subscriptions. + *+ */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < subscriptions_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, subscriptions_.getRaw(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < subscriptions_.size(); i++) { + dataSize += computeStringSizeNoTag(subscriptions_.getRaw(i)); + } + size += dataSize; + size += 1 * getSubscriptionsList().size(); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsResponse 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.ListTopicSubscriptionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.ListTopicSubscriptionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.ListTopicSubscriptionsResponse} + * + *
+ * Response for the ListTopicSubscriptions method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public com.google.protobuf.ProtocolStringList + getSubscriptionsList() { + return subscriptions_.getUnmodifiableView(); + } + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public int getSubscriptionsCount() { + return subscriptions_.size(); + } + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public java.lang.String getSubscriptions(int index) { + return subscriptions_.get(index); + } + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public com.google.protobuf.ByteString + getSubscriptionsBytes(int index) { + return subscriptions_.getByteString(index); + } + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public Builder setSubscriptions( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.set(index, value); + onChanged(); + return this; + } + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public Builder addSubscriptions( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.add(value); + onChanged(); + return this; + } + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public Builder addAllSubscriptions( + java.lang.Iterable
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public Builder clearSubscriptions() { + subscriptions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + public Builder addSubscriptionsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSubscriptionsIsMutable(); + subscriptions_.add(value); + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * ListTopicSubscriptionsRequest to get more subscriptions. + *+ */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * ListTopicSubscriptionsRequest to get more subscriptions. + *+ */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * ListTopicSubscriptionsRequest to get more subscriptions. + *+ */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * ListTopicSubscriptionsRequest to get more subscriptions. + *+ */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * ListTopicSubscriptionsRequest to get more subscriptions. + *+ */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ListTopicSubscriptionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicSubscriptionsResponse) + private static final com.google.pubsub.v1.ListTopicSubscriptionsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ListTopicSubscriptionsResponse(); + } + + public static com.google.pubsub.v1.ListTopicSubscriptionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + com.google.protobuf.ProtocolStringList + getSubscriptionsList(); + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + int getSubscriptionsCount(); + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + java.lang.String getSubscriptions(int index); + /** + *
repeated string subscriptions = 1;
+ *
+ * + * The names of the subscriptions that match the request. + *+ */ + com.google.protobuf.ByteString + getSubscriptionsBytes(int index); + + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * ListTopicSubscriptionsRequest to get more subscriptions. + *+ */ + java.lang.String getNextPageToken(); + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * ListTopicSubscriptionsRequest to get more subscriptions. + *+ */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsRequest.java new file mode 100644 index 000000000000..3657dfe92162 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsRequest.java @@ -0,0 +1,711 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.ListTopicsRequest} + * + *
+ * Request for the ListTopics method. + *+ */ +public final class ListTopicsRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListTopicsRequest) + ListTopicsRequestOrBuilder { + // Use ListTopicsRequest.newBuilder() to construct. + private ListTopicsRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private ListTopicsRequest() { + project_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private ListTopicsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + project_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicsRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListTopicsRequest.class, com.google.pubsub.v1.ListTopicsRequest.Builder.class); + } + + public static final int PROJECT_FIELD_NUMBER = 1; + private volatile java.lang.Object project_; + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that topics belong to. + *+ */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } + } + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that topics belong to. + *+ */ + public com.google.protobuf.ByteString + getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of topics to return. + *+ */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicsResponse; indicates that this is + * a continuation of a prior ListTopics call, and that the system should + * return the next page of data. + *+ */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicsResponse; indicates that this is + * a continuation of a prior ListTopics call, and that the system should + * return the next page of data. + *+ */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getProjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, project_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getProjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, project_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.ListTopicsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListTopicsRequest 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.ListTopicsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListTopicsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListTopicsRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.ListTopicsRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListTopicsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.ListTopicsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.ListTopicsRequest} + * + *
+ * Request for the ListTopics method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string project = 1;
+ *
+ * + * The name of the cloud project that topics belong to. + *+ */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that topics belong to. + *+ */ + public com.google.protobuf.ByteString + getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that topics belong to. + *+ */ + public Builder setProject( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + project_ = value; + onChanged(); + return this; + } + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that topics belong to. + *+ */ + public Builder clearProject() { + + project_ = getDefaultInstance().getProject(); + onChanged(); + return this; + } + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that topics belong to. + *+ */ + public Builder setProjectBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + project_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of topics to return. + *+ */ + public int getPageSize() { + return pageSize_; + } + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of topics to return. + *+ */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of topics to return. + *+ */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicsResponse; indicates that this is + * a continuation of a prior ListTopics call, and that the system should + * return the next page of data. + *+ */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicsResponse; indicates that this is + * a continuation of a prior ListTopics call, and that the system should + * return the next page of data. + *+ */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicsResponse; indicates that this is + * a continuation of a prior ListTopics call, and that the system should + * return the next page of data. + *+ */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicsResponse; indicates that this is + * a continuation of a prior ListTopics call, and that the system should + * return the next page of data. + *+ */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicsResponse; indicates that this is + * a continuation of a prior ListTopics call, and that the system should + * return the next page of data. + *+ */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ListTopicsRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicsRequest) + private static final com.google.pubsub.v1.ListTopicsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ListTopicsRequest(); + } + + public static com.google.pubsub.v1.ListTopicsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string project = 1;
+ *
+ * + * The name of the cloud project that topics belong to. + *+ */ + java.lang.String getProject(); + /** + *
optional string project = 1;
+ *
+ * + * The name of the cloud project that topics belong to. + *+ */ + com.google.protobuf.ByteString + getProjectBytes(); + + /** + *
optional int32 page_size = 2;
+ *
+ * + * Maximum number of topics to return. + *+ */ + int getPageSize(); + + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicsResponse; indicates that this is + * a continuation of a prior ListTopics call, and that the system should + * return the next page of data. + *+ */ + java.lang.String getPageToken(); + /** + *
optional string page_token = 3;
+ *
+ * + * The value returned by the last ListTopicsResponse; indicates that this is + * a continuation of a prior ListTopics call, and that the system should + * return the next page of data. + *+ */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsResponse.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsResponse.java new file mode 100644 index 000000000000..80928fca5160 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsResponse.java @@ -0,0 +1,916 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.ListTopicsResponse} + * + *
+ * Response for the ListTopics method. + *+ */ +public final class ListTopicsResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListTopicsResponse) + ListTopicsResponseOrBuilder { + // Use ListTopicsResponse.newBuilder() to construct. + private ListTopicsResponse(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private ListTopicsResponse() { + topics_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private ListTopicsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + topics_ = new java.util.ArrayList
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public java.util.List
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public java.util.List extends com.google.pubsub.v1.TopicOrBuilder> + getTopicsOrBuilderList() { + return topics_; + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public int getTopicsCount() { + return topics_.size(); + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public com.google.pubsub.v1.Topic getTopics(int index) { + return topics_.get(index); + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public com.google.pubsub.v1.TopicOrBuilder getTopicsOrBuilder( + int index) { + return topics_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new ListTopicsRequest. + *+ */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new ListTopicsRequest. + *+ */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < topics_.size(); i++) { + output.writeMessage(1, topics_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < topics_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, topics_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.ListTopicsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListTopicsResponse 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.ListTopicsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ListTopicsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListTopicsResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.ListTopicsResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ListTopicsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ListTopicsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.ListTopicsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.ListTopicsResponse} + * + *
+ * Response for the ListTopics method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public java.util.List
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public int getTopicsCount() { + if (topicsBuilder_ == null) { + return topics_.size(); + } else { + return topicsBuilder_.getCount(); + } + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public com.google.pubsub.v1.Topic getTopics(int index) { + if (topicsBuilder_ == null) { + return topics_.get(index); + } else { + return topicsBuilder_.getMessage(index); + } + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public Builder setTopics( + int index, com.google.pubsub.v1.Topic value) { + if (topicsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopicsIsMutable(); + topics_.set(index, value); + onChanged(); + } else { + topicsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public Builder setTopics( + int index, com.google.pubsub.v1.Topic.Builder builderForValue) { + if (topicsBuilder_ == null) { + ensureTopicsIsMutable(); + topics_.set(index, builderForValue.build()); + onChanged(); + } else { + topicsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public Builder addTopics(com.google.pubsub.v1.Topic value) { + if (topicsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopicsIsMutable(); + topics_.add(value); + onChanged(); + } else { + topicsBuilder_.addMessage(value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public Builder addTopics( + int index, com.google.pubsub.v1.Topic value) { + if (topicsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopicsIsMutable(); + topics_.add(index, value); + onChanged(); + } else { + topicsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public Builder addTopics( + com.google.pubsub.v1.Topic.Builder builderForValue) { + if (topicsBuilder_ == null) { + ensureTopicsIsMutable(); + topics_.add(builderForValue.build()); + onChanged(); + } else { + topicsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public Builder addTopics( + int index, com.google.pubsub.v1.Topic.Builder builderForValue) { + if (topicsBuilder_ == null) { + ensureTopicsIsMutable(); + topics_.add(index, builderForValue.build()); + onChanged(); + } else { + topicsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public Builder addAllTopics( + java.lang.Iterable extends com.google.pubsub.v1.Topic> values) { + if (topicsBuilder_ == null) { + ensureTopicsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, topics_); + onChanged(); + } else { + topicsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public Builder clearTopics() { + if (topicsBuilder_ == null) { + topics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + topicsBuilder_.clear(); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public Builder removeTopics(int index) { + if (topicsBuilder_ == null) { + ensureTopicsIsMutable(); + topics_.remove(index); + onChanged(); + } else { + topicsBuilder_.remove(index); + } + return this; + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public com.google.pubsub.v1.Topic.Builder getTopicsBuilder( + int index) { + return getTopicsFieldBuilder().getBuilder(index); + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public com.google.pubsub.v1.TopicOrBuilder getTopicsOrBuilder( + int index) { + if (topicsBuilder_ == null) { + return topics_.get(index); } else { + return topicsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public java.util.List extends com.google.pubsub.v1.TopicOrBuilder> + getTopicsOrBuilderList() { + if (topicsBuilder_ != null) { + return topicsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(topics_); + } + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public com.google.pubsub.v1.Topic.Builder addTopicsBuilder() { + return getTopicsFieldBuilder().addBuilder( + com.google.pubsub.v1.Topic.getDefaultInstance()); + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public com.google.pubsub.v1.Topic.Builder addTopicsBuilder( + int index) { + return getTopicsFieldBuilder().addBuilder( + index, com.google.pubsub.v1.Topic.getDefaultInstance()); + } + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + public java.util.List
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new ListTopicsRequest. + *+ */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new ListTopicsRequest. + *+ */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new ListTopicsRequest. + *+ */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new ListTopicsRequest. + *+ */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new ListTopicsRequest. + *+ */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ListTopicsResponse) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicsResponse) + private static final com.google.pubsub.v1.ListTopicsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ListTopicsResponse(); + } + + public static com.google.pubsub.v1.ListTopicsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + java.util.List
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + com.google.pubsub.v1.Topic getTopics(int index); + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + int getTopicsCount(); + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + java.util.List extends com.google.pubsub.v1.TopicOrBuilder> + getTopicsOrBuilderList(); + /** + *
repeated .google.pubsub.v1.Topic topics = 1;
+ *
+ * + * The resulting topics. + *+ */ + com.google.pubsub.v1.TopicOrBuilder getTopicsOrBuilder( + int index); + + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new ListTopicsRequest. + *+ */ + java.lang.String getNextPageToken(); + /** + *
optional string next_page_token = 2;
+ *
+ * + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new ListTopicsRequest. + *+ */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java new file mode 100644 index 000000000000..aa51afc2f99e --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java @@ -0,0 +1,783 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.ModifyAckDeadlineRequest} + * + *
+ * Request for the ModifyAckDeadline method. + *+ */ +public final class ModifyAckDeadlineRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ModifyAckDeadlineRequest) + ModifyAckDeadlineRequestOrBuilder { + // Use ModifyAckDeadlineRequest.newBuilder() to construct. + private ModifyAckDeadlineRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private ModifyAckDeadlineRequest() { + subscription_ = ""; + ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + ackDeadlineSeconds_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private ModifyAckDeadlineRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + subscription_ = s; + break; + } + case 24: { + + ackDeadlineSeconds_ = input.readInt32(); + break; + } + case 34: { + String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + ackIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + ackIds_.add(s); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + ackIds_ = ackIds_.getUnmodifiableView(); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ModifyAckDeadlineRequest.class, com.google.pubsub.v1.ModifyAckDeadlineRequest.Builder.class); + } + + private int bitField0_; + public static final int SUBSCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object subscription_; + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + 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; + } + } + + public static final int ACK_IDS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList ackIds_; + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public com.google.protobuf.ProtocolStringList + getAckIdsList() { + return ackIds_; + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public int getAckIdsCount() { + return ackIds_.size(); + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public java.lang.String getAckIds(int index) { + return ackIds_.get(index); + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public com.google.protobuf.ByteString + getAckIdsBytes(int index) { + return ackIds_.getByteString(index); + } + + public static final int ACK_DEADLINE_SECONDS_FIELD_NUMBER = 3; + private int ackDeadlineSeconds_; + /** + *
optional int32 ack_deadline_seconds = 3;
+ *
+ * + * The new ack deadline with respect to the time this request was sent to the + * Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the ModifyAckDeadline call was made. + * Specifying zero may immediately make the message available for another pull + * request. + *+ */ + public int getAckDeadlineSeconds() { + return ackDeadlineSeconds_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSubscriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, subscription_); + } + if (ackDeadlineSeconds_ != 0) { + output.writeInt32(3, ackDeadlineSeconds_); + } + for (int i = 0; i < ackIds_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, ackIds_.getRaw(i)); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSubscriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, subscription_); + } + if (ackDeadlineSeconds_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, ackDeadlineSeconds_); + } + { + int dataSize = 0; + for (int i = 0; i < ackIds_.size(); i++) { + dataSize += computeStringSizeNoTag(ackIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getAckIdsList().size(); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ModifyAckDeadlineRequest 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.ModifyAckDeadlineRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.ModifyAckDeadlineRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.ModifyAckDeadlineRequest} + * + *
+ * Request for the ModifyAckDeadline method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public com.google.protobuf.ByteString + getSubscriptionBytes() { + java.lang.Object ref = subscription_; + if (ref instanceof 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; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public Builder setSubscription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subscription_ = value; + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public Builder clearSubscription() { + + subscription_ = getDefaultInstance().getSubscription(); + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public Builder setSubscriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subscription_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureAckIdsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + ackIds_ = new com.google.protobuf.LazyStringArrayList(ackIds_); + bitField0_ |= 0x00000002; + } + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public com.google.protobuf.ProtocolStringList + getAckIdsList() { + return ackIds_.getUnmodifiableView(); + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public int getAckIdsCount() { + return ackIds_.size(); + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public java.lang.String getAckIds(int index) { + return ackIds_.get(index); + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public com.google.protobuf.ByteString + getAckIdsBytes(int index) { + return ackIds_.getByteString(index); + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public Builder setAckIds( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAckIdsIsMutable(); + ackIds_.set(index, value); + onChanged(); + return this; + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public Builder addAckIds( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAckIdsIsMutable(); + ackIds_.add(value); + onChanged(); + return this; + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public Builder addAllAckIds( + java.lang.Iterable
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public Builder clearAckIds() { + ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + public Builder addAckIdsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAckIdsIsMutable(); + ackIds_.add(value); + onChanged(); + return this; + } + + private int ackDeadlineSeconds_ ; + /** + *
optional int32 ack_deadline_seconds = 3;
+ *
+ * + * The new ack deadline with respect to the time this request was sent to the + * Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the ModifyAckDeadline call was made. + * Specifying zero may immediately make the message available for another pull + * request. + *+ */ + public int getAckDeadlineSeconds() { + return ackDeadlineSeconds_; + } + /** + *
optional int32 ack_deadline_seconds = 3;
+ *
+ * + * The new ack deadline with respect to the time this request was sent to the + * Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the ModifyAckDeadline call was made. + * Specifying zero may immediately make the message available for another pull + * request. + *+ */ + public Builder setAckDeadlineSeconds(int value) { + + ackDeadlineSeconds_ = value; + onChanged(); + return this; + } + /** + *
optional int32 ack_deadline_seconds = 3;
+ *
+ * + * The new ack deadline with respect to the time this request was sent to the + * Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the ModifyAckDeadline call was made. + * Specifying zero may immediately make the message available for another pull + * request. + *+ */ + public Builder clearAckDeadlineSeconds() { + + ackDeadlineSeconds_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ModifyAckDeadlineRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ModifyAckDeadlineRequest) + private static final com.google.pubsub.v1.ModifyAckDeadlineRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ModifyAckDeadlineRequest(); + } + + public static com.google.pubsub.v1.ModifyAckDeadlineRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + java.lang.String getSubscription(); + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + com.google.protobuf.ByteString + getSubscriptionBytes(); + + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + com.google.protobuf.ProtocolStringList + getAckIdsList(); + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + int getAckIdsCount(); + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + java.lang.String getAckIds(int index); + /** + *
repeated string ack_ids = 4;
+ *
+ * + * List of acknowledgment IDs. + *+ */ + com.google.protobuf.ByteString + getAckIdsBytes(int index); + + /** + *
optional int32 ack_deadline_seconds = 3;
+ *
+ * + * The new ack deadline with respect to the time this request was sent to the + * Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the ModifyAckDeadline call was made. + * Specifying zero may immediately make the message available for another pull + * request. + *+ */ + int getAckDeadlineSeconds(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java new file mode 100644 index 000000000000..d3706a1c87c4 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java @@ -0,0 +1,744 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.ModifyPushConfigRequest} + * + *
+ * Request for the ModifyPushConfig method. + *+ */ +public final class ModifyPushConfigRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ModifyPushConfigRequest) + ModifyPushConfigRequestOrBuilder { + // Use ModifyPushConfigRequest.newBuilder() to construct. + private ModifyPushConfigRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private ModifyPushConfigRequest() { + subscription_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private ModifyPushConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + subscription_ = s; + break; + } + case 18: { + com.google.pubsub.v1.PushConfig.Builder subBuilder = null; + if (pushConfig_ != null) { + subBuilder = pushConfig_.toBuilder(); + } + pushConfig_ = input.readMessage(com.google.pubsub.v1.PushConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(pushConfig_); + pushConfig_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ModifyPushConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ModifyPushConfigRequest.class, com.google.pubsub.v1.ModifyPushConfigRequest.Builder.class); + } + + public static final int SUBSCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object subscription_; + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + 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; + } + } + + public static final int PUSH_CONFIG_FIELD_NUMBER = 2; + private com.google.pubsub.v1.PushConfig pushConfig_; + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public boolean hasPushConfig() { + return pushConfig_ != null; + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public com.google.pubsub.v1.PushConfig getPushConfig() { + return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() { + return getPushConfig(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSubscriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, subscription_); + } + if (pushConfig_ != null) { + output.writeMessage(2, getPushConfig()); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSubscriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, subscription_); + } + if (pushConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getPushConfig()); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.ModifyPushConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ModifyPushConfigRequest 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.ModifyPushConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ModifyPushConfigRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.ModifyPushConfigRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ModifyPushConfigRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ModifyPushConfigRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.ModifyPushConfigRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ModifyPushConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ModifyPushConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.ModifyPushConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.ModifyPushConfigRequest} + * + *
+ * Request for the ModifyPushConfig method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public com.google.protobuf.ByteString + getSubscriptionBytes() { + java.lang.Object ref = subscription_; + if (ref instanceof 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; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public Builder setSubscription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subscription_ = value; + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public Builder clearSubscription() { + + subscription_ = getDefaultInstance().getSubscription(); + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + public Builder setSubscriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subscription_ = value; + onChanged(); + return this; + } + + private com.google.pubsub.v1.PushConfig pushConfig_ = null; + private com.google.protobuf.SingleFieldBuilder< + com.google.pubsub.v1.PushConfig, com.google.pubsub.v1.PushConfig.Builder, com.google.pubsub.v1.PushConfigOrBuilder> pushConfigBuilder_; + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public boolean hasPushConfig() { + return pushConfigBuilder_ != null || pushConfig_ != null; + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public com.google.pubsub.v1.PushConfig getPushConfig() { + if (pushConfigBuilder_ == null) { + return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; + } else { + return pushConfigBuilder_.getMessage(); + } + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public Builder setPushConfig(com.google.pubsub.v1.PushConfig value) { + if (pushConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pushConfig_ = value; + onChanged(); + } else { + pushConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public Builder setPushConfig( + com.google.pubsub.v1.PushConfig.Builder builderForValue) { + if (pushConfigBuilder_ == null) { + pushConfig_ = builderForValue.build(); + onChanged(); + } else { + pushConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public Builder mergePushConfig(com.google.pubsub.v1.PushConfig value) { + if (pushConfigBuilder_ == null) { + if (pushConfig_ != null) { + pushConfig_ = + com.google.pubsub.v1.PushConfig.newBuilder(pushConfig_).mergeFrom(value).buildPartial(); + } else { + pushConfig_ = value; + } + onChanged(); + } else { + pushConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public Builder clearPushConfig() { + if (pushConfigBuilder_ == null) { + pushConfig_ = null; + onChanged(); + } else { + pushConfig_ = null; + pushConfigBuilder_ = null; + } + + return this; + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public com.google.pubsub.v1.PushConfig.Builder getPushConfigBuilder() { + + onChanged(); + return getPushConfigFieldBuilder().getBuilder(); + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() { + if (pushConfigBuilder_ != null) { + return pushConfigBuilder_.getMessageOrBuilder(); + } else { + return pushConfig_ == null ? + com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; + } + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + private com.google.protobuf.SingleFieldBuilder< + com.google.pubsub.v1.PushConfig, com.google.pubsub.v1.PushConfig.Builder, com.google.pubsub.v1.PushConfigOrBuilder> + getPushConfigFieldBuilder() { + if (pushConfigBuilder_ == null) { + pushConfigBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.pubsub.v1.PushConfig, com.google.pubsub.v1.PushConfig.Builder, com.google.pubsub.v1.PushConfigOrBuilder>( + getPushConfig(), + getParentForChildren(), + isClean()); + pushConfig_ = null; + } + return pushConfigBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ModifyPushConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ModifyPushConfigRequest) + private static final com.google.pubsub.v1.ModifyPushConfigRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ModifyPushConfigRequest(); + } + + public static com.google.pubsub.v1.ModifyPushConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + java.lang.String getSubscription(); + /** + *
optional string subscription = 1;
+ *
+ * + * The name of the subscription. + *+ */ + com.google.protobuf.ByteString + getSubscriptionBytes(); + + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + boolean hasPushConfig(); + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + com.google.pubsub.v1.PushConfig getPushConfig(); + /** + *
optional .google.pubsub.v1.PushConfig push_config = 2;
+ *
+ * + * The push configuration for future deliveries. + * An empty pushConfig indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if Pull is not called. + *+ */ + com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishRequest.java new file mode 100644 index 000000000000..b68d33924dd0 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishRequest.java @@ -0,0 +1,909 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.PublishRequest} + * + *
+ * Request for the Publish method. + *+ */ +public final class PublishRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.PublishRequest) + PublishRequestOrBuilder { + // Use PublishRequest.newBuilder() to construct. + private PublishRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private PublishRequest() { + topic_ = ""; + messages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private PublishRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = new java.util.ArrayList
optional string topic = 1;
+ *
+ * + * The messages in the request will be published on this topic. + *+ */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * The messages in the request will be published on this topic. + *+ */ + 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 MESSAGES_FIELD_NUMBER = 2; + private java.util.List
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public java.util.List
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public java.util.List extends com.google.pubsub.v1.PubsubMessageOrBuilder> + getMessagesOrBuilderList() { + return messages_; + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public int getMessagesCount() { + return messages_.size(); + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public com.google.pubsub.v1.PubsubMessage getMessages(int index) { + return messages_.get(index); + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public com.google.pubsub.v1.PubsubMessageOrBuilder getMessagesOrBuilder( + int index) { + return messages_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, topic_); + } + for (int i = 0; i < messages_.size(); i++) { + output.writeMessage(2, messages_.get(i)); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, topic_); + } + for (int i = 0; i < messages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, messages_.get(i)); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.PublishRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PublishRequest 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.PublishRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PublishRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.PublishRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PublishRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.PublishRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.PublishRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.PublishRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PublishRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.PublishRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.PublishRequest} + * + *
+ * Request for the Publish method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string topic = 1;
+ *
+ * + * The messages in the request will be published on this topic. + *+ */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * The messages in the request will be published on this topic. + *+ */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string topic = 1;
+ *
+ * + * The messages in the request will be published on this topic. + *+ */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + *
optional string topic = 1;
+ *
+ * + * The messages in the request will be published on this topic. + *+ */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + *
optional string topic = 1;
+ *
+ * + * The messages in the request will be published on this topic. + *+ */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + + private java.util.List
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public java.util.List
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public int getMessagesCount() { + if (messagesBuilder_ == null) { + return messages_.size(); + } else { + return messagesBuilder_.getCount(); + } + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public com.google.pubsub.v1.PubsubMessage getMessages(int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessage(index); + } + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public Builder setMessages( + int index, com.google.pubsub.v1.PubsubMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + } else { + messagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public Builder setMessages( + int index, com.google.pubsub.v1.PubsubMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.set(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public Builder addMessages(com.google.pubsub.v1.PubsubMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + } else { + messagesBuilder_.addMessage(value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public Builder addMessages( + int index, com.google.pubsub.v1.PubsubMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(index, value); + onChanged(); + } else { + messagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public Builder addMessages( + com.google.pubsub.v1.PubsubMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public Builder addMessages( + int index, com.google.pubsub.v1.PubsubMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public Builder addAllMessages( + java.lang.Iterable extends com.google.pubsub.v1.PubsubMessage> values) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, messages_); + onChanged(); + } else { + messagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public Builder clearMessages() { + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + messagesBuilder_.clear(); + } + return this; + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public Builder removeMessages(int index) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.remove(index); + onChanged(); + } else { + messagesBuilder_.remove(index); + } + return this; + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public com.google.pubsub.v1.PubsubMessage.Builder getMessagesBuilder( + int index) { + return getMessagesFieldBuilder().getBuilder(index); + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public com.google.pubsub.v1.PubsubMessageOrBuilder getMessagesOrBuilder( + int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); } else { + return messagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public java.util.List extends com.google.pubsub.v1.PubsubMessageOrBuilder> + getMessagesOrBuilderList() { + if (messagesBuilder_ != null) { + return messagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(messages_); + } + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public com.google.pubsub.v1.PubsubMessage.Builder addMessagesBuilder() { + return getMessagesFieldBuilder().addBuilder( + com.google.pubsub.v1.PubsubMessage.getDefaultInstance()); + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public com.google.pubsub.v1.PubsubMessage.Builder addMessagesBuilder( + int index) { + return getMessagesFieldBuilder().addBuilder( + index, com.google.pubsub.v1.PubsubMessage.getDefaultInstance()); + } + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + public java.util.List
optional string topic = 1;
+ *
+ * + * The messages in the request will be published on this topic. + *+ */ + java.lang.String getTopic(); + /** + *
optional string topic = 1;
+ *
+ * + * The messages in the request will be published on this topic. + *+ */ + com.google.protobuf.ByteString + getTopicBytes(); + + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + java.util.List
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + com.google.pubsub.v1.PubsubMessage getMessages(int index); + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + int getMessagesCount(); + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + java.util.List extends com.google.pubsub.v1.PubsubMessageOrBuilder> + getMessagesOrBuilderList(); + /** + *
repeated .google.pubsub.v1.PubsubMessage messages = 2;
+ *
+ * + * The messages to publish. + *+ */ + com.google.pubsub.v1.PubsubMessageOrBuilder getMessagesOrBuilder( + int index); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishResponse.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishResponse.java new file mode 100644 index 000000000000..9a7a30834bce --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishResponse.java @@ -0,0 +1,569 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.PublishResponse} + * + *
+ * Response for the Publish method. + *+ */ +public final class PublishResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.PublishResponse) + PublishResponseOrBuilder { + // Use PublishResponse.newBuilder() to construct. + private PublishResponse(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private PublishResponse() { + messageIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private PublishResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + messageIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + messageIds_.add(s); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + messageIds_ = messageIds_.getUnmodifiableView(); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PublishResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PublishResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.PublishResponse.class, com.google.pubsub.v1.PublishResponse.Builder.class); + } + + public static final int MESSAGE_IDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList messageIds_; + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public com.google.protobuf.ProtocolStringList + getMessageIdsList() { + return messageIds_; + } + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public int getMessageIdsCount() { + return messageIds_.size(); + } + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public java.lang.String getMessageIds(int index) { + return messageIds_.get(index); + } + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public com.google.protobuf.ByteString + getMessageIdsBytes(int index) { + return messageIds_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < messageIds_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, messageIds_.getRaw(i)); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < messageIds_.size(); i++) { + dataSize += computeStringSizeNoTag(messageIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getMessageIdsList().size(); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.PublishResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PublishResponse 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.PublishResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PublishResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.PublishResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PublishResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.PublishResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.PublishResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.PublishResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PublishResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.PublishResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.PublishResponse} + * + *
+ * Response for the Publish method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public com.google.protobuf.ProtocolStringList + getMessageIdsList() { + return messageIds_.getUnmodifiableView(); + } + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public int getMessageIdsCount() { + return messageIds_.size(); + } + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public java.lang.String getMessageIds(int index) { + return messageIds_.get(index); + } + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public com.google.protobuf.ByteString + getMessageIdsBytes(int index) { + return messageIds_.getByteString(index); + } + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public Builder setMessageIds( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessageIdsIsMutable(); + messageIds_.set(index, value); + onChanged(); + return this; + } + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public Builder addMessageIds( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessageIdsIsMutable(); + messageIds_.add(value); + onChanged(); + return this; + } + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public Builder addAllMessageIds( + java.lang.Iterable
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public Builder clearMessageIds() { + messageIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + public Builder addMessageIdsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMessageIdsIsMutable(); + messageIds_.add(value); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.PublishResponse) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.PublishResponse) + private static final com.google.pubsub.v1.PublishResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.PublishResponse(); + } + + public static com.google.pubsub.v1.PublishResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + com.google.protobuf.ProtocolStringList + getMessageIdsList(); + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + int getMessageIdsCount(); + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + java.lang.String getMessageIds(int index); + /** + *
repeated string message_ids = 1;
+ *
+ * + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within + * the topic. + *+ */ + com.google.protobuf.ByteString + getMessageIdsBytes(int index); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublisherGrpc.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublisherGrpc.java new file mode 100644 index 000000000000..a2c47fcdeb01 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublisherGrpc.java @@ -0,0 +1,406 @@ +package com.google.pubsub.v1; + +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; + +@javax.annotation.Generated("by gRPC proto compiler") +public class PublisherGrpc { + + private PublisherGrpc() {} + + public static final String SERVICE_NAME = "google.pubsub.v1.Publisher"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor
+ * A message data and its attributes. The message payload must not be empty; + * it must contain either a non-empty data field, or at least one attribute. + *+ */ +public final class PubsubMessage extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.PubsubMessage) + PubsubMessageOrBuilder { + // Use PubsubMessage.newBuilder() to construct. + private PubsubMessage(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private PubsubMessage() { + data_ = com.google.protobuf.ByteString.EMPTY; + messageId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private PubsubMessage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + + data_ = input.readBytes(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry
optional bytes data = 1;
+ *
+ * + * The message payload. For JSON requests, the value of this field must be + * base64-encoded. + *+ */ + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 2; + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .
map<string, string> attributes = 2;
+ *
+ * + * Optional attributes for this message. + *+ */ + + public java.util.Map
optional string message_id = 3;
+ *
+ * + * ID of this message assigned by the server at publication time. Guaranteed + * to be unique within the topic. This value may be read by a subscriber + * that receives a PubsubMessage via a Pull call or a push delivery. It must + * not be populated by a publisher in a Publish call. + *+ */ + public java.lang.String getMessageId() { + java.lang.Object ref = messageId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + messageId_ = s; + return s; + } + } + /** + *
optional string message_id = 3;
+ *
+ * + * ID of this message assigned by the server at publication time. Guaranteed + * to be unique within the topic. This value may be read by a subscriber + * that receives a PubsubMessage via a Pull call or a push delivery. It must + * not be populated by a publisher in a Publish call. + *+ */ + public com.google.protobuf.ByteString + getMessageIdBytes() { + java.lang.Object ref = messageId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + messageId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!data_.isEmpty()) { + output.writeBytes(1, data_); + } + for (java.util.Map.Entry
+ * A message data and its attributes. The message payload must not be empty; + * it must contain either a non-empty data field, or at least one attribute. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional bytes data = 1;
+ *
+ * + * The message payload. For JSON requests, the value of this field must be + * base64-encoded. + *+ */ + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
optional bytes data = 1;
+ *
+ * + * The message payload. For JSON requests, the value of this field must be + * base64-encoded. + *+ */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
optional bytes data = 1;
+ *
+ * + * The message payload. For JSON requests, the value of this field must be + * base64-encoded. + *+ */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField
map<string, string> attributes = 2;
+ *
+ * + * Optional attributes for this message. + *+ */ + public java.util.Map
map<string, string> attributes = 2;
+ *
+ * + * Optional attributes for this message. + *+ */ + public java.util.Map
map<string, string> attributes = 2;
+ *
+ * + * Optional attributes for this message. + *+ */ + public Builder putAllAttributes( + java.util.Map
optional string message_id = 3;
+ *
+ * + * ID of this message assigned by the server at publication time. Guaranteed + * to be unique within the topic. This value may be read by a subscriber + * that receives a PubsubMessage via a Pull call or a push delivery. It must + * not be populated by a publisher in a Publish call. + *+ */ + public java.lang.String getMessageId() { + java.lang.Object ref = messageId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + messageId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string message_id = 3;
+ *
+ * + * ID of this message assigned by the server at publication time. Guaranteed + * to be unique within the topic. This value may be read by a subscriber + * that receives a PubsubMessage via a Pull call or a push delivery. It must + * not be populated by a publisher in a Publish call. + *+ */ + public com.google.protobuf.ByteString + getMessageIdBytes() { + java.lang.Object ref = messageId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + messageId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string message_id = 3;
+ *
+ * + * ID of this message assigned by the server at publication time. Guaranteed + * to be unique within the topic. This value may be read by a subscriber + * that receives a PubsubMessage via a Pull call or a push delivery. It must + * not be populated by a publisher in a Publish call. + *+ */ + public Builder setMessageId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + messageId_ = value; + onChanged(); + return this; + } + /** + *
optional string message_id = 3;
+ *
+ * + * ID of this message assigned by the server at publication time. Guaranteed + * to be unique within the topic. This value may be read by a subscriber + * that receives a PubsubMessage via a Pull call or a push delivery. It must + * not be populated by a publisher in a Publish call. + *+ */ + public Builder clearMessageId() { + + messageId_ = getDefaultInstance().getMessageId(); + onChanged(); + return this; + } + /** + *
optional string message_id = 3;
+ *
+ * + * ID of this message assigned by the server at publication time. Guaranteed + * to be unique within the topic. This value may be read by a subscriber + * that receives a PubsubMessage via a Pull call or a push delivery. It must + * not be populated by a publisher in a Publish call. + *+ */ + public Builder setMessageIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + messageId_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.PubsubMessage) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.PubsubMessage) + private static final com.google.pubsub.v1.PubsubMessage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.PubsubMessage(); + } + + public static com.google.pubsub.v1.PubsubMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional bytes data = 1;
+ *
+ * + * The message payload. For JSON requests, the value of this field must be + * base64-encoded. + *+ */ + com.google.protobuf.ByteString getData(); + + /** + *
map<string, string> attributes = 2;
+ *
+ * + * Optional attributes for this message. + *+ */ + java.util.Map
optional string message_id = 3;
+ *
+ * + * ID of this message assigned by the server at publication time. Guaranteed + * to be unique within the topic. This value may be read by a subscriber + * that receives a PubsubMessage via a Pull call or a push delivery. It must + * not be populated by a publisher in a Publish call. + *+ */ + java.lang.String getMessageId(); + /** + *
optional string message_id = 3;
+ *
+ * + * ID of this message assigned by the server at publication time. Guaranteed + * to be unique within the topic. This value may be read by a subscriber + * that receives a PubsubMessage via a Pull call or a push delivery. It must + * not be populated by a publisher in a Publish call. + *+ */ + com.google.protobuf.ByteString + getMessageIdBytes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubProto.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubProto.java new file mode 100644 index 000000000000..197384a867d9 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubProto.java @@ -0,0 +1,409 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public final class PubsubProto { + private PubsubProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_Topic_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_Topic_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_PubsubMessage_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_GetTopicRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_GetTopicRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_PublishRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_PublishRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_PublishResponse_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_PublishResponse_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ListTopicsRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_ListTopicsRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ListTopicsResponse_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_ListTopicsResponse_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_DeleteTopicRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_Subscription_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_Subscription_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_PushConfig_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_PushConfig_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_PushConfig_AttributesEntry_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_PushConfig_AttributesEntry_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ReceivedMessage_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_ReceivedMessage_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_GetSubscriptionRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_ListSubscriptionsRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_ListSubscriptionsResponse_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_DeleteSubscriptionRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_ModifyPushConfigRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_PullRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_PullRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_PullResponse_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_PullResponse_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_fieldAccessorTable; + static com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor; + static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_pubsub_v1_AcknowledgeRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\035google/pubsub/v1/pubsub.proto\022\020google." + + "pubsub.v1\032\034google/api/annotations.proto\032" + + "\033google/protobuf/empty.proto\"\025\n\005Topic\022\014\n" + + "\004name\030\001 \001(\t\"\251\001\n\rPubsubMessage\022\014\n\004data\030\001 " + + "\001(\014\022C\n\nattributes\030\002 \003(\0132/.google.pubsub." + + "v1.PubsubMessage.AttributesEntry\022\022\n\nmess" + + "age_id\030\003 \001(\t\0321\n\017AttributesEntry\022\013\n\003key\030\001" + + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\" \n\017GetTopicReque" + + "st\022\r\n\005topic\030\001 \001(\t\"R\n\016PublishRequest\022\r\n\005t" + + "opic\030\001 \001(\t\0221\n\010messages\030\002 \003(\0132\037.google.pu", + "bsub.v1.PubsubMessage\"&\n\017PublishResponse" + + "\022\023\n\013message_ids\030\001 \003(\t\"K\n\021ListTopicsReque" + + "st\022\017\n\007project\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022" + + "\n\npage_token\030\003 \001(\t\"V\n\022ListTopicsResponse" + + "\022\'\n\006topics\030\001 \003(\0132\027.google.pubsub.v1.Topi" + + "c\022\027\n\017next_page_token\030\002 \001(\t\"U\n\035ListTopicS" + + "ubscriptionsRequest\022\r\n\005topic\030\001 \001(\t\022\021\n\tpa" + + "ge_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"P\n\036Lis" + + "tTopicSubscriptionsResponse\022\025\n\rsubscript" + + "ions\030\001 \003(\t\022\027\n\017next_page_token\030\002 \001(\t\"#\n\022D", + "eleteTopicRequest\022\r\n\005topic\030\001 \001(\t\"|\n\014Subs" + + "cription\022\014\n\004name\030\001 \001(\t\022\r\n\005topic\030\002 \001(\t\0221\n" + + "\013push_config\030\004 \001(\0132\034.google.pubsub.v1.Pu" + + "shConfig\022\034\n\024ack_deadline_seconds\030\005 \001(\005\"\230" + + "\001\n\nPushConfig\022\025\n\rpush_endpoint\030\001 \001(\t\022@\n\n" + + "attributes\030\002 \003(\0132,.google.pubsub.v1.Push" + + "Config.AttributesEntry\0321\n\017AttributesEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"S\n\017Rec" + + "eivedMessage\022\016\n\006ack_id\030\001 \001(\t\0220\n\007message\030" + + "\002 \001(\0132\037.google.pubsub.v1.PubsubMessage\".", + "\n\026GetSubscriptionRequest\022\024\n\014subscription" + + "\030\001 \001(\t\"R\n\030ListSubscriptionsRequest\022\017\n\007pr" + + "oject\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_t" + + "oken\030\003 \001(\t\"k\n\031ListSubscriptionsResponse\022" + + "5\n\rsubscriptions\030\001 \003(\0132\036.google.pubsub.v" + + "1.Subscription\022\027\n\017next_page_token\030\002 \001(\t\"" + + "1\n\031DeleteSubscriptionRequest\022\024\n\014subscrip" + + "tion\030\001 \001(\t\"b\n\027ModifyPushConfigRequest\022\024\n" + + "\014subscription\030\001 \001(\t\0221\n\013push_config\030\002 \001(\013" + + "2\034.google.pubsub.v1.PushConfig\"U\n\013PullRe", + "quest\022\024\n\014subscription\030\001 \001(\t\022\032\n\022return_im" + + "mediately\030\002 \001(\010\022\024\n\014max_messages\030\003 \001(\005\"L\n" + + "\014PullResponse\022<\n\021received_messages\030\001 \003(\013" + + "2!.google.pubsub.v1.ReceivedMessage\"_\n\030M" + + "odifyAckDeadlineRequest\022\024\n\014subscription\030" + + "\001 \001(\t\022\017\n\007ack_ids\030\004 \003(\t\022\034\n\024ack_deadline_s" + + "econds\030\003 \001(\005\";\n\022AcknowledgeRequest\022\024\n\014su" + + "bscription\030\001 \001(\t\022\017\n\007ack_ids\030\002 \003(\t2\300\t\n\nSu" + + "bscriber\022\206\001\n\022CreateSubscription\022\036.google" + + ".pubsub.v1.Subscription\032\036.google.pubsub.", + "v1.Subscription\"0\202\323\344\223\002*\032%/v1/{name=proje" + + "cts/*/subscriptions/*}:\001*\022\222\001\n\017GetSubscri" + + "ption\022(.google.pubsub.v1.GetSubscription" + + "Request\032\036.google.pubsub.v1.Subscription\"" + + "5\202\323\344\223\002/\022-/v1/{subscription=projects/*/su" + + "bscriptions/*}\022\234\001\n\021ListSubscriptions\022*.g" + + "oogle.pubsub.v1.ListSubscriptionsRequest" + + "\032+.google.pubsub.v1.ListSubscriptionsRes" + + "ponse\".\202\323\344\223\002(\022&/v1/{project=projects/*}/" + + "subscriptions\022\220\001\n\022DeleteSubscription\022+.g", + "oogle.pubsub.v1.DeleteSubscriptionReques" + + "t\032\026.google.protobuf.Empty\"5\202\323\344\223\002/*-/v1/{" + + "subscription=projects/*/subscriptions/*}" + + "\022\243\001\n\021ModifyAckDeadline\022*.google.pubsub.v" + + "1.ModifyAckDeadlineRequest\032\026.google.prot" + + "obuf.Empty\"J\202\323\344\223\002D\"?/v1/{subscription=pr" + + "ojects/*/subscriptions/*}:modifyAckDeadl" + + "ine:\001*\022\221\001\n\013Acknowledge\022$.google.pubsub.v" + + "1.AcknowledgeRequest\032\026.google.protobuf.E" + + "mpty\"D\202\323\344\223\002>\"9/v1/{subscription=projects", + "/*/subscriptions/*}:acknowledge:\001*\022\204\001\n\004P" + + "ull\022\035.google.pubsub.v1.PullRequest\032\036.goo" + + "gle.pubsub.v1.PullResponse\"=\202\323\344\223\0027\"2/v1/" + + "{subscription=projects/*/subscriptions/*" + + "}:pull:\001*\022\240\001\n\020ModifyPushConfig\022).google." + + "pubsub.v1.ModifyPushConfigRequest\032\026.goog" + + "le.protobuf.Empty\"I\202\323\344\223\002C\">/v1/{subscrip" + + "tion=projects/*/subscriptions/*}:modifyP" + + "ushConfig:\001*2\233\006\n\tPublisher\022j\n\013CreateTopi" + + "c\022\027.google.pubsub.v1.Topic\032\027.google.pubs", + "ub.v1.Topic\")\202\323\344\223\002#\032\036/v1/{name=projects/" + + "*/topics/*}:\001*\022\202\001\n\007Publish\022 .google.pubs" + + "ub.v1.PublishRequest\032!.google.pubsub.v1." + + "PublishResponse\"2\202\323\344\223\002,\"\'/v1/{topic=proj" + + "ects/*/topics/*}:publish:\001*\022o\n\010GetTopic\022" + + "!.google.pubsub.v1.GetTopicRequest\032\027.goo" + + "gle.pubsub.v1.Topic\"\'\202\323\344\223\002!\022\037/v1/{topic=" + + "projects/*/topics/*}\022\200\001\n\nListTopics\022#.go" + + "ogle.pubsub.v1.ListTopicsRequest\032$.googl" + + "e.pubsub.v1.ListTopicsResponse\"\'\202\323\344\223\002!\022\037", + "/v1/{project=projects/*}/topics\022\262\001\n\026List" + + "TopicSubscriptions\022/.google.pubsub.v1.Li" + + "stTopicSubscriptionsRequest\0320.google.pub" + + "sub.v1.ListTopicSubscriptionsResponse\"5\202" + + "\323\344\223\002/\022-/v1/{topic=projects/*/topics/*}/s" + + "ubscriptions\022t\n\013DeleteTopic\022$.google.pub" + + "sub.v1.DeleteTopicRequest\032\026.google.proto" + + "buf.Empty\"\'\202\323\344\223\002!*\037/v1/{topic=projects/*" + + "/topics/*}B%\n\024com.google.pubsub.v1B\013Pubs" + + "ubProtoP\001b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }, assigner); + internal_static_google_pubsub_v1_Topic_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_pubsub_v1_Topic_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_Topic_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_pubsub_v1_PubsubMessage_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_PubsubMessage_descriptor, + new java.lang.String[] { "Data", "Attributes", "MessageId", }); + internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_descriptor = + internal_static_google_pubsub_v1_PubsubMessage_descriptor.getNestedTypes().get(0); + internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_pubsub_v1_GetTopicRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_pubsub_v1_GetTopicRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_GetTopicRequest_descriptor, + new java.lang.String[] { "Topic", }); + internal_static_google_pubsub_v1_PublishRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_pubsub_v1_PublishRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_PublishRequest_descriptor, + new java.lang.String[] { "Topic", "Messages", }); + internal_static_google_pubsub_v1_PublishResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_pubsub_v1_PublishResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_PublishResponse_descriptor, + new java.lang.String[] { "MessageIds", }); + internal_static_google_pubsub_v1_ListTopicsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_pubsub_v1_ListTopicsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_ListTopicsRequest_descriptor, + new java.lang.String[] { "Project", "PageSize", "PageToken", }); + internal_static_google_pubsub_v1_ListTopicsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_pubsub_v1_ListTopicsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_ListTopicsResponse_descriptor, + new java.lang.String[] { "Topics", "NextPageToken", }); + internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor, + new java.lang.String[] { "Topic", "PageSize", "PageToken", }); + internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor, + new java.lang.String[] { "Subscriptions", "NextPageToken", }); + internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_pubsub_v1_DeleteTopicRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor, + new java.lang.String[] { "Topic", }); + internal_static_google_pubsub_v1_Subscription_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_pubsub_v1_Subscription_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_Subscription_descriptor, + new java.lang.String[] { "Name", "Topic", "PushConfig", "AckDeadlineSeconds", }); + internal_static_google_pubsub_v1_PushConfig_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_pubsub_v1_PushConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_PushConfig_descriptor, + new java.lang.String[] { "PushEndpoint", "Attributes", }); + internal_static_google_pubsub_v1_PushConfig_AttributesEntry_descriptor = + internal_static_google_pubsub_v1_PushConfig_descriptor.getNestedTypes().get(0); + internal_static_google_pubsub_v1_PushConfig_AttributesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_PushConfig_AttributesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_pubsub_v1_ReceivedMessage_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_pubsub_v1_ReceivedMessage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_ReceivedMessage_descriptor, + new java.lang.String[] { "AckId", "Message", }); + internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_pubsub_v1_GetSubscriptionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor, + new java.lang.String[] { "Subscription", }); + internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_pubsub_v1_ListSubscriptionsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor, + new java.lang.String[] { "Project", "PageSize", "PageToken", }); + internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_pubsub_v1_ListSubscriptionsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor, + new java.lang.String[] { "Subscriptions", "NextPageToken", }); + internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_pubsub_v1_DeleteSubscriptionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor, + new java.lang.String[] { "Subscription", }); + internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_pubsub_v1_ModifyPushConfigRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor, + new java.lang.String[] { "Subscription", "PushConfig", }); + internal_static_google_pubsub_v1_PullRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_pubsub_v1_PullRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_PullRequest_descriptor, + new java.lang.String[] { "Subscription", "ReturnImmediately", "MaxMessages", }); + internal_static_google_pubsub_v1_PullResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_pubsub_v1_PullResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_PullResponse_descriptor, + new java.lang.String[] { "ReceivedMessages", }); + internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor, + new java.lang.String[] { "Subscription", "AckIds", "AckDeadlineSeconds", }); + internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_pubsub_v1_AcknowledgeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor, + new java.lang.String[] { "Subscription", "AckIds", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullRequest.java new file mode 100644 index 000000000000..faab0adbe20d --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullRequest.java @@ -0,0 +1,636 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.PullRequest} + * + *
+ * Request for the Pull method. + *+ */ +public final class PullRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.PullRequest) + PullRequestOrBuilder { + // Use PullRequest.newBuilder() to construct. + private PullRequest(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private PullRequest() { + subscription_ = ""; + returnImmediately_ = false; + maxMessages_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private PullRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + subscription_ = s; + break; + } + case 16: { + + returnImmediately_ = input.readBool(); + break; + } + case 24: { + + maxMessages_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PullRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PullRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.PullRequest.class, com.google.pubsub.v1.PullRequest.Builder.class); + } + + public static final int SUBSCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object subscription_; + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription from which messages should be pulled. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription from which messages should be pulled. + *+ */ + 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; + } + } + + public static final int RETURN_IMMEDIATELY_FIELD_NUMBER = 2; + private boolean returnImmediately_; + /** + *
optional bool return_immediately = 2;
+ *
+ * + * If this is specified as true the system will respond immediately even if + * it is not able to return a message in the Pull response. Otherwise the + * system is allowed to wait until at least one message is available rather + * than returning no messages. The client may cancel the request if it does + * not wish to wait any longer for the response. + *+ */ + public boolean getReturnImmediately() { + return returnImmediately_; + } + + public static final int MAX_MESSAGES_FIELD_NUMBER = 3; + private int maxMessages_; + /** + *
optional int32 max_messages = 3;
+ *
+ * + * The maximum number of messages returned for this request. The Pub/Sub + * system may return fewer than the number specified. + *+ */ + public int getMaxMessages() { + return maxMessages_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSubscriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, subscription_); + } + if (returnImmediately_ != false) { + output.writeBool(2, returnImmediately_); + } + if (maxMessages_ != 0) { + output.writeInt32(3, maxMessages_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSubscriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, subscription_); + } + if (returnImmediately_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, returnImmediately_); + } + if (maxMessages_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, maxMessages_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.PullRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PullRequest 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.PullRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PullRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.PullRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PullRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.PullRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.PullRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.PullRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PullRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.PullRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.PullRequest} + * + *
+ * Request for the Pull method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string subscription = 1;
+ *
+ * + * The subscription from which messages should be pulled. + *+ */ + public java.lang.String getSubscription() { + java.lang.Object ref = subscription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subscription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription from which messages should be pulled. + *+ */ + public com.google.protobuf.ByteString + getSubscriptionBytes() { + java.lang.Object ref = subscription_; + if (ref instanceof 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; + } + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription from which messages should be pulled. + *+ */ + public Builder setSubscription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subscription_ = value; + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription from which messages should be pulled. + *+ */ + public Builder clearSubscription() { + + subscription_ = getDefaultInstance().getSubscription(); + onChanged(); + return this; + } + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription from which messages should be pulled. + *+ */ + public Builder setSubscriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subscription_ = value; + onChanged(); + return this; + } + + private boolean returnImmediately_ ; + /** + *
optional bool return_immediately = 2;
+ *
+ * + * If this is specified as true the system will respond immediately even if + * it is not able to return a message in the Pull response. Otherwise the + * system is allowed to wait until at least one message is available rather + * than returning no messages. The client may cancel the request if it does + * not wish to wait any longer for the response. + *+ */ + public boolean getReturnImmediately() { + return returnImmediately_; + } + /** + *
optional bool return_immediately = 2;
+ *
+ * + * If this is specified as true the system will respond immediately even if + * it is not able to return a message in the Pull response. Otherwise the + * system is allowed to wait until at least one message is available rather + * than returning no messages. The client may cancel the request if it does + * not wish to wait any longer for the response. + *+ */ + public Builder setReturnImmediately(boolean value) { + + returnImmediately_ = value; + onChanged(); + return this; + } + /** + *
optional bool return_immediately = 2;
+ *
+ * + * If this is specified as true the system will respond immediately even if + * it is not able to return a message in the Pull response. Otherwise the + * system is allowed to wait until at least one message is available rather + * than returning no messages. The client may cancel the request if it does + * not wish to wait any longer for the response. + *+ */ + public Builder clearReturnImmediately() { + + returnImmediately_ = false; + onChanged(); + return this; + } + + private int maxMessages_ ; + /** + *
optional int32 max_messages = 3;
+ *
+ * + * The maximum number of messages returned for this request. The Pub/Sub + * system may return fewer than the number specified. + *+ */ + public int getMaxMessages() { + return maxMessages_; + } + /** + *
optional int32 max_messages = 3;
+ *
+ * + * The maximum number of messages returned for this request. The Pub/Sub + * system may return fewer than the number specified. + *+ */ + public Builder setMaxMessages(int value) { + + maxMessages_ = value; + onChanged(); + return this; + } + /** + *
optional int32 max_messages = 3;
+ *
+ * + * The maximum number of messages returned for this request. The Pub/Sub + * system may return fewer than the number specified. + *+ */ + public Builder clearMaxMessages() { + + maxMessages_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.PullRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.PullRequest) + private static final com.google.pubsub.v1.PullRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.PullRequest(); + } + + public static com.google.pubsub.v1.PullRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string subscription = 1;
+ *
+ * + * The subscription from which messages should be pulled. + *+ */ + java.lang.String getSubscription(); + /** + *
optional string subscription = 1;
+ *
+ * + * The subscription from which messages should be pulled. + *+ */ + com.google.protobuf.ByteString + getSubscriptionBytes(); + + /** + *
optional bool return_immediately = 2;
+ *
+ * + * If this is specified as true the system will respond immediately even if + * it is not able to return a message in the Pull response. Otherwise the + * system is allowed to wait until at least one message is available rather + * than returning no messages. The client may cancel the request if it does + * not wish to wait any longer for the response. + *+ */ + boolean getReturnImmediately(); + + /** + *
optional int32 max_messages = 3;
+ *
+ * + * The maximum number of messages returned for this request. The Pub/Sub + * system may return fewer than the number specified. + *+ */ + int getMaxMessages(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullResponse.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullResponse.java new file mode 100644 index 000000000000..738e34b0137d --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullResponse.java @@ -0,0 +1,824 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.PullResponse} + * + *
+ * Response for the Pull method. + *+ */ +public final class PullResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.PullResponse) + PullResponseOrBuilder { + // Use PullResponse.newBuilder() to construct. + private PullResponse(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private PullResponse() { + receivedMessages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private PullResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + receivedMessages_ = new java.util.ArrayList
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public java.util.List
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public java.util.List extends com.google.pubsub.v1.ReceivedMessageOrBuilder> + getReceivedMessagesOrBuilderList() { + return receivedMessages_; + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public int getReceivedMessagesCount() { + return receivedMessages_.size(); + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public com.google.pubsub.v1.ReceivedMessage getReceivedMessages(int index) { + return receivedMessages_.get(index); + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public com.google.pubsub.v1.ReceivedMessageOrBuilder getReceivedMessagesOrBuilder( + int index) { + return receivedMessages_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < receivedMessages_.size(); i++) { + output.writeMessage(1, receivedMessages_.get(i)); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < receivedMessages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, receivedMessages_.get(i)); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.PullResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PullResponse 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.PullResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PullResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.PullResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PullResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.PullResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.PullResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.PullResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PullResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.PullResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.PullResponse} + * + *
+ * Response for the Pull method. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public java.util.List
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public int getReceivedMessagesCount() { + if (receivedMessagesBuilder_ == null) { + return receivedMessages_.size(); + } else { + return receivedMessagesBuilder_.getCount(); + } + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public com.google.pubsub.v1.ReceivedMessage getReceivedMessages(int index) { + if (receivedMessagesBuilder_ == null) { + return receivedMessages_.get(index); + } else { + return receivedMessagesBuilder_.getMessage(index); + } + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public Builder setReceivedMessages( + int index, com.google.pubsub.v1.ReceivedMessage value) { + if (receivedMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReceivedMessagesIsMutable(); + receivedMessages_.set(index, value); + onChanged(); + } else { + receivedMessagesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public Builder setReceivedMessages( + int index, com.google.pubsub.v1.ReceivedMessage.Builder builderForValue) { + if (receivedMessagesBuilder_ == null) { + ensureReceivedMessagesIsMutable(); + receivedMessages_.set(index, builderForValue.build()); + onChanged(); + } else { + receivedMessagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public Builder addReceivedMessages(com.google.pubsub.v1.ReceivedMessage value) { + if (receivedMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReceivedMessagesIsMutable(); + receivedMessages_.add(value); + onChanged(); + } else { + receivedMessagesBuilder_.addMessage(value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public Builder addReceivedMessages( + int index, com.google.pubsub.v1.ReceivedMessage value) { + if (receivedMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReceivedMessagesIsMutable(); + receivedMessages_.add(index, value); + onChanged(); + } else { + receivedMessagesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public Builder addReceivedMessages( + com.google.pubsub.v1.ReceivedMessage.Builder builderForValue) { + if (receivedMessagesBuilder_ == null) { + ensureReceivedMessagesIsMutable(); + receivedMessages_.add(builderForValue.build()); + onChanged(); + } else { + receivedMessagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public Builder addReceivedMessages( + int index, com.google.pubsub.v1.ReceivedMessage.Builder builderForValue) { + if (receivedMessagesBuilder_ == null) { + ensureReceivedMessagesIsMutable(); + receivedMessages_.add(index, builderForValue.build()); + onChanged(); + } else { + receivedMessagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public Builder addAllReceivedMessages( + java.lang.Iterable extends com.google.pubsub.v1.ReceivedMessage> values) { + if (receivedMessagesBuilder_ == null) { + ensureReceivedMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, receivedMessages_); + onChanged(); + } else { + receivedMessagesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public Builder clearReceivedMessages() { + if (receivedMessagesBuilder_ == null) { + receivedMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + receivedMessagesBuilder_.clear(); + } + return this; + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public Builder removeReceivedMessages(int index) { + if (receivedMessagesBuilder_ == null) { + ensureReceivedMessagesIsMutable(); + receivedMessages_.remove(index); + onChanged(); + } else { + receivedMessagesBuilder_.remove(index); + } + return this; + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public com.google.pubsub.v1.ReceivedMessage.Builder getReceivedMessagesBuilder( + int index) { + return getReceivedMessagesFieldBuilder().getBuilder(index); + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public com.google.pubsub.v1.ReceivedMessageOrBuilder getReceivedMessagesOrBuilder( + int index) { + if (receivedMessagesBuilder_ == null) { + return receivedMessages_.get(index); } else { + return receivedMessagesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public java.util.List extends com.google.pubsub.v1.ReceivedMessageOrBuilder> + getReceivedMessagesOrBuilderList() { + if (receivedMessagesBuilder_ != null) { + return receivedMessagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(receivedMessages_); + } + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public com.google.pubsub.v1.ReceivedMessage.Builder addReceivedMessagesBuilder() { + return getReceivedMessagesFieldBuilder().addBuilder( + com.google.pubsub.v1.ReceivedMessage.getDefaultInstance()); + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public com.google.pubsub.v1.ReceivedMessage.Builder addReceivedMessagesBuilder( + int index) { + return getReceivedMessagesFieldBuilder().addBuilder( + index, com.google.pubsub.v1.ReceivedMessage.getDefaultInstance()); + } + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + public java.util.List
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + java.util.List
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + com.google.pubsub.v1.ReceivedMessage getReceivedMessages(int index); + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + int getReceivedMessagesCount(); + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + java.util.List extends com.google.pubsub.v1.ReceivedMessageOrBuilder> + getReceivedMessagesOrBuilderList(); + /** + *
repeated .google.pubsub.v1.ReceivedMessage received_messages = 1;
+ *
+ * + * Received Pub/Sub messages. The Pub/Sub system will return zero messages if + * there are no more available in the backlog. The Pub/Sub system may return + * fewer than the maxMessages requested even if there are more messages + * available in the backlog. + *+ */ + com.google.pubsub.v1.ReceivedMessageOrBuilder getReceivedMessagesOrBuilder( + int index); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PushConfig.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PushConfig.java new file mode 100644 index 000000000000..fc8c34dc5be5 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PushConfig.java @@ -0,0 +1,711 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * Protobuf type {@code google.pubsub.v1.PushConfig} + * + *
+ * Configuration for a push delivery endpoint. + *+ */ +public final class PushConfig extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.PushConfig) + PushConfigOrBuilder { + // Use PushConfig.newBuilder() to construct. + private PushConfig(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private PushConfig() { + pushEndpoint_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private PushConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + pushEndpoint_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry
optional string push_endpoint = 1;
+ *
+ * + * A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use "https://example.com/push". + *+ */ + public java.lang.String getPushEndpoint() { + java.lang.Object ref = pushEndpoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pushEndpoint_ = s; + return s; + } + } + /** + *
optional string push_endpoint = 1;
+ *
+ * + * A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use "https://example.com/push". + *+ */ + public com.google.protobuf.ByteString + getPushEndpointBytes() { + java.lang.Object ref = pushEndpoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pushEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 2; + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .
map<string, string> attributes = 2;
+ *
+ * + * Endpoint configuration attributes. + * Every endpoint has a set of API supported attributes that can be used to + * control different aspects of the message delivery. + * The currently supported attribute is `x-goog-version`, which you can + * use to change the format of the push message. This attribute + * indicates the version of the data expected by the endpoint. This + * controls the shape of the envelope (i.e. its fields and metadata). + * The endpoint version is based on the version of the Pub/Sub + * API. + * If not present during the CreateSubscription call, it will default to + * the version of the API used to make such call. If not present during a + * ModifyPushConfig call, its value will not be changed. GetSubscription + * calls will always return a valid version, even if the subscription was + * created without this attribute. + * The possible values for this attribute are: + * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + *+ */ + + public java.util.Map
+ * Configuration for a push delivery endpoint. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string push_endpoint = 1;
+ *
+ * + * A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use "https://example.com/push". + *+ */ + public java.lang.String getPushEndpoint() { + java.lang.Object ref = pushEndpoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pushEndpoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string push_endpoint = 1;
+ *
+ * + * A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use "https://example.com/push". + *+ */ + public com.google.protobuf.ByteString + getPushEndpointBytes() { + java.lang.Object ref = pushEndpoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pushEndpoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string push_endpoint = 1;
+ *
+ * + * A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use "https://example.com/push". + *+ */ + public Builder setPushEndpoint( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pushEndpoint_ = value; + onChanged(); + return this; + } + /** + *
optional string push_endpoint = 1;
+ *
+ * + * A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use "https://example.com/push". + *+ */ + public Builder clearPushEndpoint() { + + pushEndpoint_ = getDefaultInstance().getPushEndpoint(); + onChanged(); + return this; + } + /** + *
optional string push_endpoint = 1;
+ *
+ * + * A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use "https://example.com/push". + *+ */ + public Builder setPushEndpointBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pushEndpoint_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField
map<string, string> attributes = 2;
+ *
+ * + * Endpoint configuration attributes. + * Every endpoint has a set of API supported attributes that can be used to + * control different aspects of the message delivery. + * The currently supported attribute is `x-goog-version`, which you can + * use to change the format of the push message. This attribute + * indicates the version of the data expected by the endpoint. This + * controls the shape of the envelope (i.e. its fields and metadata). + * The endpoint version is based on the version of the Pub/Sub + * API. + * If not present during the CreateSubscription call, it will default to + * the version of the API used to make such call. If not present during a + * ModifyPushConfig call, its value will not be changed. GetSubscription + * calls will always return a valid version, even if the subscription was + * created without this attribute. + * The possible values for this attribute are: + * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + *+ */ + public java.util.Map
map<string, string> attributes = 2;
+ *
+ * + * Endpoint configuration attributes. + * Every endpoint has a set of API supported attributes that can be used to + * control different aspects of the message delivery. + * The currently supported attribute is `x-goog-version`, which you can + * use to change the format of the push message. This attribute + * indicates the version of the data expected by the endpoint. This + * controls the shape of the envelope (i.e. its fields and metadata). + * The endpoint version is based on the version of the Pub/Sub + * API. + * If not present during the CreateSubscription call, it will default to + * the version of the API used to make such call. If not present during a + * ModifyPushConfig call, its value will not be changed. GetSubscription + * calls will always return a valid version, even if the subscription was + * created without this attribute. + * The possible values for this attribute are: + * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + *+ */ + public java.util.Map
map<string, string> attributes = 2;
+ *
+ * + * Endpoint configuration attributes. + * Every endpoint has a set of API supported attributes that can be used to + * control different aspects of the message delivery. + * The currently supported attribute is `x-goog-version`, which you can + * use to change the format of the push message. This attribute + * indicates the version of the data expected by the endpoint. This + * controls the shape of the envelope (i.e. its fields and metadata). + * The endpoint version is based on the version of the Pub/Sub + * API. + * If not present during the CreateSubscription call, it will default to + * the version of the API used to make such call. If not present during a + * ModifyPushConfig call, its value will not be changed. GetSubscription + * calls will always return a valid version, even if the subscription was + * created without this attribute. + * The possible values for this attribute are: + * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + *+ */ + public Builder putAllAttributes( + java.util.Map
optional string push_endpoint = 1;
+ *
+ * + * A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use "https://example.com/push". + *+ */ + java.lang.String getPushEndpoint(); + /** + *
optional string push_endpoint = 1;
+ *
+ * + * A URL locating the endpoint to which messages should be pushed. + * For example, a Webhook endpoint might use "https://example.com/push". + *+ */ + com.google.protobuf.ByteString + getPushEndpointBytes(); + + /** + *
map<string, string> attributes = 2;
+ *
+ * + * Endpoint configuration attributes. + * Every endpoint has a set of API supported attributes that can be used to + * control different aspects of the message delivery. + * The currently supported attribute is `x-goog-version`, which you can + * use to change the format of the push message. This attribute + * indicates the version of the data expected by the endpoint. This + * controls the shape of the envelope (i.e. its fields and metadata). + * The endpoint version is based on the version of the Pub/Sub + * API. + * If not present during the CreateSubscription call, it will default to + * the version of the API used to make such call. If not present during a + * ModifyPushConfig call, its value will not be changed. GetSubscription + * calls will always return a valid version, even if the subscription was + * created without this attribute. + * The possible values for this attribute are: + * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + *+ */ + java.util.Map
+ * A message and its corresponding acknowledgment ID. + *+ */ +public final class ReceivedMessage extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ReceivedMessage) + ReceivedMessageOrBuilder { + // Use ReceivedMessage.newBuilder() to construct. + private ReceivedMessage(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private ReceivedMessage() { + ackId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private ReceivedMessage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + ackId_ = s; + break; + } + case 18: { + com.google.pubsub.v1.PubsubMessage.Builder subBuilder = null; + if (message_ != null) { + subBuilder = message_.toBuilder(); + } + message_ = input.readMessage(com.google.pubsub.v1.PubsubMessage.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(message_); + message_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ReceivedMessage_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ReceivedMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ReceivedMessage.class, com.google.pubsub.v1.ReceivedMessage.Builder.class); + } + + public static final int ACK_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object ackId_; + /** + *
optional string ack_id = 1;
+ *
+ * + * This ID can be used to acknowledge the received message. + *+ */ + public java.lang.String getAckId() { + java.lang.Object ref = ackId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ackId_ = s; + return s; + } + } + /** + *
optional string ack_id = 1;
+ *
+ * + * This ID can be used to acknowledge the received message. + *+ */ + public com.google.protobuf.ByteString + getAckIdBytes() { + java.lang.Object ref = ackId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ackId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private com.google.pubsub.v1.PubsubMessage message_; + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public boolean hasMessage() { + return message_ != null; + } + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public com.google.pubsub.v1.PubsubMessage getMessage() { + return message_ == null ? com.google.pubsub.v1.PubsubMessage.getDefaultInstance() : message_; + } + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public com.google.pubsub.v1.PubsubMessageOrBuilder getMessageOrBuilder() { + return getMessage(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getAckIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, ackId_); + } + if (message_ != null) { + output.writeMessage(2, getMessage()); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAckIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, ackId_); + } + if (message_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getMessage()); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.ReceivedMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ReceivedMessage 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.ReceivedMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.ReceivedMessage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.ReceivedMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ReceivedMessage parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ReceivedMessage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.ReceivedMessage parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.ReceivedMessage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.ReceivedMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.ReceivedMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.ReceivedMessage} + * + *
+ * A message and its corresponding acknowledgment ID. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder
optional string ack_id = 1;
+ *
+ * + * This ID can be used to acknowledge the received message. + *+ */ + public java.lang.String getAckId() { + java.lang.Object ref = ackId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ackId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
optional string ack_id = 1;
+ *
+ * + * This ID can be used to acknowledge the received message. + *+ */ + public com.google.protobuf.ByteString + getAckIdBytes() { + java.lang.Object ref = ackId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ackId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
optional string ack_id = 1;
+ *
+ * + * This ID can be used to acknowledge the received message. + *+ */ + public Builder setAckId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ackId_ = value; + onChanged(); + return this; + } + /** + *
optional string ack_id = 1;
+ *
+ * + * This ID can be used to acknowledge the received message. + *+ */ + public Builder clearAckId() { + + ackId_ = getDefaultInstance().getAckId(); + onChanged(); + return this; + } + /** + *
optional string ack_id = 1;
+ *
+ * + * This ID can be used to acknowledge the received message. + *+ */ + public Builder setAckIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ackId_ = value; + onChanged(); + return this; + } + + private com.google.pubsub.v1.PubsubMessage message_ = null; + private com.google.protobuf.SingleFieldBuilder< + com.google.pubsub.v1.PubsubMessage, com.google.pubsub.v1.PubsubMessage.Builder, com.google.pubsub.v1.PubsubMessageOrBuilder> messageBuilder_; + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public boolean hasMessage() { + return messageBuilder_ != null || message_ != null; + } + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public com.google.pubsub.v1.PubsubMessage getMessage() { + if (messageBuilder_ == null) { + return message_ == null ? com.google.pubsub.v1.PubsubMessage.getDefaultInstance() : message_; + } else { + return messageBuilder_.getMessage(); + } + } + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public Builder setMessage(com.google.pubsub.v1.PubsubMessage value) { + if (messageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + messageBuilder_.setMessage(value); + } + + return this; + } + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public Builder setMessage( + com.google.pubsub.v1.PubsubMessage.Builder builderForValue) { + if (messageBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + messageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public Builder mergeMessage(com.google.pubsub.v1.PubsubMessage value) { + if (messageBuilder_ == null) { + if (message_ != null) { + message_ = + com.google.pubsub.v1.PubsubMessage.newBuilder(message_).mergeFrom(value).buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + messageBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public Builder clearMessage() { + if (messageBuilder_ == null) { + message_ = null; + onChanged(); + } else { + message_ = null; + messageBuilder_ = null; + } + + return this; + } + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public com.google.pubsub.v1.PubsubMessage.Builder getMessageBuilder() { + + onChanged(); + return getMessageFieldBuilder().getBuilder(); + } + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + public com.google.pubsub.v1.PubsubMessageOrBuilder getMessageOrBuilder() { + if (messageBuilder_ != null) { + return messageBuilder_.getMessageOrBuilder(); + } else { + return message_ == null ? + com.google.pubsub.v1.PubsubMessage.getDefaultInstance() : message_; + } + } + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + private com.google.protobuf.SingleFieldBuilder< + com.google.pubsub.v1.PubsubMessage, com.google.pubsub.v1.PubsubMessage.Builder, com.google.pubsub.v1.PubsubMessageOrBuilder> + getMessageFieldBuilder() { + if (messageBuilder_ == null) { + messageBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.pubsub.v1.PubsubMessage, com.google.pubsub.v1.PubsubMessage.Builder, com.google.pubsub.v1.PubsubMessageOrBuilder>( + getMessage(), + getParentForChildren(), + isClean()); + message_ = null; + } + return messageBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ReceivedMessage) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ReceivedMessage) + private static final com.google.pubsub.v1.ReceivedMessage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ReceivedMessage(); + } + + public static com.google.pubsub.v1.ReceivedMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
optional string ack_id = 1;
+ *
+ * + * This ID can be used to acknowledge the received message. + *+ */ + java.lang.String getAckId(); + /** + *
optional string ack_id = 1;
+ *
+ * + * This ID can be used to acknowledge the received message. + *+ */ + com.google.protobuf.ByteString + getAckIdBytes(); + + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + boolean hasMessage(); + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + com.google.pubsub.v1.PubsubMessage getMessage(); + /** + *
optional .google.pubsub.v1.PubsubMessage message = 2;
+ *
+ * + * The message. + *+ */ + com.google.pubsub.v1.PubsubMessageOrBuilder getMessageOrBuilder(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java new file mode 100644 index 000000000000..32c81fe096a5 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java @@ -0,0 +1,506 @@ +package com.google.pubsub.v1; + +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; + +@javax.annotation.Generated("by gRPC proto compiler") +public class SubscriberGrpc { + + private SubscriberGrpc() {} + + public static final String SERVICE_NAME = "google.pubsub.v1.Subscriber"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor
+ * A subscription resource. + *+ */ +public final class Subscription extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.Subscription) + SubscriptionOrBuilder { + // Use Subscription.newBuilder() to construct. + private Subscription(com.google.protobuf.GeneratedMessage.Builder> builder) { + super(builder); + } + private Subscription() { + name_ = ""; + topic_ = ""; + ackDeadlineSeconds_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Subscription( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + case 34: { + com.google.pubsub.v1.PushConfig.Builder subBuilder = null; + if (pushConfig_ != null) { + subBuilder = pushConfig_.toBuilder(); + } + pushConfig_ = input.readMessage(com.google.pubsub.v1.PushConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(pushConfig_); + pushConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 40: { + + ackDeadlineSeconds_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw new RuntimeException(e.setUnfinishedMessage(this)); + } catch (java.io.IOException e) { + throw new RuntimeException( + new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this)); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Subscription_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Subscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.Subscription.class, com.google.pubsub.v1.Subscription.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
optional string name = 1;
+ *
+ * + * 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"`. + *+ */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
optional string name = 1;
+ *
+ * + * 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"`. + *+ */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOPIC_FIELD_NUMBER = 2; + private volatile java.lang.Object topic_; + /** + *
optional string topic = 2;
+ *
+ * + * The name of the topic from which this subscription is receiving messages. + * The value of this field will be `_deleted-topic_` if the topic has been + * deleted. + *+ */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } + } + /** + *
optional string topic = 2;
+ *
+ * + * The name of the topic from which this subscription is receiving messages. + * The value of this field will be `_deleted-topic_` if the topic has been + * deleted. + *+ */ + 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 .google.pubsub.v1.PushConfig push_config = 4;
+ *
+ * + * If push delivery is used with this subscription, this field is + * used to configure it. An empty pushConfig signifies that the subscriber + * will pull and ack messages using API methods. + *+ */ + public boolean hasPushConfig() { + return pushConfig_ != null; + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 4;
+ *
+ * + * If push delivery is used with this subscription, this field is + * used to configure it. An empty pushConfig signifies that the subscriber + * will pull and ack messages using API methods. + *+ */ + public com.google.pubsub.v1.PushConfig getPushConfig() { + return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; + } + /** + *
optional .google.pubsub.v1.PushConfig push_config = 4;
+ *
+ * + * If push delivery is used with this subscription, this field is + * used to configure it. An empty pushConfig signifies that the subscriber + * will pull and ack messages using API methods. + *+ */ + public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() { + return getPushConfig(); + } + + public static final int ACK_DEADLINE_SECONDS_FIELD_NUMBER = 5; + private int ackDeadlineSeconds_; + /** + *
optional int32 ack_deadline_seconds = 5;
+ *
+ * + * This value is the maximum time after a subscriber receives a message + * before the subscriber should acknowledge the message. After message + * delivery but before the ack deadline expires and before the message is + * acknowledged, it is an outstanding message and will not be delivered + * again during that time (on a best-effort basis). + * For pull delivery 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. + * For push delivery, this value is also used to set the request timeout for + * the call to the push endpoint. + * If the subscriber never acknowledges the message, the Pub/Sub + * system will eventually redeliver the message. + * If this parameter is not set, the default value of 10 seconds is used. + *+ */ + public int getAckDeadlineSeconds() { + return ackDeadlineSeconds_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, topic_); + } + if (pushConfig_ != null) { + output.writeMessage(4, getPushConfig()); + } + if (ackDeadlineSeconds_ != 0) { + output.writeInt32(5, ackDeadlineSeconds_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, topic_); + } + if (pushConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getPushConfig()); + } + if (ackDeadlineSeconds_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, ackDeadlineSeconds_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.Subscription parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.Subscription parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.Subscription parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.Subscription parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.Subscription parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.Subscription parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.Subscription parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.Subscription parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.pubsub.v1.Subscription parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.Subscription parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.pubsub.v1.Subscription prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code google.pubsub.v1.Subscription} + * + *
+ * A subscription resource. + *+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder