Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: upgrade Java microgenerator to v2.2.1 #890

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -210,7 +210,7 @@ public final Schema createSchema(ProjectName parent, Schema schema, String schem
*
* <pre>{@code
* try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
* String parent = ProjectName.of("[PROJECT]").toString();
* String parent = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
* Schema schema = Schema.newBuilder().build();
* String schemaId = "schemaId-697673060";
* Schema response = schemaServiceClient.createSchema(parent, schema, schemaId);
Expand Down Expand Up @@ -248,7 +248,7 @@ public final Schema createSchema(String parent, Schema schema, String schemaId)
* try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
* CreateSchemaRequest request =
* CreateSchemaRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setParent(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
* .setSchema(Schema.newBuilder().build())
* .setSchemaId("schemaId-697673060")
* .build();
Expand All @@ -273,7 +273,7 @@ public final Schema createSchema(CreateSchemaRequest request) {
* try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
* CreateSchemaRequest request =
* CreateSchemaRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setParent(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
* .setSchema(Schema.newBuilder().build())
* .setSchemaId("schemaId-697673060")
* .build();
Expand Down Expand Up @@ -473,7 +473,7 @@ public final ListSchemasPagedResponse listSchemas(ListSchemasRequest request) {
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture<ListSchemasPagedResponse> future = schemaServiceClient.listSchemasPagedCallable().futureCall(request);
* ApiFuture<Schema> future = schemaServiceClient.listSchemasPagedCallable().futureCall(request);
* // Do something.
* for (Schema element : future.get().iterateAll()) {
* // doThingsWith(element);
Expand Down Expand Up @@ -503,7 +503,7 @@ public final ListSchemasPagedResponse listSchemas(ListSchemasRequest request) {
* .build();
* while (true) {
* ListSchemasResponse response = schemaServiceClient.listSchemasCallable().call(request);
* for (Schema element : response.getSchemasList()) {
* for (Schema element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -27,8 +27,6 @@
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.pubsub.v1.stub.PublisherStub;
import com.google.cloud.pubsub.v1.stub.PublisherStubSettings;
import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
Expand All @@ -47,7 +45,6 @@
import com.google.pubsub.v1.ListTopicsRequest;
import com.google.pubsub.v1.ListTopicsResponse;
import com.google.pubsub.v1.ProjectName;
import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.ProjectTopicName;
import com.google.pubsub.v1.PublishRequest;
import com.google.pubsub.v1.PublishResponse;
Expand Down Expand Up @@ -666,7 +663,7 @@ public final ListTopicsPagedResponse listTopics(ListTopicsRequest request) {
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture<ListTopicsPagedResponse> future = topicAdminClient.listTopicsPagedCallable().futureCall(request);
* ApiFuture<Topic> future = topicAdminClient.listTopicsPagedCallable().futureCall(request);
* // Do something.
* for (Topic element : future.get().iterateAll()) {
* // doThingsWith(element);
Expand Down Expand Up @@ -694,7 +691,7 @@ public final UnaryCallable<ListTopicsRequest, ListTopicsPagedResponse> listTopic
* .build();
* while (true) {
* ListTopicsResponse response = topicAdminClient.listTopicsCallable().call(request);
* for (Topic element : response.getTopicsList()) {
* for (Topic element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -834,7 +831,7 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture<ListTopicSubscriptionsPagedResponse> future =
* ApiFuture<String> future =
* topicAdminClient.listTopicSubscriptionsPagedCallable().futureCall(request);
* // Do something.
* for (String element : future.get().iterateAll()) {
Expand Down Expand Up @@ -865,7 +862,7 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(
* while (true) {
* ListTopicSubscriptionsResponse response =
* topicAdminClient.listTopicSubscriptionsCallable().call(request);
* for (String element : response.getSubscriptionsList()) {
* for (String element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -989,7 +986,7 @@ public final ListTopicSnapshotsPagedResponse listTopicSnapshots(
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture<ListTopicSnapshotsPagedResponse> future =
* ApiFuture<String> future =
* topicAdminClient.listTopicSnapshotsPagedCallable().futureCall(request);
* // Do something.
* for (String element : future.get().iterateAll()) {
Expand Down Expand Up @@ -1023,7 +1020,7 @@ public final ListTopicSnapshotsPagedResponse listTopicSnapshots(
* while (true) {
* ListTopicSnapshotsResponse response =
* topicAdminClient.listTopicSnapshotsCallable().call(request);
* for (String element : response.getSnapshotsList()) {
* for (String element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1183,7 +1180,7 @@ public final UnaryCallable<DeleteTopicRequest, Empty> deleteTopicCallable() {
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
* DetachSubscriptionRequest request =
* DetachSubscriptionRequest.newBuilder()
* .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .build();
* DetachSubscriptionResponse response = topicAdminClient.detachSubscription(request);
* }
Expand All @@ -1208,7 +1205,7 @@ public final DetachSubscriptionResponse detachSubscription(DetachSubscriptionReq
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
* DetachSubscriptionRequest request =
* DetachSubscriptionRequest.newBuilder()
* .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .build();
* ApiFuture<DetachSubscriptionResponse> future =
* topicAdminClient.detachSubscriptionCallable().futureCall(request);
Expand Down Expand Up @@ -1600,17 +1597,6 @@ public static ApiFuture<ListTopicSubscriptionsPagedResponse> createAsync(
private ListTopicSubscriptionsPagedResponse(ListTopicSubscriptionsPage page) {
super(page, ListTopicSubscriptionsFixedSizeCollection.createEmptyCollection());
}

public Iterable<ProjectSubscriptionName> iterateAllAsProjectSubscriptionName() {
return Iterables.transform(
iterateAll(),
new Function<String, ProjectSubscriptionName>() {
@Override
public ProjectSubscriptionName apply(String arg0) {
return ProjectSubscriptionName.parse(arg0);
}
});
}
}

public static class ListTopicSubscriptionsPage
Expand Down Expand Up @@ -1643,28 +1629,6 @@ public ApiFuture<ListTopicSubscriptionsPage> createPageAsync(
ApiFuture<ListTopicSubscriptionsResponse> futureResponse) {
return super.createPageAsync(context, futureResponse);
}

public Iterable<ProjectSubscriptionName> iterateAllAsProjectSubscriptionName() {
return Iterables.transform(
iterateAll(),
new Function<String, ProjectSubscriptionName>() {
@Override
public ProjectSubscriptionName apply(String arg0) {
return ProjectSubscriptionName.parse(arg0);
}
});
}

public Iterable<ProjectSubscriptionName> getValuesAsProjectSubscriptionName() {
return Iterables.transform(
getValues(),
new Function<String, ProjectSubscriptionName>() {
@Override
public ProjectSubscriptionName apply(String arg0) {
return ProjectSubscriptionName.parse(arg0);
}
});
}
}

public static class ListTopicSubscriptionsFixedSizeCollection
Expand All @@ -1689,17 +1653,6 @@ protected ListTopicSubscriptionsFixedSizeCollection createCollection(
List<ListTopicSubscriptionsPage> pages, int collectionSize) {
return new ListTopicSubscriptionsFixedSizeCollection(pages, collectionSize);
}

public Iterable<ProjectSubscriptionName> getValuesAsProjectSubscriptionName() {
return Iterables.transform(
getValues(),
new Function<String, ProjectSubscriptionName>() {
@Override
public ProjectSubscriptionName apply(String arg0) {
return ProjectSubscriptionName.parse(arg0);
}
});
}
}

public static class ListTopicSnapshotsPagedResponse
Expand Down
Expand Up @@ -43,7 +43,7 @@
*
* <pre>{@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
* PushConfig pushConfig = PushConfig.newBuilder().build();
* int ackDeadlineSeconds = 2135351438;
Expand Down
Expand Up @@ -369,7 +369,7 @@ protected GrpcPublisherStub(
callableFactory.createUnaryCallable(
updateTopicTransportSettings, settings.updateTopicSettings(), clientContext);
this.publishCallable =
callableFactory.createUnaryCallable(
callableFactory.createBatchingCallable(
publishTransportSettings, settings.publishSettings(), clientContext);
this.getTopicCallable =
callableFactory.createUnaryCallable(
Expand Down