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(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override 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.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
@Override public List<SubscriptionPath> listSubscriptions(ProjectPath project, TopicPath topic) throws IOException { ListSubscriptionsRequest.Builder request = ListSubscriptionsRequest.newBuilder() .setProject(project.getPath()) .setPageSize(LIST_BATCH_SIZE); ListSubscriptionsResponse response = subscriberStub().listSubscriptions(request.build()); if (response.getSubscriptionsCount() == 0) { return ImmutableList.of(); } List<SubscriptionPath> subscriptions = new ArrayList<>(response.getSubscriptionsCount()); while (true) { for (Subscription subscription : response.getSubscriptionsList()) { if (subscription.getTopic().equals(topic.getPath())) { subscriptions.add(subscriptionPathFromPath(subscription.getName())); } } if (response.getNextPageToken().isEmpty()) { break; } request.setPageToken(response.getNextPageToken()); response = subscriberStub().listSubscriptions(request.build()); } return subscriptions; }
/** * * * <pre> * 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. * </pre> * * <code>string page_token = 3;</code> */ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); pageToken_ = value; onChanged(); return this; }
/** * <pre> * 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. * </pre> * * <code>optional string page_token = 3;</code> */ public Builder setPageToken( java.lang.String value) { if (value == null) { throw new NullPointerException(); } pageToken_ = value; onChanged(); return this; } /**
/** * <code>optional string page_token = 3;</code> * * <pre> * 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. * </pre> */ 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(
/** * <pre> * 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. * </pre> * * <code>optional string page_token = 3;</code> */ 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(
/** * * * <pre> * 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. * </pre> * * <code>string page_token = 3;</code> */ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } pageToken_ = value; onChanged(); return this; } /**
/** * <code>optional string page_token = 3;</code> * * <pre> * 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. * </pre> */ public Builder setPageToken( java.lang.String value) { if (value == null) { throw new NullPointerException(); } pageToken_ = value; onChanged(); return this; } /**
/** * * * <pre> * The name of the project in which to list subscriptions. * Format is `projects/{project-id}`. * </pre> * * <code>string project = 1;</code> */ public Builder setProjectBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); project_ = value; onChanged(); return this; }
/** * <code>optional string project = 1;</code> * * <pre> * The name of the cloud project that subscriptions belong to. * </pre> */ public Builder setProject( java.lang.String value) { if (value == null) { throw new NullPointerException(); } project_ = value; onChanged(); return this; } /**
/** * <pre> * The name of the cloud project that subscriptions belong to. * </pre> * * <code>optional string project = 1;</code> */ public Builder setProject( java.lang.String value) { if (value == null) { throw new NullPointerException(); } project_ = value; onChanged(); return this; } /**
@java.lang.Override 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.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * <code>optional string project = 1;</code> * * <pre> * The name of the cloud project that subscriptions belong to. * </pre> */ public Builder setProjectBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); project_ = value; onChanged(); return this; }
/** * <pre> * The name of the cloud project that subscriptions belong to. * </pre> * * <code>optional string project = 1;</code> */ public Builder setProjectBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); project_ = value; onChanged(); return this; }
/** * * * <pre> * 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. * </pre> * * <code>string page_token = 3;</code> */ public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); onChanged(); return this; } /**
/** * * * <pre> * The name of the project in which to list subscriptions. * Format is `projects/{project-id}`. * </pre> * * <code>string project = 1;</code> */ public Builder setProject(java.lang.String value) { if (value == null) { throw new NullPointerException(); } project_ = value; onChanged(); 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(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
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; }
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.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }