From 12551897807a59690cf1b59b09257dc85bd41dd3 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Wed, 4 Nov 2015 11:41:39 -0800 Subject: [PATCH 1/2] Initial submission of generated pubsub protobuf classes --- gcloud-java-pubsub/README.md | 25 + .../google/pubsub/v1/AcknowledgeRequest.java | 710 +++++++++++ .../v1/AcknowledgeRequestOrBuilder.java | 66 ++ .../pubsub/v1/DeleteSubscriptionRequest.java | 476 ++++++++ .../DeleteSubscriptionRequestOrBuilder.java | 27 + .../google/pubsub/v1/DeleteTopicRequest.java | 476 ++++++++ .../v1/DeleteTopicRequestOrBuilder.java | 27 + .../pubsub/v1/GetSubscriptionRequest.java | 476 ++++++++ .../v1/GetSubscriptionRequestOrBuilder.java | 27 + .../com/google/pubsub/v1/GetTopicRequest.java | 476 ++++++++ .../pubsub/v1/GetTopicRequestOrBuilder.java | 27 + .../pubsub/v1/ListSubscriptionsRequest.java | 711 +++++++++++ .../v1/ListSubscriptionsRequestOrBuilder.java | 58 + .../pubsub/v1/ListSubscriptionsResponse.java | 923 +++++++++++++++ .../ListSubscriptionsResponseOrBuilder.java | 75 ++ .../v1/ListTopicSubscriptionsRequest.java | 711 +++++++++++ ...istTopicSubscriptionsRequestOrBuilder.java | 58 + .../v1/ListTopicSubscriptionsResponse.java | 711 +++++++++++ ...stTopicSubscriptionsResponseOrBuilder.java | 66 ++ .../google/pubsub/v1/ListTopicsRequest.java | 711 +++++++++++ .../pubsub/v1/ListTopicsRequestOrBuilder.java | 58 + .../google/pubsub/v1/ListTopicsResponse.java | 916 +++++++++++++++ .../v1/ListTopicsResponseOrBuilder.java | 73 ++ .../pubsub/v1/ModifyAckDeadlineRequest.java | 783 +++++++++++++ .../v1/ModifyAckDeadlineRequestOrBuilder.java | 75 ++ .../pubsub/v1/ModifyPushConfigRequest.java | 744 ++++++++++++ .../v1/ModifyPushConfigRequestOrBuilder.java | 64 + .../com/google/pubsub/v1/PublishRequest.java | 909 +++++++++++++++ .../pubsub/v1/PublishRequestOrBuilder.java | 71 ++ .../com/google/pubsub/v1/PublishResponse.java | 569 +++++++++ .../pubsub/v1/PublishResponseOrBuilder.java | 52 + .../com/google/pubsub/v1/PublisherGrpc.java | 406 +++++++ .../com/google/pubsub/v1/PubsubMessage.java | 740 ++++++++++++ .../pubsub/v1/PubsubMessageOrBuilder.java | 53 + .../com/google/pubsub/v1/PubsubProto.java | 409 +++++++ .../com/google/pubsub/v1/PullRequest.java | 636 ++++++++++ .../pubsub/v1/PullRequestOrBuilder.java | 50 + .../com/google/pubsub/v1/PullResponse.java | 824 +++++++++++++ .../pubsub/v1/PullResponseOrBuilder.java | 68 ++ .../java/com/google/pubsub/v1/PushConfig.java | 711 +++++++++++ .../google/pubsub/v1/PushConfigOrBuilder.java | 55 + .../com/google/pubsub/v1/ReceivedMessage.java | 696 +++++++++++ .../pubsub/v1/ReceivedMessageOrBuilder.java | 52 + .../com/google/pubsub/v1/SubscriberGrpc.java | 506 ++++++++ .../com/google/pubsub/v1/Subscription.java | 1038 +++++++++++++++++ .../pubsub/v1/SubscriptionOrBuilder.java | 111 ++ .../main/java/com/google/pubsub/v1/Topic.java | 511 ++++++++ .../com/google/pubsub/v1/TopicOrBuilder.java | 37 + gcloud-java-pubsub/pom.xml | 56 + 49 files changed, 18110 insertions(+) create mode 100644 gcloud-java-pubsub/README.md create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/AcknowledgeRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteTopicRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetSubscriptionRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetTopicRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetTopicRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponse.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponseOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponse.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponseOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsResponse.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsResponseOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishResponse.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishResponseOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublisherGrpc.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubMessage.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubMessageOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubProto.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullRequest.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullRequestOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullResponse.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullResponseOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PushConfig.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ReceivedMessage.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/Subscription.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/Topic.java create mode 100644 gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/TopicOrBuilder.java create mode 100644 gcloud-java-pubsub/pom.xml diff --git a/gcloud-java-pubsub/README.md b/gcloud-java-pubsub/README.md new file mode 100644 index 000000000000..29d6990d18a2 --- /dev/null +++ b/gcloud-java-pubsub/README.md @@ -0,0 +1,25 @@ +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 + + com.google.gcloud + gcloud-java-pubsub + 0.0.10 + +``` diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java new file mode 100644 index 000000000000..1c5af6fed5d6 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java @@ -0,0 +1,710 @@ +// 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.AcknowledgeRequest} + * + *
+ * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.AcknowledgeRequest) + com.google.pubsub.v1.AcknowledgeRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.AcknowledgeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + subscription_ = ""; + + ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor; + } + + public com.google.pubsub.v1.AcknowledgeRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.AcknowledgeRequest build() { + com.google.pubsub.v1.AcknowledgeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.AcknowledgeRequest buildPartial() { + com.google.pubsub.v1.AcknowledgeRequest result = new com.google.pubsub.v1.AcknowledgeRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.subscription_ = subscription_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + ackIds_ = ackIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ackIds_ = ackIds_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.AcknowledgeRequest) { + return mergeFrom((com.google.pubsub.v1.AcknowledgeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.AcknowledgeRequest other) { + if (other == com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance()) return this; + if (!other.getSubscription().isEmpty()) { + subscription_ = other.subscription_; + onChanged(); + } + if (!other.ackIds_.isEmpty()) { + if (ackIds_.isEmpty()) { + ackIds_ = other.ackIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAckIdsIsMutable(); + ackIds_.addAll(other.ackIds_); + } + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.AcknowledgeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.AcknowledgeRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private 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)) { + 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 values) { + ensureAckIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, ackIds_); + 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 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 + PARSER = new com.google.protobuf.AbstractParser() { + public AcknowledgeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new AcknowledgeRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.AcknowledgeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/AcknowledgeRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/AcknowledgeRequestOrBuilder.java new file mode 100644 index 000000000000..7a89660bbcfb --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/AcknowledgeRequestOrBuilder.java @@ -0,0 +1,66 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface AcknowledgeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.AcknowledgeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.DeleteSubscriptionRequest) + com.google.pubsub.v1.DeleteSubscriptionRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.DeleteSubscriptionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + subscription_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor; + } + + public com.google.pubsub.v1.DeleteSubscriptionRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.DeleteSubscriptionRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.DeleteSubscriptionRequest build() { + com.google.pubsub.v1.DeleteSubscriptionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.DeleteSubscriptionRequest buildPartial() { + com.google.pubsub.v1.DeleteSubscriptionRequest result = new com.google.pubsub.v1.DeleteSubscriptionRequest(this); + result.subscription_ = subscription_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.DeleteSubscriptionRequest) { + return mergeFrom((com.google.pubsub.v1.DeleteSubscriptionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.DeleteSubscriptionRequest other) { + if (other == com.google.pubsub.v1.DeleteSubscriptionRequest.getDefaultInstance()) return this; + if (!other.getSubscription().isEmpty()) { + subscription_ = other.subscription_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.DeleteSubscriptionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.DeleteSubscriptionRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public DeleteSubscriptionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new DeleteSubscriptionRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.DeleteSubscriptionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..d43222fb965c --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface DeleteSubscriptionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.DeleteSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.DeleteTopicRequest) + com.google.pubsub.v1.DeleteTopicRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.DeleteTopicRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + topic_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor; + } + + public com.google.pubsub.v1.DeleteTopicRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.DeleteTopicRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.DeleteTopicRequest build() { + com.google.pubsub.v1.DeleteTopicRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.DeleteTopicRequest buildPartial() { + com.google.pubsub.v1.DeleteTopicRequest result = new com.google.pubsub.v1.DeleteTopicRequest(this); + result.topic_ = topic_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.DeleteTopicRequest) { + return mergeFrom((com.google.pubsub.v1.DeleteTopicRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.DeleteTopicRequest other) { + if (other == com.google.pubsub.v1.DeleteTopicRequest.getDefaultInstance()) return this; + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.DeleteTopicRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.DeleteTopicRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public DeleteTopicRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new DeleteTopicRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.DeleteTopicRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteTopicRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteTopicRequestOrBuilder.java new file mode 100644 index 000000000000..c08d12083d31 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/DeleteTopicRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface DeleteTopicRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.DeleteTopicRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.GetSubscriptionRequest) + com.google.pubsub.v1.GetSubscriptionRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.GetSubscriptionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + subscription_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor; + } + + public com.google.pubsub.v1.GetSubscriptionRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.GetSubscriptionRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.GetSubscriptionRequest build() { + com.google.pubsub.v1.GetSubscriptionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.GetSubscriptionRequest buildPartial() { + com.google.pubsub.v1.GetSubscriptionRequest result = new com.google.pubsub.v1.GetSubscriptionRequest(this); + result.subscription_ = subscription_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.GetSubscriptionRequest) { + return mergeFrom((com.google.pubsub.v1.GetSubscriptionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.GetSubscriptionRequest other) { + if (other == com.google.pubsub.v1.GetSubscriptionRequest.getDefaultInstance()) return this; + if (!other.getSubscription().isEmpty()) { + subscription_ = other.subscription_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.GetSubscriptionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.GetSubscriptionRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public GetSubscriptionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new GetSubscriptionRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.GetSubscriptionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetSubscriptionRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000000..248eb0561e6f --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetSubscriptionRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface GetSubscriptionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.GetSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.GetTopicRequest) + com.google.pubsub.v1.GetTopicRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.GetTopicRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + topic_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_GetTopicRequest_descriptor; + } + + public com.google.pubsub.v1.GetTopicRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.GetTopicRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.GetTopicRequest build() { + com.google.pubsub.v1.GetTopicRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.GetTopicRequest buildPartial() { + com.google.pubsub.v1.GetTopicRequest result = new com.google.pubsub.v1.GetTopicRequest(this); + result.topic_ = topic_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.GetTopicRequest) { + return mergeFrom((com.google.pubsub.v1.GetTopicRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.GetTopicRequest other) { + if (other == com.google.pubsub.v1.GetTopicRequest.getDefaultInstance()) return this; + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.GetTopicRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.GetTopicRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public GetTopicRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new GetTopicRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.GetTopicRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetTopicRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetTopicRequestOrBuilder.java new file mode 100644 index 000000000000..c26b5276c5da --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/GetTopicRequestOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface GetTopicRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.GetTopicRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListSubscriptionsRequest) + com.google.pubsub.v1.ListSubscriptionsRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.ListSubscriptionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + project_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor; + } + + public com.google.pubsub.v1.ListSubscriptionsRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.ListSubscriptionsRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.ListSubscriptionsRequest build() { + com.google.pubsub.v1.ListSubscriptionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.ListSubscriptionsRequest buildPartial() { + com.google.pubsub.v1.ListSubscriptionsRequest result = new com.google.pubsub.v1.ListSubscriptionsRequest(this); + result.project_ = project_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ListSubscriptionsRequest) { + return mergeFrom((com.google.pubsub.v1.ListSubscriptionsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ListSubscriptionsRequest other) { + if (other == com.google.pubsub.v1.ListSubscriptionsRequest.getDefaultInstance()) return this; + if (!other.getProject().isEmpty()) { + project_ = other.project_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ListSubscriptionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ListSubscriptionsRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public ListSubscriptionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new ListSubscriptionsRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.ListSubscriptionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequestOrBuilder.java new file mode 100644 index 000000000000..b8b08410f4a1 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequestOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface ListSubscriptionsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListSubscriptionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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(); + mutable_bitField0_ |= 0x00000001; + } + subscriptions_.add(input.readMessage(com.google.pubsub.v1.Subscription.parser(), extensionRegistry)); + 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_ = java.util.Collections.unmodifiableList(subscriptions_); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListSubscriptionsResponse.class, com.google.pubsub.v1.ListSubscriptionsResponse.Builder.class); + } + + private int bitField0_; + public static final int SUBSCRIPTIONS_FIELD_NUMBER = 1; + private java.util.List subscriptions_; + /** + * repeated .google.pubsub.v1.Subscription subscriptions = 1; + * + *
+   * The subscriptions that match the request.
+   * 
+ */ + public java.util.List getSubscriptionsList() { + return subscriptions_; + } + /** + * repeated .google.pubsub.v1.Subscription subscriptions = 1; + * + *
+   * The subscriptions that match the request.
+   * 
+ */ + public java.util.List + 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListSubscriptionsResponse) + com.google.pubsub.v1.ListSubscriptionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListSubscriptionsResponse.class, com.google.pubsub.v1.ListSubscriptionsResponse.Builder.class); + } + + // Construct using com.google.pubsub.v1.ListSubscriptionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getSubscriptionsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (subscriptionsBuilder_ == null) { + subscriptions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + subscriptionsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor; + } + + public com.google.pubsub.v1.ListSubscriptionsResponse getDefaultInstanceForType() { + return com.google.pubsub.v1.ListSubscriptionsResponse.getDefaultInstance(); + } + + public com.google.pubsub.v1.ListSubscriptionsResponse build() { + com.google.pubsub.v1.ListSubscriptionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.ListSubscriptionsResponse buildPartial() { + com.google.pubsub.v1.ListSubscriptionsResponse result = new com.google.pubsub.v1.ListSubscriptionsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (subscriptionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subscriptions_ = java.util.Collections.unmodifiableList(subscriptions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.subscriptions_ = subscriptions_; + } else { + result.subscriptions_ = subscriptionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ListSubscriptionsResponse) { + return mergeFrom((com.google.pubsub.v1.ListSubscriptionsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ListSubscriptionsResponse other) { + if (other == com.google.pubsub.v1.ListSubscriptionsResponse.getDefaultInstance()) return this; + if (subscriptionsBuilder_ == null) { + if (!other.subscriptions_.isEmpty()) { + if (subscriptions_.isEmpty()) { + subscriptions_ = other.subscriptions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSubscriptionsIsMutable(); + subscriptions_.addAll(other.subscriptions_); + } + onChanged(); + } + } else { + if (!other.subscriptions_.isEmpty()) { + if (subscriptionsBuilder_.isEmpty()) { + subscriptionsBuilder_.dispose(); + subscriptionsBuilder_ = null; + subscriptions_ = other.subscriptions_; + bitField0_ = (bitField0_ & ~0x00000001); + subscriptionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getSubscriptionsFieldBuilder() : null; + } else { + subscriptionsBuilder_.addAllMessages(other.subscriptions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ListSubscriptionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ListSubscriptionsResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List subscriptions_ = + java.util.Collections.emptyList(); + private void ensureSubscriptionsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + subscriptions_ = new java.util.ArrayList(subscriptions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.Subscription, com.google.pubsub.v1.Subscription.Builder, com.google.pubsub.v1.SubscriptionOrBuilder> subscriptionsBuilder_; + + /** + * repeated .google.pubsub.v1.Subscription subscriptions = 1; + * + *
+     * The subscriptions that match the request.
+     * 
+ */ + public java.util.List getSubscriptionsList() { + if (subscriptionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(subscriptions_); + } else { + return subscriptionsBuilder_.getMessageList(); + } + } + /** + * 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 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 + 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 + getSubscriptionsBuilderList() { + return getSubscriptionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.Subscription, com.google.pubsub.v1.Subscription.Builder, com.google.pubsub.v1.SubscriptionOrBuilder> + getSubscriptionsFieldBuilder() { + if (subscriptionsBuilder_ == null) { + subscriptionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.Subscription, com.google.pubsub.v1.Subscription.Builder, com.google.pubsub.v1.SubscriptionOrBuilder>( + subscriptions_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + subscriptions_ = null; + } + return subscriptionsBuilder_; + } + + 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 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 + PARSER = new com.google.protobuf.AbstractParser() { + public ListSubscriptionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new ListSubscriptionsResponse(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.ListSubscriptionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponseOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponseOrBuilder.java new file mode 100644 index 000000000000..c931a95d7dc1 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface ListSubscriptionsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListSubscriptionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .google.pubsub.v1.Subscription subscriptions = 1; + * + *
+   * The subscriptions that match the request.
+   * 
+ */ + java.util.List + getSubscriptionsList(); + /** + * 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 + 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListTopicSubscriptionsRequest) + com.google.pubsub.v1.ListTopicSubscriptionsRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.ListTopicSubscriptionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + topic_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor; + } + + public com.google.pubsub.v1.ListTopicSubscriptionsRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.ListTopicSubscriptionsRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.ListTopicSubscriptionsRequest build() { + com.google.pubsub.v1.ListTopicSubscriptionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.ListTopicSubscriptionsRequest buildPartial() { + com.google.pubsub.v1.ListTopicSubscriptionsRequest result = new com.google.pubsub.v1.ListTopicSubscriptionsRequest(this); + result.topic_ = topic_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ListTopicSubscriptionsRequest) { + return mergeFrom((com.google.pubsub.v1.ListTopicSubscriptionsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ListTopicSubscriptionsRequest other) { + if (other == com.google.pubsub.v1.ListTopicSubscriptionsRequest.getDefaultInstance()) return this; + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ListTopicSubscriptionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ListTopicSubscriptionsRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public ListTopicSubscriptionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new ListTopicSubscriptionsRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.ListTopicSubscriptionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequestOrBuilder.java new file mode 100644 index 000000000000..dafee9be2078 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequestOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface ListTopicSubscriptionsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListTopicSubscriptionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListTopicSubscriptionsResponse) + com.google.pubsub.v1.ListTopicSubscriptionsResponseOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.ListTopicSubscriptionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + subscriptions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor; + } + + public com.google.pubsub.v1.ListTopicSubscriptionsResponse getDefaultInstanceForType() { + return com.google.pubsub.v1.ListTopicSubscriptionsResponse.getDefaultInstance(); + } + + public com.google.pubsub.v1.ListTopicSubscriptionsResponse build() { + com.google.pubsub.v1.ListTopicSubscriptionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.ListTopicSubscriptionsResponse buildPartial() { + com.google.pubsub.v1.ListTopicSubscriptionsResponse result = new com.google.pubsub.v1.ListTopicSubscriptionsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subscriptions_ = subscriptions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.subscriptions_ = subscriptions_; + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ListTopicSubscriptionsResponse) { + return mergeFrom((com.google.pubsub.v1.ListTopicSubscriptionsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ListTopicSubscriptionsResponse other) { + if (other == com.google.pubsub.v1.ListTopicSubscriptionsResponse.getDefaultInstance()) return this; + if (!other.subscriptions_.isEmpty()) { + if (subscriptions_.isEmpty()) { + subscriptions_ = other.subscriptions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSubscriptionsIsMutable(); + subscriptions_.addAll(other.subscriptions_); + } + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ListTopicSubscriptionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ListTopicSubscriptionsResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList subscriptions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureSubscriptionsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + subscriptions_ = new com.google.protobuf.LazyStringArrayList(subscriptions_); + bitField0_ |= 0x00000001; + } + } + /** + * 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 values) { + ensureSubscriptionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, subscriptions_); + onChanged(); + return this; + } + /** + * 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 + PARSER = new com.google.protobuf.AbstractParser() { + public ListTopicSubscriptionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new ListTopicSubscriptionsResponse(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.ListTopicSubscriptionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponseOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponseOrBuilder.java new file mode 100644 index 000000000000..7cfc77118c55 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponseOrBuilder.java @@ -0,0 +1,66 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface ListTopicSubscriptionsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListTopicSubscriptionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListTopicsRequest) + com.google.pubsub.v1.ListTopicsRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.ListTopicsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + project_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicsRequest_descriptor; + } + + public com.google.pubsub.v1.ListTopicsRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.ListTopicsRequest build() { + com.google.pubsub.v1.ListTopicsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.ListTopicsRequest buildPartial() { + com.google.pubsub.v1.ListTopicsRequest result = new com.google.pubsub.v1.ListTopicsRequest(this); + result.project_ = project_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ListTopicsRequest) { + return mergeFrom((com.google.pubsub.v1.ListTopicsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ListTopicsRequest other) { + if (other == com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance()) return this; + if (!other.getProject().isEmpty()) { + project_ = other.project_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ListTopicsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ListTopicsRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public ListTopicsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new ListTopicsRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.ListTopicsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsRequestOrBuilder.java new file mode 100644 index 000000000000..2b8d27032226 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsRequestOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface ListTopicsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListTopicsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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(); + mutable_bitField0_ |= 0x00000001; + } + topics_.add(input.readMessage(com.google.pubsub.v1.Topic.parser(), extensionRegistry)); + 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)) { + topics_ = java.util.Collections.unmodifiableList(topics_); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListTopicsResponse.class, com.google.pubsub.v1.ListTopicsResponse.Builder.class); + } + + private int bitField0_; + public static final int TOPICS_FIELD_NUMBER = 1; + private java.util.List topics_; + /** + * repeated .google.pubsub.v1.Topic topics = 1; + * + *
+   * The resulting topics.
+   * 
+ */ + public java.util.List getTopicsList() { + return topics_; + } + /** + * repeated .google.pubsub.v1.Topic topics = 1; + * + *
+   * The resulting topics.
+   * 
+ */ + public java.util.List + 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListTopicsResponse) + com.google.pubsub.v1.ListTopicsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicsResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListTopicsResponse.class, com.google.pubsub.v1.ListTopicsResponse.Builder.class); + } + + // Construct using com.google.pubsub.v1.ListTopicsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getTopicsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (topicsBuilder_ == null) { + topics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + topicsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ListTopicsResponse_descriptor; + } + + public com.google.pubsub.v1.ListTopicsResponse getDefaultInstanceForType() { + return com.google.pubsub.v1.ListTopicsResponse.getDefaultInstance(); + } + + public com.google.pubsub.v1.ListTopicsResponse build() { + com.google.pubsub.v1.ListTopicsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.ListTopicsResponse buildPartial() { + com.google.pubsub.v1.ListTopicsResponse result = new com.google.pubsub.v1.ListTopicsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (topicsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + topics_ = java.util.Collections.unmodifiableList(topics_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.topics_ = topics_; + } else { + result.topics_ = topicsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ListTopicsResponse) { + return mergeFrom((com.google.pubsub.v1.ListTopicsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ListTopicsResponse other) { + if (other == com.google.pubsub.v1.ListTopicsResponse.getDefaultInstance()) return this; + if (topicsBuilder_ == null) { + if (!other.topics_.isEmpty()) { + if (topics_.isEmpty()) { + topics_ = other.topics_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTopicsIsMutable(); + topics_.addAll(other.topics_); + } + onChanged(); + } + } else { + if (!other.topics_.isEmpty()) { + if (topicsBuilder_.isEmpty()) { + topicsBuilder_.dispose(); + topicsBuilder_ = null; + topics_ = other.topics_; + bitField0_ = (bitField0_ & ~0x00000001); + topicsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTopicsFieldBuilder() : null; + } else { + topicsBuilder_.addAllMessages(other.topics_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ListTopicsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ListTopicsResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List topics_ = + java.util.Collections.emptyList(); + private void ensureTopicsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + topics_ = new java.util.ArrayList(topics_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.Topic, com.google.pubsub.v1.Topic.Builder, com.google.pubsub.v1.TopicOrBuilder> topicsBuilder_; + + /** + * repeated .google.pubsub.v1.Topic topics = 1; + * + *
+     * The resulting topics.
+     * 
+ */ + public java.util.List getTopicsList() { + if (topicsBuilder_ == null) { + return java.util.Collections.unmodifiableList(topics_); + } else { + return topicsBuilder_.getMessageList(); + } + } + /** + * 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 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 + 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 + getTopicsBuilderList() { + return getTopicsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.Topic, com.google.pubsub.v1.Topic.Builder, com.google.pubsub.v1.TopicOrBuilder> + getTopicsFieldBuilder() { + if (topicsBuilder_ == null) { + topicsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.Topic, com.google.pubsub.v1.Topic.Builder, com.google.pubsub.v1.TopicOrBuilder>( + topics_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + topics_ = null; + } + return topicsBuilder_; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public ListTopicsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new ListTopicsResponse(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.ListTopicsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsResponseOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsResponseOrBuilder.java new file mode 100644 index 000000000000..60d5d7ac17da --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ListTopicsResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface ListTopicsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListTopicsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .google.pubsub.v1.Topic topics = 1; + * + *
+   * The resulting topics.
+   * 
+ */ + java.util.List + getTopicsList(); + /** + * 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 + 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ModifyAckDeadlineRequest) + com.google.pubsub.v1.ModifyAckDeadlineRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.ModifyAckDeadlineRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + subscription_ = ""; + + ackIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + ackDeadlineSeconds_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor; + } + + public com.google.pubsub.v1.ModifyAckDeadlineRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.ModifyAckDeadlineRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.ModifyAckDeadlineRequest build() { + com.google.pubsub.v1.ModifyAckDeadlineRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.ModifyAckDeadlineRequest buildPartial() { + com.google.pubsub.v1.ModifyAckDeadlineRequest result = new com.google.pubsub.v1.ModifyAckDeadlineRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.subscription_ = subscription_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + ackIds_ = ackIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ackIds_ = ackIds_; + result.ackDeadlineSeconds_ = ackDeadlineSeconds_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ModifyAckDeadlineRequest) { + return mergeFrom((com.google.pubsub.v1.ModifyAckDeadlineRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ModifyAckDeadlineRequest other) { + if (other == com.google.pubsub.v1.ModifyAckDeadlineRequest.getDefaultInstance()) return this; + if (!other.getSubscription().isEmpty()) { + subscription_ = other.subscription_; + onChanged(); + } + if (!other.ackIds_.isEmpty()) { + if (ackIds_.isEmpty()) { + ackIds_ = other.ackIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAckIdsIsMutable(); + ackIds_.addAll(other.ackIds_); + } + onChanged(); + } + if (other.getAckDeadlineSeconds() != 0) { + setAckDeadlineSeconds(other.getAckDeadlineSeconds()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ModifyAckDeadlineRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ModifyAckDeadlineRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private 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)) { + 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 values) { + ensureAckIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, ackIds_); + onChanged(); + return this; + } + /** + * 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 + PARSER = new com.google.protobuf.AbstractParser() { + public ModifyAckDeadlineRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new ModifyAckDeadlineRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.ModifyAckDeadlineRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequestOrBuilder.java new file mode 100644 index 000000000000..1e375b70cc30 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequestOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface ModifyAckDeadlineRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ModifyAckDeadlineRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ModifyPushConfigRequest) + com.google.pubsub.v1.ModifyPushConfigRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.ModifyPushConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + subscription_ = ""; + + if (pushConfigBuilder_ == null) { + pushConfig_ = null; + } else { + pushConfig_ = null; + pushConfigBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor; + } + + public com.google.pubsub.v1.ModifyPushConfigRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.ModifyPushConfigRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.ModifyPushConfigRequest build() { + com.google.pubsub.v1.ModifyPushConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.ModifyPushConfigRequest buildPartial() { + com.google.pubsub.v1.ModifyPushConfigRequest result = new com.google.pubsub.v1.ModifyPushConfigRequest(this); + result.subscription_ = subscription_; + if (pushConfigBuilder_ == null) { + result.pushConfig_ = pushConfig_; + } else { + result.pushConfig_ = pushConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ModifyPushConfigRequest) { + return mergeFrom((com.google.pubsub.v1.ModifyPushConfigRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ModifyPushConfigRequest other) { + if (other == com.google.pubsub.v1.ModifyPushConfigRequest.getDefaultInstance()) return this; + if (!other.getSubscription().isEmpty()) { + subscription_ = other.subscription_; + onChanged(); + } + if (other.hasPushConfig()) { + mergePushConfig(other.getPushConfig()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ModifyPushConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ModifyPushConfigRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public ModifyPushConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new ModifyPushConfigRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.ModifyPushConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequestOrBuilder.java new file mode 100644 index 000000000000..50d85cc4ad08 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequestOrBuilder.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface ModifyPushConfigRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ModifyPushConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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(); + mutable_bitField0_ |= 0x00000002; + } + messages_.add(input.readMessage(com.google.pubsub.v1.PubsubMessage.parser(), extensionRegistry)); + 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)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PublishRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PublishRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.PublishRequest.class, com.google.pubsub.v1.PublishRequest.Builder.class); + } + + private int bitField0_; + public static final int TOPIC_FIELD_NUMBER = 1; + private volatile java.lang.Object topic_; + /** + * 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 messages_; + /** + * repeated .google.pubsub.v1.PubsubMessage messages = 2; + * + *
+   * The messages to publish.
+   * 
+ */ + public java.util.List getMessagesList() { + return messages_; + } + /** + * repeated .google.pubsub.v1.PubsubMessage messages = 2; + * + *
+   * The messages to publish.
+   * 
+ */ + public java.util.List + 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PublishRequest) + com.google.pubsub.v1.PublishRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PublishRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PublishRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.PublishRequest.class, com.google.pubsub.v1.PublishRequest.Builder.class); + } + + // Construct using com.google.pubsub.v1.PublishRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getMessagesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + topic_ = ""; + + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + messagesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PublishRequest_descriptor; + } + + public com.google.pubsub.v1.PublishRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.PublishRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.PublishRequest build() { + com.google.pubsub.v1.PublishRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.PublishRequest buildPartial() { + com.google.pubsub.v1.PublishRequest result = new com.google.pubsub.v1.PublishRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.topic_ = topic_; + if (messagesBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.messages_ = messages_; + } else { + result.messages_ = messagesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.PublishRequest) { + return mergeFrom((com.google.pubsub.v1.PublishRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.PublishRequest other) { + if (other == com.google.pubsub.v1.PublishRequest.getDefaultInstance()) return this; + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + if (messagesBuilder_ == null) { + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + } else { + if (!other.messages_.isEmpty()) { + if (messagesBuilder_.isEmpty()) { + messagesBuilder_.dispose(); + messagesBuilder_ = null; + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000002); + messagesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getMessagesFieldBuilder() : null; + } else { + messagesBuilder_.addAllMessages(other.messages_); + } + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.PublishRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.PublishRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object topic_ = ""; + /** + * 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 messages_ = + java.util.Collections.emptyList(); + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + messages_ = new java.util.ArrayList(messages_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.PubsubMessage, com.google.pubsub.v1.PubsubMessage.Builder, com.google.pubsub.v1.PubsubMessageOrBuilder> messagesBuilder_; + + /** + * repeated .google.pubsub.v1.PubsubMessage messages = 2; + * + *
+     * The messages to publish.
+     * 
+ */ + public java.util.List getMessagesList() { + if (messagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(messages_); + } else { + return messagesBuilder_.getMessageList(); + } + } + /** + * 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 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 + 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 + getMessagesBuilderList() { + return getMessagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.PubsubMessage, com.google.pubsub.v1.PubsubMessage.Builder, com.google.pubsub.v1.PubsubMessageOrBuilder> + getMessagesFieldBuilder() { + if (messagesBuilder_ == null) { + messagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.PubsubMessage, com.google.pubsub.v1.PubsubMessage.Builder, com.google.pubsub.v1.PubsubMessageOrBuilder>( + messages_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + messages_ = null; + } + return messagesBuilder_; + } + 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.PublishRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.PublishRequest) + private static final com.google.pubsub.v1.PublishRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.PublishRequest(); + } + + public static com.google.pubsub.v1.PublishRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PublishRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new PublishRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.PublishRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishRequestOrBuilder.java new file mode 100644 index 000000000000..d862735fe6df --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishRequestOrBuilder.java @@ -0,0 +1,71 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface PublishRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PublishRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 + getMessagesList(); + /** + * 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 + 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PublishResponse) + com.google.pubsub.v1.PublishResponseOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.PublishResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + messageIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PublishResponse_descriptor; + } + + public com.google.pubsub.v1.PublishResponse getDefaultInstanceForType() { + return com.google.pubsub.v1.PublishResponse.getDefaultInstance(); + } + + public com.google.pubsub.v1.PublishResponse build() { + com.google.pubsub.v1.PublishResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.PublishResponse buildPartial() { + com.google.pubsub.v1.PublishResponse result = new com.google.pubsub.v1.PublishResponse(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + messageIds_ = messageIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.messageIds_ = messageIds_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.PublishResponse) { + return mergeFrom((com.google.pubsub.v1.PublishResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.PublishResponse other) { + if (other == com.google.pubsub.v1.PublishResponse.getDefaultInstance()) return this; + if (!other.messageIds_.isEmpty()) { + if (messageIds_.isEmpty()) { + messageIds_ = other.messageIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMessageIdsIsMutable(); + messageIds_.addAll(other.messageIds_); + } + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.PublishResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.PublishResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList messageIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureMessageIdsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + messageIds_ = new com.google.protobuf.LazyStringArrayList(messageIds_); + bitField0_ |= 0x00000001; + } + } + /** + * 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 values) { + ensureMessageIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, messageIds_); + 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 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 + PARSER = new com.google.protobuf.AbstractParser() { + public PublishResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new PublishResponse(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.PublishResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishResponseOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishResponseOrBuilder.java new file mode 100644 index 000000000000..6908fac0c93b --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PublishResponseOrBuilder.java @@ -0,0 +1,52 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface PublishResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PublishResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 METHOD_CREATE_TOPIC = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Publisher", "CreateTopic"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.Topic.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.Topic.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_PUBLISH = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Publisher", "Publish"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.PublishRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.PublishResponse.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_GET_TOPIC = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Publisher", "GetTopic"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.GetTopicRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.Topic.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_LIST_TOPICS = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Publisher", "ListTopics"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ListTopicsResponse.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_LIST_TOPIC_SUBSCRIPTIONS = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Publisher", "ListTopicSubscriptions"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ListTopicSubscriptionsRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ListTopicSubscriptionsResponse.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_DELETE_TOPIC = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Publisher", "DeleteTopic"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.DeleteTopicRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance())); + + public static PublisherStub newStub(io.grpc.Channel channel) { + return new PublisherStub(channel); + } + + public static PublisherBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new PublisherBlockingStub(channel); + } + + public static PublisherFutureStub newFutureStub( + io.grpc.Channel channel) { + return new PublisherFutureStub(channel); + } + + public static interface Publisher { + + public void createTopic(com.google.pubsub.v1.Topic request, + io.grpc.stub.StreamObserver responseObserver); + + public void publish(com.google.pubsub.v1.PublishRequest request, + io.grpc.stub.StreamObserver responseObserver); + + public void getTopic(com.google.pubsub.v1.GetTopicRequest request, + io.grpc.stub.StreamObserver responseObserver); + + public void listTopics(com.google.pubsub.v1.ListTopicsRequest request, + io.grpc.stub.StreamObserver responseObserver); + + public void listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request, + io.grpc.stub.StreamObserver responseObserver); + + public void deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request, + io.grpc.stub.StreamObserver responseObserver); + } + + public static interface PublisherBlockingClient { + + public com.google.pubsub.v1.Topic createTopic(com.google.pubsub.v1.Topic request); + + public com.google.pubsub.v1.PublishResponse publish(com.google.pubsub.v1.PublishRequest request); + + public com.google.pubsub.v1.Topic getTopic(com.google.pubsub.v1.GetTopicRequest request); + + public com.google.pubsub.v1.ListTopicsResponse listTopics(com.google.pubsub.v1.ListTopicsRequest request); + + public com.google.pubsub.v1.ListTopicSubscriptionsResponse listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request); + + public com.google.protobuf.Empty deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request); + } + + public static interface PublisherFutureClient { + + public com.google.common.util.concurrent.ListenableFuture createTopic( + com.google.pubsub.v1.Topic request); + + public com.google.common.util.concurrent.ListenableFuture publish( + com.google.pubsub.v1.PublishRequest request); + + public com.google.common.util.concurrent.ListenableFuture getTopic( + com.google.pubsub.v1.GetTopicRequest request); + + public com.google.common.util.concurrent.ListenableFuture listTopics( + com.google.pubsub.v1.ListTopicsRequest request); + + public com.google.common.util.concurrent.ListenableFuture listTopicSubscriptions( + com.google.pubsub.v1.ListTopicSubscriptionsRequest request); + + public com.google.common.util.concurrent.ListenableFuture deleteTopic( + com.google.pubsub.v1.DeleteTopicRequest request); + } + + public static class PublisherStub extends io.grpc.stub.AbstractStub + implements Publisher { + private PublisherStub(io.grpc.Channel channel) { + super(channel); + } + + private PublisherStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PublisherStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new PublisherStub(channel, callOptions); + } + + @java.lang.Override + public void createTopic(com.google.pubsub.v1.Topic request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_CREATE_TOPIC, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void publish(com.google.pubsub.v1.PublishRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_PUBLISH, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void getTopic(com.google.pubsub.v1.GetTopicRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_GET_TOPIC, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void listTopics(com.google.pubsub.v1.ListTopicsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_LIST_TOPICS, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_LIST_TOPIC_SUBSCRIPTIONS, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_DELETE_TOPIC, getCallOptions()), request, responseObserver); + } + } + + public static class PublisherBlockingStub extends io.grpc.stub.AbstractStub + implements PublisherBlockingClient { + private PublisherBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private PublisherBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PublisherBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new PublisherBlockingStub(channel, callOptions); + } + + @java.lang.Override + public com.google.pubsub.v1.Topic createTopic(com.google.pubsub.v1.Topic request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_CREATE_TOPIC, getCallOptions()), request); + } + + @java.lang.Override + public com.google.pubsub.v1.PublishResponse publish(com.google.pubsub.v1.PublishRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_PUBLISH, getCallOptions()), request); + } + + @java.lang.Override + public com.google.pubsub.v1.Topic getTopic(com.google.pubsub.v1.GetTopicRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_GET_TOPIC, getCallOptions()), request); + } + + @java.lang.Override + public com.google.pubsub.v1.ListTopicsResponse listTopics(com.google.pubsub.v1.ListTopicsRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_LIST_TOPICS, getCallOptions()), request); + } + + @java.lang.Override + public com.google.pubsub.v1.ListTopicSubscriptionsResponse listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_LIST_TOPIC_SUBSCRIPTIONS, getCallOptions()), request); + } + + @java.lang.Override + public com.google.protobuf.Empty deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_DELETE_TOPIC, getCallOptions()), request); + } + } + + public static class PublisherFutureStub extends io.grpc.stub.AbstractStub + implements PublisherFutureClient { + private PublisherFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private PublisherFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PublisherFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new PublisherFutureStub(channel, callOptions); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture createTopic( + com.google.pubsub.v1.Topic request) { + return futureUnaryCall( + getChannel().newCall(METHOD_CREATE_TOPIC, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture publish( + com.google.pubsub.v1.PublishRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_PUBLISH, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture getTopic( + com.google.pubsub.v1.GetTopicRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_GET_TOPIC, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture listTopics( + com.google.pubsub.v1.ListTopicsRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_LIST_TOPICS, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture listTopicSubscriptions( + com.google.pubsub.v1.ListTopicSubscriptionsRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_LIST_TOPIC_SUBSCRIPTIONS, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture deleteTopic( + com.google.pubsub.v1.DeleteTopicRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_DELETE_TOPIC, getCallOptions()), request); + } + } + + public static io.grpc.ServerServiceDefinition bindService( + final Publisher serviceImpl) { + return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME) + .addMethod( + METHOD_CREATE_TOPIC, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.Topic, + com.google.pubsub.v1.Topic>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.Topic request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.createTopic(request, responseObserver); + } + })) + .addMethod( + METHOD_PUBLISH, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.PublishRequest, + com.google.pubsub.v1.PublishResponse>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.PublishRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.publish(request, responseObserver); + } + })) + .addMethod( + METHOD_GET_TOPIC, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.GetTopicRequest, + com.google.pubsub.v1.Topic>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.GetTopicRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.getTopic(request, responseObserver); + } + })) + .addMethod( + METHOD_LIST_TOPICS, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.ListTopicsRequest, + com.google.pubsub.v1.ListTopicsResponse>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.ListTopicsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.listTopics(request, responseObserver); + } + })) + .addMethod( + METHOD_LIST_TOPIC_SUBSCRIPTIONS, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.ListTopicSubscriptionsRequest, + com.google.pubsub.v1.ListTopicSubscriptionsResponse>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.ListTopicSubscriptionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.listTopicSubscriptions(request, responseObserver); + } + })) + .addMethod( + METHOD_DELETE_TOPIC, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.DeleteTopicRequest, + com.google.protobuf.Empty>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.DeleteTopicRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.deleteTopic(request, responseObserver); + } + })).build(); + } +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubMessage.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubMessage.java new file mode 100644 index 000000000000..5228be2f8998 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubMessage.java @@ -0,0 +1,740 @@ +// 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.PubsubMessage} + * + *
+ * 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 + attributes = input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + attributes_.getMutableMap().put(attributes.getKey(), attributes.getValue()); + break; + } + case 26: { + String s = input.readStringRequireUtf8(); + + messageId_ = 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_PubsubMessage_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.PubsubMessage.class, com.google.pubsub.v1.PubsubMessage.Builder.class); + } + + private int bitField0_; + public static final int DATA_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString data_; + /** + * 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 + .newDefaultInstance( + com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + /** + * map<string, string> attributes = 2; + * + *
+   * Optional attributes for this message.
+   * 
+ */ + + public java.util.Map getAttributes() { + return internalGetAttributes().getMap(); + } + + public static final int MESSAGE_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object messageId_; + /** + * 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 entry + : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + output.writeMessage(2, attributes); + } + if (!getMessageIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, messageId_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, data_); + } + for (java.util.Map.Entry entry + : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, attributes); + } + if (!getMessageIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, messageId_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.PubsubMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PubsubMessage 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.PubsubMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PubsubMessage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.PubsubMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PubsubMessage 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.PubsubMessage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.PubsubMessage 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.PubsubMessage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PubsubMessage 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.PubsubMessage 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.PubsubMessage} + * + *
+   * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PubsubMessage) + com.google.pubsub.v1.PubsubMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PubsubMessage_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 2: + return internalGetMutableAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.PubsubMessage.class, com.google.pubsub.v1.PubsubMessage.Builder.class); + } + + // Construct using com.google.pubsub.v1.PubsubMessage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + data_ = com.google.protobuf.ByteString.EMPTY; + + internalGetMutableAttributes().clear(); + messageId_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PubsubMessage_descriptor; + } + + public com.google.pubsub.v1.PubsubMessage getDefaultInstanceForType() { + return com.google.pubsub.v1.PubsubMessage.getDefaultInstance(); + } + + public com.google.pubsub.v1.PubsubMessage build() { + com.google.pubsub.v1.PubsubMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.PubsubMessage buildPartial() { + com.google.pubsub.v1.PubsubMessage result = new com.google.pubsub.v1.PubsubMessage(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.data_ = data_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + result.messageId_ = messageId_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.PubsubMessage) { + return mergeFrom((com.google.pubsub.v1.PubsubMessage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.PubsubMessage other) { + if (other == com.google.pubsub.v1.PubsubMessage.getDefaultInstance()) return this; + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + internalGetMutableAttributes().mergeFrom( + other.internalGetAttributes()); + if (!other.getMessageId().isEmpty()) { + messageId_ = other.messageId_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.PubsubMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.PubsubMessage) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * 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 + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + private com.google.protobuf.MapField + internalGetMutableAttributes() { + onChanged();; + if (attributes_ == null) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + /** + * map<string, string> attributes = 2; + * + *
+     * Optional attributes for this message.
+     * 
+ */ + public java.util.Map getAttributes() { + return internalGetAttributes().getMap(); + } + /** + * map<string, string> attributes = 2; + * + *
+     * Optional attributes for this message.
+     * 
+ */ + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * map<string, string> attributes = 2; + * + *
+     * Optional attributes for this message.
+     * 
+ */ + public Builder putAllAttributes( + java.util.Map values) { + getMutableAttributes().putAll(values); + return this; + } + + private java.lang.Object messageId_ = ""; + /** + * 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 + PARSER = new com.google.protobuf.AbstractParser() { + public PubsubMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new PubsubMessage(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.PubsubMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubMessageOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubMessageOrBuilder.java new file mode 100644 index 000000000000..706d17d65291 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PubsubMessageOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface PubsubMessageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PubsubMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 + getAttributes(); + + /** + * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PullRequest) + com.google.pubsub.v1.PullRequestOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.PullRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + subscription_ = ""; + + returnImmediately_ = false; + + maxMessages_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PullRequest_descriptor; + } + + public com.google.pubsub.v1.PullRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.PullRequest.getDefaultInstance(); + } + + public com.google.pubsub.v1.PullRequest build() { + com.google.pubsub.v1.PullRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.PullRequest buildPartial() { + com.google.pubsub.v1.PullRequest result = new com.google.pubsub.v1.PullRequest(this); + result.subscription_ = subscription_; + result.returnImmediately_ = returnImmediately_; + result.maxMessages_ = maxMessages_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.PullRequest) { + return mergeFrom((com.google.pubsub.v1.PullRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.PullRequest other) { + if (other == com.google.pubsub.v1.PullRequest.getDefaultInstance()) return this; + if (!other.getSubscription().isEmpty()) { + subscription_ = other.subscription_; + onChanged(); + } + if (other.getReturnImmediately() != false) { + setReturnImmediately(other.getReturnImmediately()); + } + if (other.getMaxMessages() != 0) { + setMaxMessages(other.getMaxMessages()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.PullRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.PullRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public PullRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new PullRequest(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.PullRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullRequestOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullRequestOrBuilder.java new file mode 100644 index 000000000000..698925a51401 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullRequestOrBuilder.java @@ -0,0 +1,50 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface PullRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PullRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * 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(); + mutable_bitField0_ |= 0x00000001; + } + receivedMessages_.add(input.readMessage(com.google.pubsub.v1.ReceivedMessage.parser(), extensionRegistry)); + 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)) { + receivedMessages_ = java.util.Collections.unmodifiableList(receivedMessages_); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PullResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PullResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.PullResponse.class, com.google.pubsub.v1.PullResponse.Builder.class); + } + + public static final int RECEIVED_MESSAGES_FIELD_NUMBER = 1; + private java.util.List 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 java.util.List getReceivedMessagesList() { + 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 java.util.List + 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PullResponse) + com.google.pubsub.v1.PullResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PullResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PullResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.PullResponse.class, com.google.pubsub.v1.PullResponse.Builder.class); + } + + // Construct using com.google.pubsub.v1.PullResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getReceivedMessagesFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (receivedMessagesBuilder_ == null) { + receivedMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + receivedMessagesBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PullResponse_descriptor; + } + + public com.google.pubsub.v1.PullResponse getDefaultInstanceForType() { + return com.google.pubsub.v1.PullResponse.getDefaultInstance(); + } + + public com.google.pubsub.v1.PullResponse build() { + com.google.pubsub.v1.PullResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.PullResponse buildPartial() { + com.google.pubsub.v1.PullResponse result = new com.google.pubsub.v1.PullResponse(this); + int from_bitField0_ = bitField0_; + if (receivedMessagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + receivedMessages_ = java.util.Collections.unmodifiableList(receivedMessages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.receivedMessages_ = receivedMessages_; + } else { + result.receivedMessages_ = receivedMessagesBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.PullResponse) { + return mergeFrom((com.google.pubsub.v1.PullResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.PullResponse other) { + if (other == com.google.pubsub.v1.PullResponse.getDefaultInstance()) return this; + if (receivedMessagesBuilder_ == null) { + if (!other.receivedMessages_.isEmpty()) { + if (receivedMessages_.isEmpty()) { + receivedMessages_ = other.receivedMessages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReceivedMessagesIsMutable(); + receivedMessages_.addAll(other.receivedMessages_); + } + onChanged(); + } + } else { + if (!other.receivedMessages_.isEmpty()) { + if (receivedMessagesBuilder_.isEmpty()) { + receivedMessagesBuilder_.dispose(); + receivedMessagesBuilder_ = null; + receivedMessages_ = other.receivedMessages_; + bitField0_ = (bitField0_ & ~0x00000001); + receivedMessagesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getReceivedMessagesFieldBuilder() : null; + } else { + receivedMessagesBuilder_.addAllMessages(other.receivedMessages_); + } + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.PullResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.PullResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List receivedMessages_ = + java.util.Collections.emptyList(); + private void ensureReceivedMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + receivedMessages_ = new java.util.ArrayList(receivedMessages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.ReceivedMessage, com.google.pubsub.v1.ReceivedMessage.Builder, com.google.pubsub.v1.ReceivedMessageOrBuilder> receivedMessagesBuilder_; + + /** + * 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 getReceivedMessagesList() { + if (receivedMessagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(receivedMessages_); + } else { + return receivedMessagesBuilder_.getMessageList(); + } + } + /** + * 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 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 + 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 + getReceivedMessagesBuilderList() { + return getReceivedMessagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.ReceivedMessage, com.google.pubsub.v1.ReceivedMessage.Builder, com.google.pubsub.v1.ReceivedMessageOrBuilder> + getReceivedMessagesFieldBuilder() { + if (receivedMessagesBuilder_ == null) { + receivedMessagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.google.pubsub.v1.ReceivedMessage, com.google.pubsub.v1.ReceivedMessage.Builder, com.google.pubsub.v1.ReceivedMessageOrBuilder>( + receivedMessages_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + receivedMessages_ = null; + } + return receivedMessagesBuilder_; + } + 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.PullResponse) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.PullResponse) + private static final com.google.pubsub.v1.PullResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.PullResponse(); + } + + public static com.google.pubsub.v1.PullResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PullResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new PullResponse(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.PullResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullResponseOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullResponseOrBuilder.java new file mode 100644 index 000000000000..a93ac1757e3b --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PullResponseOrBuilder.java @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface PullResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PullResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 + getReceivedMessagesList(); + /** + * 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 + 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 + attributes = input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + attributes_.getMutableMap().put(attributes.getKey(), attributes.getValue()); + 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_PushConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PushConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.PushConfig.class, com.google.pubsub.v1.PushConfig.Builder.class); + } + + private int bitField0_; + public static final int PUSH_ENDPOINT_FIELD_NUMBER = 1; + private volatile java.lang.Object pushEndpoint_; + /** + * 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 + .newDefaultInstance( + com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PushConfig_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + /** + * 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 getAttributes() { + return internalGetAttributes().getMap(); + } + + 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 (!getPushEndpointBytes().isEmpty()) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, pushEndpoint_); + } + for (java.util.Map.Entry entry + : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + output.writeMessage(2, attributes); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPushEndpointBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, pushEndpoint_); + } + for (java.util.Map.Entry entry + : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, attributes); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.PushConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PushConfig 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.PushConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.PushConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.PushConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PushConfig 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.PushConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.PushConfig 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.PushConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.PushConfig 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.PushConfig 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.PushConfig} + * + *
+   * Configuration for a push delivery endpoint.
+   * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PushConfig) + com.google.pubsub.v1.PushConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PushConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 2: + return internalGetMutableAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PushConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.PushConfig.class, com.google.pubsub.v1.PushConfig.Builder.class); + } + + // Construct using com.google.pubsub.v1.PushConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + pushEndpoint_ = ""; + + internalGetMutableAttributes().clear(); + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PushConfig_descriptor; + } + + public com.google.pubsub.v1.PushConfig getDefaultInstanceForType() { + return com.google.pubsub.v1.PushConfig.getDefaultInstance(); + } + + public com.google.pubsub.v1.PushConfig build() { + com.google.pubsub.v1.PushConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.PushConfig buildPartial() { + com.google.pubsub.v1.PushConfig result = new com.google.pubsub.v1.PushConfig(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.pushEndpoint_ = pushEndpoint_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.PushConfig) { + return mergeFrom((com.google.pubsub.v1.PushConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.PushConfig other) { + if (other == com.google.pubsub.v1.PushConfig.getDefaultInstance()) return this; + if (!other.getPushEndpoint().isEmpty()) { + pushEndpoint_ = other.pushEndpoint_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom( + other.internalGetAttributes()); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.PushConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.PushConfig) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object pushEndpoint_ = ""; + /** + * 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 + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + private com.google.protobuf.MapField + internalGetMutableAttributes() { + onChanged();; + if (attributes_ == null) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + /** + * 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 getAttributes() { + return internalGetAttributes().getMap(); + } + /** + * 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 + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * 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 values) { + getMutableAttributes().putAll(values); + 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.PushConfig) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.PushConfig) + private static final com.google.pubsub.v1.PushConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.PushConfig(); + } + + public static com.google.pubsub.v1.PushConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public PushConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new PushConfig(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.PushConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java new file mode 100644 index 000000000000..6a4e995b8232 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface PushConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PushConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 + getAttributes(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ReceivedMessage.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ReceivedMessage.java new file mode 100644 index 000000000000..091d0ca610b2 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ReceivedMessage.java @@ -0,0 +1,696 @@ +// 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.ReceivedMessage} + * + *
+ * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ReceivedMessage) + com.google.pubsub.v1.ReceivedMessageOrBuilder { + 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); + } + + // Construct using com.google.pubsub.v1.ReceivedMessage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + ackId_ = ""; + + if (messageBuilder_ == null) { + message_ = null; + } else { + message_ = null; + messageBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_ReceivedMessage_descriptor; + } + + public com.google.pubsub.v1.ReceivedMessage getDefaultInstanceForType() { + return com.google.pubsub.v1.ReceivedMessage.getDefaultInstance(); + } + + public com.google.pubsub.v1.ReceivedMessage build() { + com.google.pubsub.v1.ReceivedMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.ReceivedMessage buildPartial() { + com.google.pubsub.v1.ReceivedMessage result = new com.google.pubsub.v1.ReceivedMessage(this); + result.ackId_ = ackId_; + if (messageBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = messageBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ReceivedMessage) { + return mergeFrom((com.google.pubsub.v1.ReceivedMessage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ReceivedMessage other) { + if (other == com.google.pubsub.v1.ReceivedMessage.getDefaultInstance()) return this; + if (!other.getAckId().isEmpty()) { + ackId_ = other.ackId_; + onChanged(); + } + if (other.hasMessage()) { + mergeMessage(other.getMessage()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ReceivedMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ReceivedMessage) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + 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 + PARSER = new com.google.protobuf.AbstractParser() { + public ReceivedMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new ReceivedMessage(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.ReceivedMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java new file mode 100644 index 000000000000..c832555d57a4 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java @@ -0,0 +1,52 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface ReceivedMessageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ReceivedMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * 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 METHOD_CREATE_SUBSCRIPTION = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Subscriber", "CreateSubscription"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.Subscription.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.Subscription.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_GET_SUBSCRIPTION = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Subscriber", "GetSubscription"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.GetSubscriptionRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.Subscription.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_LIST_SUBSCRIPTIONS = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Subscriber", "ListSubscriptions"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ListSubscriptionsRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ListSubscriptionsResponse.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_DELETE_SUBSCRIPTION = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Subscriber", "DeleteSubscription"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.DeleteSubscriptionRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_MODIFY_ACK_DEADLINE = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Subscriber", "ModifyAckDeadline"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ModifyAckDeadlineRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_ACKNOWLEDGE = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Subscriber", "Acknowledge"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_PULL = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Subscriber", "Pull"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.PullRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.PullResponse.getDefaultInstance())); + @io.grpc.ExperimentalApi + public static final io.grpc.MethodDescriptor METHOD_MODIFY_PUSH_CONFIG = + io.grpc.MethodDescriptor.create( + io.grpc.MethodDescriptor.MethodType.UNARY, + generateFullMethodName( + "google.pubsub.v1.Subscriber", "ModifyPushConfig"), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.pubsub.v1.ModifyPushConfigRequest.getDefaultInstance()), + io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance())); + + public static SubscriberStub newStub(io.grpc.Channel channel) { + return new SubscriberStub(channel); + } + + public static SubscriberBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new SubscriberBlockingStub(channel); + } + + public static SubscriberFutureStub newFutureStub( + io.grpc.Channel channel) { + return new SubscriberFutureStub(channel); + } + + public static interface Subscriber { + + public void createSubscription(com.google.pubsub.v1.Subscription request, + io.grpc.stub.StreamObserver responseObserver); + + public void getSubscription(com.google.pubsub.v1.GetSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver); + + public void listSubscriptions(com.google.pubsub.v1.ListSubscriptionsRequest request, + io.grpc.stub.StreamObserver responseObserver); + + public void deleteSubscription(com.google.pubsub.v1.DeleteSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver); + + public void modifyAckDeadline(com.google.pubsub.v1.ModifyAckDeadlineRequest request, + io.grpc.stub.StreamObserver responseObserver); + + public void acknowledge(com.google.pubsub.v1.AcknowledgeRequest request, + io.grpc.stub.StreamObserver responseObserver); + + public void pull(com.google.pubsub.v1.PullRequest request, + io.grpc.stub.StreamObserver responseObserver); + + public void modifyPushConfig(com.google.pubsub.v1.ModifyPushConfigRequest request, + io.grpc.stub.StreamObserver responseObserver); + } + + public static interface SubscriberBlockingClient { + + public com.google.pubsub.v1.Subscription createSubscription(com.google.pubsub.v1.Subscription request); + + public com.google.pubsub.v1.Subscription getSubscription(com.google.pubsub.v1.GetSubscriptionRequest request); + + public com.google.pubsub.v1.ListSubscriptionsResponse listSubscriptions(com.google.pubsub.v1.ListSubscriptionsRequest request); + + public com.google.protobuf.Empty deleteSubscription(com.google.pubsub.v1.DeleteSubscriptionRequest request); + + public com.google.protobuf.Empty modifyAckDeadline(com.google.pubsub.v1.ModifyAckDeadlineRequest request); + + public com.google.protobuf.Empty acknowledge(com.google.pubsub.v1.AcknowledgeRequest request); + + public com.google.pubsub.v1.PullResponse pull(com.google.pubsub.v1.PullRequest request); + + public com.google.protobuf.Empty modifyPushConfig(com.google.pubsub.v1.ModifyPushConfigRequest request); + } + + public static interface SubscriberFutureClient { + + public com.google.common.util.concurrent.ListenableFuture createSubscription( + com.google.pubsub.v1.Subscription request); + + public com.google.common.util.concurrent.ListenableFuture getSubscription( + com.google.pubsub.v1.GetSubscriptionRequest request); + + public com.google.common.util.concurrent.ListenableFuture listSubscriptions( + com.google.pubsub.v1.ListSubscriptionsRequest request); + + public com.google.common.util.concurrent.ListenableFuture deleteSubscription( + com.google.pubsub.v1.DeleteSubscriptionRequest request); + + public com.google.common.util.concurrent.ListenableFuture modifyAckDeadline( + com.google.pubsub.v1.ModifyAckDeadlineRequest request); + + public com.google.common.util.concurrent.ListenableFuture acknowledge( + com.google.pubsub.v1.AcknowledgeRequest request); + + public com.google.common.util.concurrent.ListenableFuture pull( + com.google.pubsub.v1.PullRequest request); + + public com.google.common.util.concurrent.ListenableFuture modifyPushConfig( + com.google.pubsub.v1.ModifyPushConfigRequest request); + } + + public static class SubscriberStub extends io.grpc.stub.AbstractStub + implements Subscriber { + private SubscriberStub(io.grpc.Channel channel) { + super(channel); + } + + private SubscriberStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SubscriberStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new SubscriberStub(channel, callOptions); + } + + @java.lang.Override + public void createSubscription(com.google.pubsub.v1.Subscription request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_CREATE_SUBSCRIPTION, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void getSubscription(com.google.pubsub.v1.GetSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_GET_SUBSCRIPTION, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void listSubscriptions(com.google.pubsub.v1.ListSubscriptionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_LIST_SUBSCRIPTIONS, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void deleteSubscription(com.google.pubsub.v1.DeleteSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_DELETE_SUBSCRIPTION, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void modifyAckDeadline(com.google.pubsub.v1.ModifyAckDeadlineRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_MODIFY_ACK_DEADLINE, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void acknowledge(com.google.pubsub.v1.AcknowledgeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_ACKNOWLEDGE, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void pull(com.google.pubsub.v1.PullRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_PULL, getCallOptions()), request, responseObserver); + } + + @java.lang.Override + public void modifyPushConfig(com.google.pubsub.v1.ModifyPushConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(METHOD_MODIFY_PUSH_CONFIG, getCallOptions()), request, responseObserver); + } + } + + public static class SubscriberBlockingStub extends io.grpc.stub.AbstractStub + implements SubscriberBlockingClient { + private SubscriberBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private SubscriberBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SubscriberBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new SubscriberBlockingStub(channel, callOptions); + } + + @java.lang.Override + public com.google.pubsub.v1.Subscription createSubscription(com.google.pubsub.v1.Subscription request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_CREATE_SUBSCRIPTION, getCallOptions()), request); + } + + @java.lang.Override + public com.google.pubsub.v1.Subscription getSubscription(com.google.pubsub.v1.GetSubscriptionRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_GET_SUBSCRIPTION, getCallOptions()), request); + } + + @java.lang.Override + public com.google.pubsub.v1.ListSubscriptionsResponse listSubscriptions(com.google.pubsub.v1.ListSubscriptionsRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_LIST_SUBSCRIPTIONS, getCallOptions()), request); + } + + @java.lang.Override + public com.google.protobuf.Empty deleteSubscription(com.google.pubsub.v1.DeleteSubscriptionRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_DELETE_SUBSCRIPTION, getCallOptions()), request); + } + + @java.lang.Override + public com.google.protobuf.Empty modifyAckDeadline(com.google.pubsub.v1.ModifyAckDeadlineRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_MODIFY_ACK_DEADLINE, getCallOptions()), request); + } + + @java.lang.Override + public com.google.protobuf.Empty acknowledge(com.google.pubsub.v1.AcknowledgeRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_ACKNOWLEDGE, getCallOptions()), request); + } + + @java.lang.Override + public com.google.pubsub.v1.PullResponse pull(com.google.pubsub.v1.PullRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_PULL, getCallOptions()), request); + } + + @java.lang.Override + public com.google.protobuf.Empty modifyPushConfig(com.google.pubsub.v1.ModifyPushConfigRequest request) { + return blockingUnaryCall( + getChannel().newCall(METHOD_MODIFY_PUSH_CONFIG, getCallOptions()), request); + } + } + + public static class SubscriberFutureStub extends io.grpc.stub.AbstractStub + implements SubscriberFutureClient { + private SubscriberFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private SubscriberFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SubscriberFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new SubscriberFutureStub(channel, callOptions); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture createSubscription( + com.google.pubsub.v1.Subscription request) { + return futureUnaryCall( + getChannel().newCall(METHOD_CREATE_SUBSCRIPTION, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture getSubscription( + com.google.pubsub.v1.GetSubscriptionRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_GET_SUBSCRIPTION, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture listSubscriptions( + com.google.pubsub.v1.ListSubscriptionsRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_LIST_SUBSCRIPTIONS, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture deleteSubscription( + com.google.pubsub.v1.DeleteSubscriptionRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_DELETE_SUBSCRIPTION, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture modifyAckDeadline( + com.google.pubsub.v1.ModifyAckDeadlineRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_MODIFY_ACK_DEADLINE, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture acknowledge( + com.google.pubsub.v1.AcknowledgeRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_ACKNOWLEDGE, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture pull( + com.google.pubsub.v1.PullRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_PULL, getCallOptions()), request); + } + + @java.lang.Override + public com.google.common.util.concurrent.ListenableFuture modifyPushConfig( + com.google.pubsub.v1.ModifyPushConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(METHOD_MODIFY_PUSH_CONFIG, getCallOptions()), request); + } + } + + public static io.grpc.ServerServiceDefinition bindService( + final Subscriber serviceImpl) { + return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME) + .addMethod( + METHOD_CREATE_SUBSCRIPTION, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.Subscription, + com.google.pubsub.v1.Subscription>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.Subscription request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.createSubscription(request, responseObserver); + } + })) + .addMethod( + METHOD_GET_SUBSCRIPTION, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.GetSubscriptionRequest, + com.google.pubsub.v1.Subscription>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.GetSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.getSubscription(request, responseObserver); + } + })) + .addMethod( + METHOD_LIST_SUBSCRIPTIONS, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.ListSubscriptionsRequest, + com.google.pubsub.v1.ListSubscriptionsResponse>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.ListSubscriptionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.listSubscriptions(request, responseObserver); + } + })) + .addMethod( + METHOD_DELETE_SUBSCRIPTION, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.DeleteSubscriptionRequest, + com.google.protobuf.Empty>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.DeleteSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.deleteSubscription(request, responseObserver); + } + })) + .addMethod( + METHOD_MODIFY_ACK_DEADLINE, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.ModifyAckDeadlineRequest, + com.google.protobuf.Empty>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.ModifyAckDeadlineRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.modifyAckDeadline(request, responseObserver); + } + })) + .addMethod( + METHOD_ACKNOWLEDGE, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.AcknowledgeRequest, + com.google.protobuf.Empty>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.AcknowledgeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.acknowledge(request, responseObserver); + } + })) + .addMethod( + METHOD_PULL, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.PullRequest, + com.google.pubsub.v1.PullResponse>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.PullRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.pull(request, responseObserver); + } + })) + .addMethod( + METHOD_MODIFY_PUSH_CONFIG, + asyncUnaryCall( + new io.grpc.stub.ServerCalls.UnaryMethod< + com.google.pubsub.v1.ModifyPushConfigRequest, + com.google.protobuf.Empty>() { + @java.lang.Override + public void invoke( + com.google.pubsub.v1.ModifyPushConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + serviceImpl.modifyPushConfig(request, responseObserver); + } + })).build(); + } +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/Subscription.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/Subscription.java new file mode 100644 index 000000000000..45175301338d --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/Subscription.java @@ -0,0 +1,1038 @@ +// 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.Subscription} + * + *
+ * 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 implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.Subscription) + com.google.pubsub.v1.SubscriptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Subscription_descriptor; + } + + protected com.google.protobuf.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); + } + + // Construct using com.google.pubsub.v1.Subscription.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + topic_ = ""; + + if (pushConfigBuilder_ == null) { + pushConfig_ = null; + } else { + pushConfig_ = null; + pushConfigBuilder_ = null; + } + ackDeadlineSeconds_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Subscription_descriptor; + } + + public com.google.pubsub.v1.Subscription getDefaultInstanceForType() { + return com.google.pubsub.v1.Subscription.getDefaultInstance(); + } + + public com.google.pubsub.v1.Subscription build() { + com.google.pubsub.v1.Subscription result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.Subscription buildPartial() { + com.google.pubsub.v1.Subscription result = new com.google.pubsub.v1.Subscription(this); + result.name_ = name_; + result.topic_ = topic_; + if (pushConfigBuilder_ == null) { + result.pushConfig_ = pushConfig_; + } else { + result.pushConfig_ = pushConfigBuilder_.build(); + } + result.ackDeadlineSeconds_ = ackDeadlineSeconds_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.Subscription) { + return mergeFrom((com.google.pubsub.v1.Subscription)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.Subscription other) { + if (other == com.google.pubsub.v1.Subscription.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + if (other.hasPushConfig()) { + mergePushConfig(other.getPushConfig()); + } + if (other.getAckDeadlineSeconds() != 0) { + setAckDeadlineSeconds(other.getAckDeadlineSeconds()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.Subscription parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.Subscription) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * 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 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; + } + } + /** + * 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 Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * 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 Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * 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 Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object topic_ = ""; + /** + * 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)) { + 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 = 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 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 = 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 Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + * 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 Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + * 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 Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + + private com.google.pubsub.v1.PushConfig pushConfig_ = null; + private com.google.protobuf.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 = 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 pushConfigBuilder_ != null || 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() { + if (pushConfigBuilder_ == null) { + return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; + } else { + return pushConfigBuilder_.getMessage(); + } + } + /** + * 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 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 = 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 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 = 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 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 = 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 Builder clearPushConfig() { + if (pushConfigBuilder_ == null) { + pushConfig_ = null; + onChanged(); + } else { + pushConfig_ = null; + pushConfigBuilder_ = null; + } + + return this; + } + /** + * 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.Builder getPushConfigBuilder() { + + onChanged(); + return getPushConfigFieldBuilder().getBuilder(); + } + /** + * 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() { + if (pushConfigBuilder_ != null) { + return pushConfigBuilder_.getMessageOrBuilder(); + } else { + 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.
+     * 
+ */ + 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_; + } + + 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_; + } + /** + * 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 Builder setAckDeadlineSeconds(int value) { + + ackDeadlineSeconds_ = value; + onChanged(); + return this; + } + /** + * 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 Builder clearAckDeadlineSeconds() { + + ackDeadlineSeconds_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.Subscription) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.Subscription) + private static final com.google.pubsub.v1.Subscription DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.Subscription(); + } + + public static com.google.pubsub.v1.Subscription getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Subscription parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new Subscription(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.Subscription getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java new file mode 100644 index 000000000000..b74cbb696209 --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java @@ -0,0 +1,111 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface SubscriptionOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.Subscription) + com.google.protobuf.MessageOrBuilder { + + /** + * 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"`.
+   * 
+ */ + java.lang.String getName(); + /** + * 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"`.
+   * 
+ */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * 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.
+   * 
+ */ + java.lang.String getTopic(); + /** + * 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.
+   * 
+ */ + com.google.protobuf.ByteString + getTopicBytes(); + + /** + * 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.
+   * 
+ */ + boolean hasPushConfig(); + /** + * 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.
+   * 
+ */ + com.google.pubsub.v1.PushConfig getPushConfig(); + /** + * 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.
+   * 
+ */ + com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder(); + + /** + * 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.
+   * 
+ */ + int getAckDeadlineSeconds(); +} diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/Topic.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/Topic.java new file mode 100644 index 000000000000..d1317aed31ef --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/Topic.java @@ -0,0 +1,511 @@ +// 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.Topic} + * + *
+ * A topic resource.
+ * 
+ */ +public final class Topic extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.Topic) + TopicOrBuilder { + // Use Topic.newBuilder() to construct. + private Topic(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Topic() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private Topic( + 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; + } + } + } + } 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_Topic_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Topic_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.Topic.class, com.google.pubsub.v1.Topic.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * optional string name = 1; + * + *
+   * The name of the topic. It must have the format
+   * `"projects/{project}/topics/{topic}"`. `{topic}` 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 topic. It must have the format
+   * `"projects/{project}/topics/{topic}"`. `{topic}` 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; + } + } + + 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_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + public static com.google.pubsub.v1.Topic parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.Topic 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.Topic parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.pubsub.v1.Topic parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.pubsub.v1.Topic parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.Topic 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.Topic parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.pubsub.v1.Topic 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.Topic parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.pubsub.v1.Topic 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.Topic 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.Topic} + * + *
+   * A topic resource.
+   * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.Topic) + com.google.pubsub.v1.TopicOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Topic_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Topic_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.Topic.class, com.google.pubsub.v1.Topic.Builder.class); + } + + // Construct using com.google.pubsub.v1.Topic.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Topic_descriptor; + } + + public com.google.pubsub.v1.Topic getDefaultInstanceForType() { + return com.google.pubsub.v1.Topic.getDefaultInstance(); + } + + public com.google.pubsub.v1.Topic build() { + com.google.pubsub.v1.Topic result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.pubsub.v1.Topic buildPartial() { + com.google.pubsub.v1.Topic result = new com.google.pubsub.v1.Topic(this); + result.name_ = name_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.Topic) { + return mergeFrom((com.google.pubsub.v1.Topic)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.Topic other) { + if (other == com.google.pubsub.v1.Topic.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.Topic parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.Topic) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * optional string name = 1; + * + *
+     * The name of the topic. It must have the format
+     * `"projects/{project}/topics/{topic}"`. `{topic}` 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)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string name = 1; + * + *
+     * The name of the topic. It must have the format
+     * `"projects/{project}/topics/{topic}"`. `{topic}` 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 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; + } + } + /** + * optional string name = 1; + * + *
+     * The name of the topic. It must have the format
+     * `"projects/{project}/topics/{topic}"`. `{topic}` 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 Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * optional string name = 1; + * + *
+     * The name of the topic. It must have the format
+     * `"projects/{project}/topics/{topic}"`. `{topic}` 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 Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * optional string name = 1; + * + *
+     * The name of the topic. It must have the format
+     * `"projects/{project}/topics/{topic}"`. `{topic}` 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 Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.Topic) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.Topic) + private static final com.google.pubsub.v1.Topic DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.Topic(); + } + + public static com.google.pubsub.v1.Topic getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public Topic parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + try { + return new Topic(input, extensionRegistry); + } catch (RuntimeException e) { + if (e.getCause() instanceof + com.google.protobuf.InvalidProtocolBufferException) { + throw (com.google.protobuf.InvalidProtocolBufferException) + e.getCause(); + } + throw e; + } + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.pubsub.v1.Topic getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/TopicOrBuilder.java b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/TopicOrBuilder.java new file mode 100644 index 000000000000..9a80b8a4512b --- /dev/null +++ b/gcloud-java-pubsub/generated/src/main/java/com/google/pubsub/v1/TopicOrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface TopicOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.Topic) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string name = 1; + * + *
+   * The name of the topic. It must have the format
+   * `"projects/{project}/topics/{topic}"`. `{topic}` 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"`.
+   * 
+ */ + java.lang.String getName(); + /** + * optional string name = 1; + * + *
+   * The name of the topic. It must have the format
+   * `"projects/{project}/topics/{topic}"`. `{topic}` 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"`.
+   * 
+ */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/gcloud-java-pubsub/pom.xml b/gcloud-java-pubsub/pom.xml new file mode 100644 index 000000000000..3bcdd9d68f12 --- /dev/null +++ b/gcloud-java-pubsub/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.gcloud + gcloud-java-pubsub + jar + GCloud Java Pub/Sub + + Java idiomatic client for Google Cloud Pub/Sub. + + + com.google.gcloud + gcloud-java-pom + 0.0.11-SNAPSHOT + + + gcloud-java-pubsub + + + + ${project.groupId} + gcloud-java-gax + ${project.version} + + + io.grpc + grpc-all + 0.9.0 + + + com.google.auto.value + auto-value + 1.1 + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + generate-sources + add-source + + + generated/src/main + + + + + + + + From 0d28942058bd232f104cbf50e003bdcba36b7cb7 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Wed, 4 Nov 2015 16:16:37 -0800 Subject: [PATCH 2/2] Adding all sections to readme, with TODOs for missing content --- gcloud-java-pubsub/README.md | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/gcloud-java-pubsub/README.md b/gcloud-java-pubsub/README.md index 29d6990d18a2..70393a4b7998 100644 --- a/gcloud-java-pubsub/README.md +++ b/gcloud-java-pubsub/README.md @@ -23,3 +23,62 @@ Add this to your pom.xml file 0.0.10 ``` + +Example Application +------------------- +TODO + +Authentication +-------------- + +See the [Authentication](https://github.com/GoogleCloudPlatform/gcloud-java#authentication) section in the base directory's README. + +About Google Cloud Pub/Sub +-------------------------- + +[Google Cloud Pub/Sub][cloud-pubsub] is designed to provide reliable, +many-to-many, asynchronous messaging between applications. Publisher +applications can send messages to a ``topic`` and other applications can +subscribe to that topic to receive the messages. By decoupling senders and +receivers, Google Cloud Pub/Sub allows developers to communicate between +independently written applications. + +TODO: link to docs on activating Pub/Sub, high-level documentation on +the API, and code snippet + +Java Versions +------------- + +Java 7 or above is required for using this client. + +Testing +------- + +TODO + +Versioning +---------- + +This library follows [Semantic Versioning] (http://semver.org/). + +It is currently in major version zero (``0.y.z``), which means that anything +may change at any time and the public API should not be considered +stable. + +Contributing +------------ + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING] for more information on how to get started. + +License +------- + +Apache 2.0 - See [LICENSE] for more information. + + +[CONTRIBUTING]:https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/CONTRIBUTING.md +[LICENSE]: https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/LICENSE + +[cloud-pubsub]: https://cloud.google.com/storage/