commitSchemaCallable() {
+ return stub.commitSchemaCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new schema revision that is a copy of the provided revision_id.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ * SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
+ * String revisionId = "revisionId-1507445162";
+ * Schema response = schemaServiceClient.rollbackSchema(name, revisionId);
+ * }
+ * }
+ *
+ * @param name Required. The schema being rolled back with revision id.
+ * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same
+ * schema.
+ * Example: c7cfa2a8
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Schema rollbackSchema(SchemaName name, String revisionId) {
+ RollbackSchemaRequest request =
+ RollbackSchemaRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setRevisionId(revisionId)
+ .build();
+ return rollbackSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new schema revision that is a copy of the provided revision_id.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ * String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
+ * String revisionId = "revisionId-1507445162";
+ * Schema response = schemaServiceClient.rollbackSchema(name, revisionId);
+ * }
+ * }
+ *
+ * @param name Required. The schema being rolled back with revision id.
+ * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same
+ * schema.
+ * Example: c7cfa2a8
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Schema rollbackSchema(String name, String revisionId) {
+ RollbackSchemaRequest request =
+ RollbackSchemaRequest.newBuilder().setName(name).setRevisionId(revisionId).build();
+ return rollbackSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new schema revision that is a copy of the provided revision_id.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ * RollbackSchemaRequest request =
+ * RollbackSchemaRequest.newBuilder()
+ * .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
+ * .setRevisionId("revisionId-1507445162")
+ * .build();
+ * Schema response = schemaServiceClient.rollbackSchema(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Schema rollbackSchema(RollbackSchemaRequest request) {
+ return rollbackSchemaCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new schema revision that is a copy of the provided revision_id.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ * RollbackSchemaRequest request =
+ * RollbackSchemaRequest.newBuilder()
+ * .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
+ * .setRevisionId("revisionId-1507445162")
+ * .build();
+ * ApiFuture future = schemaServiceClient.rollbackSchemaCallable().futureCall(request);
+ * // Do something.
+ * Schema response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable rollbackSchemaCallable() {
+ return stub.rollbackSchemaCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specific schema revision.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ * SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
+ * String revisionId = "revisionId-1507445162";
+ * Schema response = schemaServiceClient.deleteSchemaRevision(name, revisionId);
+ * }
+ * }
+ *
+ * @param name Required. The name of the schema revision to be deleted, with a revision ID
+ * explicitly included.
+ * Example: projects/123/schemas/my-schema{@literal @}c7cfa2a8
+ * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same
+ * schema.
+ *
Example: c7cfa2a8
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Schema deleteSchemaRevision(SchemaName name, String revisionId) {
+ DeleteSchemaRevisionRequest request =
+ DeleteSchemaRevisionRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setRevisionId(revisionId)
+ .build();
+ return deleteSchemaRevision(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specific schema revision.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ * String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
+ * String revisionId = "revisionId-1507445162";
+ * Schema response = schemaServiceClient.deleteSchemaRevision(name, revisionId);
+ * }
+ * }
+ *
+ * @param name Required. The name of the schema revision to be deleted, with a revision ID
+ * explicitly included.
+ * Example: projects/123/schemas/my-schema{@literal @}c7cfa2a8
+ * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same
+ * schema.
+ *
Example: c7cfa2a8
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Schema deleteSchemaRevision(String name, String revisionId) {
+ DeleteSchemaRevisionRequest request =
+ DeleteSchemaRevisionRequest.newBuilder().setName(name).setRevisionId(revisionId).build();
+ return deleteSchemaRevision(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specific schema revision.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ * DeleteSchemaRevisionRequest request =
+ * DeleteSchemaRevisionRequest.newBuilder()
+ * .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
+ * .setRevisionId("revisionId-1507445162")
+ * .build();
+ * Schema response = schemaServiceClient.deleteSchemaRevision(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Schema deleteSchemaRevision(DeleteSchemaRevisionRequest request) {
+ return deleteSchemaRevisionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specific schema revision.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ * DeleteSchemaRevisionRequest request =
+ * DeleteSchemaRevisionRequest.newBuilder()
+ * .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
+ * .setRevisionId("revisionId-1507445162")
+ * .build();
+ * ApiFuture future =
+ * schemaServiceClient.deleteSchemaRevisionCallable().futureCall(request);
+ * // Do something.
+ * Schema response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable deleteSchemaRevisionCallable() {
+ return stub.deleteSchemaRevisionCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a schema.
@@ -1199,4 +1739,84 @@ protected ListSchemasFixedSizeCollection createCollection(
return new ListSchemasFixedSizeCollection(pages, collectionSize);
}
}
+
+ public static class ListSchemaRevisionsPagedResponse
+ extends AbstractPagedListResponse<
+ ListSchemaRevisionsRequest,
+ ListSchemaRevisionsResponse,
+ Schema,
+ ListSchemaRevisionsPage,
+ ListSchemaRevisionsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListSchemaRevisionsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListSchemaRevisionsPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListSchemaRevisionsPagedResponse(ListSchemaRevisionsPage page) {
+ super(page, ListSchemaRevisionsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListSchemaRevisionsPage
+ extends AbstractPage<
+ ListSchemaRevisionsRequest,
+ ListSchemaRevisionsResponse,
+ Schema,
+ ListSchemaRevisionsPage> {
+
+ private ListSchemaRevisionsPage(
+ PageContext context,
+ ListSchemaRevisionsResponse response) {
+ super(context, response);
+ }
+
+ private static ListSchemaRevisionsPage createEmptyPage() {
+ return new ListSchemaRevisionsPage(null, null);
+ }
+
+ @Override
+ protected ListSchemaRevisionsPage createPage(
+ PageContext context,
+ ListSchemaRevisionsResponse response) {
+ return new ListSchemaRevisionsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListSchemaRevisionsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListSchemaRevisionsRequest,
+ ListSchemaRevisionsResponse,
+ Schema,
+ ListSchemaRevisionsPage,
+ ListSchemaRevisionsFixedSizeCollection> {
+
+ private ListSchemaRevisionsFixedSizeCollection(
+ List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListSchemaRevisionsFixedSizeCollection createEmptyCollection() {
+ return new ListSchemaRevisionsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListSchemaRevisionsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListSchemaRevisionsFixedSizeCollection(pages, collectionSize);
+ }
+ }
}
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java
index 4d13f3660..e01dbf09c 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java
@@ -16,6 +16,7 @@
package com.google.cloud.pubsub.v1;
+import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse;
import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse;
import com.google.api.core.ApiFunction;
@@ -37,11 +38,16 @@
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.protobuf.Empty;
+import com.google.pubsub.v1.CommitSchemaRequest;
import com.google.pubsub.v1.CreateSchemaRequest;
import com.google.pubsub.v1.DeleteSchemaRequest;
+import com.google.pubsub.v1.DeleteSchemaRevisionRequest;
import com.google.pubsub.v1.GetSchemaRequest;
+import com.google.pubsub.v1.ListSchemaRevisionsRequest;
+import com.google.pubsub.v1.ListSchemaRevisionsResponse;
import com.google.pubsub.v1.ListSchemasRequest;
import com.google.pubsub.v1.ListSchemasResponse;
+import com.google.pubsub.v1.RollbackSchemaRequest;
import com.google.pubsub.v1.Schema;
import com.google.pubsub.v1.ValidateMessageRequest;
import com.google.pubsub.v1.ValidateMessageResponse;
@@ -78,7 +84,10 @@
* schemaServiceSettingsBuilder
* .createSchemaSettings()
* .setRetrySettings(
- * schemaServiceSettingsBuilder.createSchemaSettings().getRetrySettings().toBuilder()
+ * schemaServiceSettingsBuilder
+ * .createSchemaSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build();
@@ -103,6 +112,28 @@ public UnaryCallSettings getSchemaSettings() {
return ((SchemaServiceStubSettings) getStubSettings()).listSchemasSettings();
}
+ /** Returns the object with the settings used for calls to listSchemaRevisions. */
+ public PagedCallSettings<
+ ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse>
+ listSchemaRevisionsSettings() {
+ return ((SchemaServiceStubSettings) getStubSettings()).listSchemaRevisionsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to commitSchema. */
+ public UnaryCallSettings commitSchemaSettings() {
+ return ((SchemaServiceStubSettings) getStubSettings()).commitSchemaSettings();
+ }
+
+ /** Returns the object with the settings used for calls to rollbackSchema. */
+ public UnaryCallSettings rollbackSchemaSettings() {
+ return ((SchemaServiceStubSettings) getStubSettings()).rollbackSchemaSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteSchemaRevision. */
+ public UnaryCallSettings deleteSchemaRevisionSettings() {
+ return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaRevisionSettings();
+ }
+
/** Returns the object with the settings used for calls to deleteSchema. */
public UnaryCallSettings deleteSchemaSettings() {
return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaSettings();
@@ -267,6 +298,31 @@ public UnaryCallSettings.Builder getSchemaSettings() {
return getStubSettingsBuilder().listSchemasSettings();
}
+ /** Returns the builder for the settings used for calls to listSchemaRevisions. */
+ public PagedCallSettings.Builder<
+ ListSchemaRevisionsRequest,
+ ListSchemaRevisionsResponse,
+ ListSchemaRevisionsPagedResponse>
+ listSchemaRevisionsSettings() {
+ return getStubSettingsBuilder().listSchemaRevisionsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to commitSchema. */
+ public UnaryCallSettings.Builder commitSchemaSettings() {
+ return getStubSettingsBuilder().commitSchemaSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to rollbackSchema. */
+ public UnaryCallSettings.Builder rollbackSchemaSettings() {
+ return getStubSettingsBuilder().rollbackSchemaSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteSchemaRevision. */
+ public UnaryCallSettings.Builder
+ deleteSchemaRevisionSettings() {
+ return getStubSettingsBuilder().deleteSchemaRevisionSettings();
+ }
+
/** Returns the builder for the settings used for calls to deleteSchema. */
public UnaryCallSettings.Builder deleteSchemaSettings() {
return getStubSettingsBuilder().deleteSchemaSettings();
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java
index 4370109a2..74157333a 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java
@@ -161,10 +161,7 @@
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* SubscriptionAdminSettings subscriptionAdminSettings =
- * SubscriptionAdminSettings.newBuilder()
- * .setTransportChannelProvider(
- * SubscriptionAdminSettings.defaultHttpJsonTransportProviderBuilder().build())
- * .build();
+ * SubscriptionAdminSettings.newHttpJsonBuilder().build();
* SubscriptionAdminClient subscriptionAdminClient =
* SubscriptionAdminClient.create(subscriptionAdminSettings);
* }
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java
index 8d9b5f91b..7a39d7bd6 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java
@@ -139,11 +139,7 @@
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * TopicAdminSettings topicAdminSettings =
- * TopicAdminSettings.newBuilder()
- * .setTransportChannelProvider(
- * TopicAdminSettings.defaultHttpJsonTransportProviderBuilder().build())
- * .build();
+ * TopicAdminSettings topicAdminSettings = TopicAdminSettings.newHttpJsonBuilder().build();
* TopicAdminClient topicAdminClient = TopicAdminClient.create(topicAdminSettings);
* }
*
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java
index adc9e92c5..b18ecf1ca 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java
@@ -85,7 +85,10 @@
* topicAdminSettingsBuilder
* .createTopicSettings()
* .setRetrySettings(
- * topicAdminSettingsBuilder.createTopicSettings().getRetrySettings().toBuilder()
+ * topicAdminSettingsBuilder
+ * .createTopicSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* TopicAdminSettings topicAdminSettings = topicAdminSettingsBuilder.build();
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json
index 8efac12d0..ff5a589d6 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json
@@ -121,21 +121,33 @@
"grpc": {
"libraryClient": "SchemaServiceClient",
"rpcs": {
+ "CommitSchema": {
+ "methods": ["commitSchema", "commitSchema", "commitSchema", "commitSchemaCallable"]
+ },
"CreateSchema": {
"methods": ["createSchema", "createSchema", "createSchema", "createSchemaCallable"]
},
"DeleteSchema": {
"methods": ["deleteSchema", "deleteSchema", "deleteSchema", "deleteSchemaCallable"]
},
+ "DeleteSchemaRevision": {
+ "methods": ["deleteSchemaRevision", "deleteSchemaRevision", "deleteSchemaRevision", "deleteSchemaRevisionCallable"]
+ },
"GetIamPolicy": {
"methods": ["getIamPolicy", "getIamPolicyCallable"]
},
"GetSchema": {
"methods": ["getSchema", "getSchema", "getSchema", "getSchemaCallable"]
},
+ "ListSchemaRevisions": {
+ "methods": ["listSchemaRevisions", "listSchemaRevisions", "listSchemaRevisions", "listSchemaRevisionsPagedCallable", "listSchemaRevisionsCallable"]
+ },
"ListSchemas": {
"methods": ["listSchemas", "listSchemas", "listSchemas", "listSchemasPagedCallable", "listSchemasCallable"]
},
+ "RollbackSchema": {
+ "methods": ["rollbackSchema", "rollbackSchema", "rollbackSchema", "rollbackSchemaCallable"]
+ },
"SetIamPolicy": {
"methods": ["setIamPolicy", "setIamPolicyCallable"]
},
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java
index 4d06023b7..aa4a91eb2 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java
@@ -16,6 +16,7 @@
package com.google.cloud.pubsub.v1.stub;
+import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse;
import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse;
import com.google.api.gax.core.BackgroundResource;
@@ -32,11 +33,16 @@
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
+import com.google.pubsub.v1.CommitSchemaRequest;
import com.google.pubsub.v1.CreateSchemaRequest;
import com.google.pubsub.v1.DeleteSchemaRequest;
+import com.google.pubsub.v1.DeleteSchemaRevisionRequest;
import com.google.pubsub.v1.GetSchemaRequest;
+import com.google.pubsub.v1.ListSchemaRevisionsRequest;
+import com.google.pubsub.v1.ListSchemaRevisionsResponse;
import com.google.pubsub.v1.ListSchemasRequest;
import com.google.pubsub.v1.ListSchemasResponse;
+import com.google.pubsub.v1.RollbackSchemaRequest;
import com.google.pubsub.v1.Schema;
import com.google.pubsub.v1.ValidateMessageRequest;
import com.google.pubsub.v1.ValidateMessageResponse;
@@ -82,6 +88,45 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub {
ProtoUtils.marshaller(ListSchemasResponse.getDefaultInstance()))
.build();
+ private static final MethodDescriptor
+ listSchemaRevisionsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.pubsub.v1.SchemaService/ListSchemaRevisions")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ListSchemaRevisionsRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListSchemaRevisionsResponse.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor commitSchemaMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.pubsub.v1.SchemaService/CommitSchema")
+ .setRequestMarshaller(ProtoUtils.marshaller(CommitSchemaRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ rollbackSchemaMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.pubsub.v1.SchemaService/RollbackSchema")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(RollbackSchemaRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ deleteSchemaRevisionMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.pubsub.v1.SchemaService/DeleteSchemaRevision")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(DeleteSchemaRevisionRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance()))
+ .build();
+
private static final MethodDescriptor deleteSchemaMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
@@ -144,6 +189,13 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub {
private final UnaryCallable listSchemasCallable;
private final UnaryCallable
listSchemasPagedCallable;
+ private final UnaryCallable
+ listSchemaRevisionsCallable;
+ private final UnaryCallable
+ listSchemaRevisionsPagedCallable;
+ private final UnaryCallable commitSchemaCallable;
+ private final UnaryCallable rollbackSchemaCallable;
+ private final UnaryCallable deleteSchemaRevisionCallable;
private final UnaryCallable deleteSchemaCallable;
private final UnaryCallable validateSchemaCallable;
private final UnaryCallable
@@ -225,6 +277,47 @@ protected GrpcSchemaServiceStub(
return params.build();
})
.build();
+ GrpcCallSettings
+ listSchemaRevisionsTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listSchemaRevisionsMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("name", String.valueOf(request.getName()));
+ return params.build();
+ })
+ .build();
+ GrpcCallSettings commitSchemaTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(commitSchemaMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("name", String.valueOf(request.getName()));
+ return params.build();
+ })
+ .build();
+ GrpcCallSettings rollbackSchemaTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(rollbackSchemaMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("name", String.valueOf(request.getName()));
+ return params.build();
+ })
+ .build();
+ GrpcCallSettings deleteSchemaRevisionTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(deleteSchemaRevisionMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("name", String.valueOf(request.getName()));
+ return params.build();
+ })
+ .build();
GrpcCallSettings deleteSchemaTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteSchemaMethodDescriptor)
@@ -301,6 +394,27 @@ protected GrpcSchemaServiceStub(
this.listSchemasPagedCallable =
callableFactory.createPagedCallable(
listSchemasTransportSettings, settings.listSchemasSettings(), clientContext);
+ this.listSchemaRevisionsCallable =
+ callableFactory.createUnaryCallable(
+ listSchemaRevisionsTransportSettings,
+ settings.listSchemaRevisionsSettings(),
+ clientContext);
+ this.listSchemaRevisionsPagedCallable =
+ callableFactory.createPagedCallable(
+ listSchemaRevisionsTransportSettings,
+ settings.listSchemaRevisionsSettings(),
+ clientContext);
+ this.commitSchemaCallable =
+ callableFactory.createUnaryCallable(
+ commitSchemaTransportSettings, settings.commitSchemaSettings(), clientContext);
+ this.rollbackSchemaCallable =
+ callableFactory.createUnaryCallable(
+ rollbackSchemaTransportSettings, settings.rollbackSchemaSettings(), clientContext);
+ this.deleteSchemaRevisionCallable =
+ callableFactory.createUnaryCallable(
+ deleteSchemaRevisionTransportSettings,
+ settings.deleteSchemaRevisionSettings(),
+ clientContext);
this.deleteSchemaCallable =
callableFactory.createUnaryCallable(
deleteSchemaTransportSettings, settings.deleteSchemaSettings(), clientContext);
@@ -350,6 +464,33 @@ public UnaryCallable listSchemasPa
return listSchemasPagedCallable;
}
+ @Override
+ public UnaryCallable
+ listSchemaRevisionsCallable() {
+ return listSchemaRevisionsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listSchemaRevisionsPagedCallable() {
+ return listSchemaRevisionsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable commitSchemaCallable() {
+ return commitSchemaCallable;
+ }
+
+ @Override
+ public UnaryCallable rollbackSchemaCallable() {
+ return rollbackSchemaCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteSchemaRevisionCallable() {
+ return deleteSchemaRevisionCallable;
+ }
+
@Override
public UnaryCallable deleteSchemaCallable() {
return deleteSchemaCallable;
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java
index 2e42c14c7..f7a458447 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java
@@ -91,12 +91,13 @@ public class HttpJsonPublisherStub extends PublisherStub {
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer = ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearName().build(), false))
+ .toBody("*", request.toBuilder().clearName().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -126,12 +127,13 @@ public class HttpJsonPublisherStub extends PublisherStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().build(), false))
+ .toBody("*", request.toBuilder().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -162,12 +164,13 @@ public class HttpJsonPublisherStub extends PublisherStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearTopic().build(), false))
+ .toBody("*", request.toBuilder().clearTopic().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -197,6 +200,7 @@ public class HttpJsonPublisherStub extends PublisherStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -232,6 +236,7 @@ public class HttpJsonPublisherStub extends PublisherStub {
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -269,6 +274,7 @@ public class HttpJsonPublisherStub extends PublisherStub {
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -304,6 +310,7 @@ public class HttpJsonPublisherStub extends PublisherStub {
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -336,6 +343,7 @@ public class HttpJsonPublisherStub extends PublisherStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -370,6 +378,7 @@ public class HttpJsonPublisherStub extends PublisherStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -407,12 +416,13 @@ public class HttpJsonPublisherStub extends PublisherStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearResource().build(), false))
+ .toBody("*", request.toBuilder().clearResource().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -447,6 +457,7 @@ public class HttpJsonPublisherStub extends PublisherStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -484,12 +495,13 @@ public class HttpJsonPublisherStub extends PublisherStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearResource().build(), false))
+ .toBody("*", request.toBuilder().clearResource().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java
index 5112de2e5..c3a607bf6 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java
@@ -16,6 +16,7 @@
package com.google.cloud.pubsub.v1.stub;
+import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse;
import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse;
import com.google.api.core.BetaApi;
@@ -37,11 +38,16 @@
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.protobuf.Empty;
import com.google.protobuf.TypeRegistry;
+import com.google.pubsub.v1.CommitSchemaRequest;
import com.google.pubsub.v1.CreateSchemaRequest;
import com.google.pubsub.v1.DeleteSchemaRequest;
+import com.google.pubsub.v1.DeleteSchemaRevisionRequest;
import com.google.pubsub.v1.GetSchemaRequest;
+import com.google.pubsub.v1.ListSchemaRevisionsRequest;
+import com.google.pubsub.v1.ListSchemaRevisionsResponse;
import com.google.pubsub.v1.ListSchemasRequest;
import com.google.pubsub.v1.ListSchemasResponse;
+import com.google.pubsub.v1.RollbackSchemaRequest;
import com.google.pubsub.v1.Schema;
import com.google.pubsub.v1.ValidateMessageRequest;
import com.google.pubsub.v1.ValidateMessageResponse;
@@ -89,12 +95,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "schemaId", request.getSchemaId());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("schema", request.getSchema(), false))
+ .toBody("schema", request.getSchema(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -125,6 +132,7 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "view", request.getViewValue());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -161,6 +169,7 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "view", request.getViewValue());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -172,6 +181,152 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
.build())
.build();
+ private static final ApiMethodDescriptor
+ listSchemaRevisionsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.pubsub.v1.SchemaService/ListSchemaRevisions")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/schemas/*}:listRevisions",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ serializer.putQueryParam(fields, "view", request.getViewValue());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListSchemaRevisionsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ commitSchemaMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.pubsub.v1.SchemaService/CommitSchema")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/schemas/*}:commit",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearName().build(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Schema.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ rollbackSchemaMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.pubsub.v1.SchemaService/RollbackSchema")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/schemas/*}:rollback",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearName().build(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Schema.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteSchemaRevisionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.pubsub.v1.SchemaService/DeleteSchemaRevision")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/schemas/*}:deleteRevision",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "revisionId", request.getRevisionId());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Schema.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
private static final ApiMethodDescriptor
deleteSchemaMethodDescriptor =
ApiMethodDescriptor.newBuilder()
@@ -194,6 +349,7 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -227,12 +383,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearParent().build(), false))
+ .toBody("*", request.toBuilder().clearParent().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -263,12 +420,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearParent().build(), false))
+ .toBody("*", request.toBuilder().clearParent().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -303,12 +461,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearResource().build(), false))
+ .toBody("*", request.toBuilder().clearResource().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -343,6 +502,7 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -380,12 +540,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearResource().build(), false))
+ .toBody("*", request.toBuilder().clearResource().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -399,6 +560,13 @@ public class HttpJsonSchemaServiceStub extends SchemaServiceStub {
private final UnaryCallable listSchemasCallable;
private final UnaryCallable
listSchemasPagedCallable;
+ private final UnaryCallable
+ listSchemaRevisionsCallable;
+ private final UnaryCallable
+ listSchemaRevisionsPagedCallable;
+ private final UnaryCallable commitSchemaCallable;
+ private final UnaryCallable rollbackSchemaCallable;
+ private final UnaryCallable deleteSchemaRevisionCallable;
private final UnaryCallable deleteSchemaCallable;
private final UnaryCallable validateSchemaCallable;
private final UnaryCallable
@@ -465,6 +633,29 @@ protected HttpJsonSchemaServiceStub(
.setMethodDescriptor(listSchemasMethodDescriptor)
.setTypeRegistry(typeRegistry)
.build();
+ HttpJsonCallSettings
+ listSchemaRevisionsTransportSettings =
+ HttpJsonCallSettings
+ .newBuilder()
+ .setMethodDescriptor(listSchemaRevisionsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings commitSchemaTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(commitSchemaMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings rollbackSchemaTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(rollbackSchemaMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ deleteSchemaRevisionTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deleteSchemaRevisionMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
HttpJsonCallSettings deleteSchemaTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(deleteSchemaMethodDescriptor)
@@ -511,6 +702,27 @@ protected HttpJsonSchemaServiceStub(
this.listSchemasPagedCallable =
callableFactory.createPagedCallable(
listSchemasTransportSettings, settings.listSchemasSettings(), clientContext);
+ this.listSchemaRevisionsCallable =
+ callableFactory.createUnaryCallable(
+ listSchemaRevisionsTransportSettings,
+ settings.listSchemaRevisionsSettings(),
+ clientContext);
+ this.listSchemaRevisionsPagedCallable =
+ callableFactory.createPagedCallable(
+ listSchemaRevisionsTransportSettings,
+ settings.listSchemaRevisionsSettings(),
+ clientContext);
+ this.commitSchemaCallable =
+ callableFactory.createUnaryCallable(
+ commitSchemaTransportSettings, settings.commitSchemaSettings(), clientContext);
+ this.rollbackSchemaCallable =
+ callableFactory.createUnaryCallable(
+ rollbackSchemaTransportSettings, settings.rollbackSchemaSettings(), clientContext);
+ this.deleteSchemaRevisionCallable =
+ callableFactory.createUnaryCallable(
+ deleteSchemaRevisionTransportSettings,
+ settings.deleteSchemaRevisionSettings(),
+ clientContext);
this.deleteSchemaCallable =
callableFactory.createUnaryCallable(
deleteSchemaTransportSettings, settings.deleteSchemaSettings(), clientContext);
@@ -542,6 +754,10 @@ public static List getMethodDescriptors() {
methodDescriptors.add(createSchemaMethodDescriptor);
methodDescriptors.add(getSchemaMethodDescriptor);
methodDescriptors.add(listSchemasMethodDescriptor);
+ methodDescriptors.add(listSchemaRevisionsMethodDescriptor);
+ methodDescriptors.add(commitSchemaMethodDescriptor);
+ methodDescriptors.add(rollbackSchemaMethodDescriptor);
+ methodDescriptors.add(deleteSchemaRevisionMethodDescriptor);
methodDescriptors.add(deleteSchemaMethodDescriptor);
methodDescriptors.add(validateSchemaMethodDescriptor);
methodDescriptors.add(validateMessageMethodDescriptor);
@@ -571,6 +787,33 @@ public UnaryCallable listSchemasPa
return listSchemasPagedCallable;
}
+ @Override
+ public UnaryCallable
+ listSchemaRevisionsCallable() {
+ return listSchemaRevisionsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listSchemaRevisionsPagedCallable() {
+ return listSchemaRevisionsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable commitSchemaCallable() {
+ return commitSchemaCallable;
+ }
+
+ @Override
+ public UnaryCallable rollbackSchemaCallable() {
+ return rollbackSchemaCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteSchemaRevisionCallable() {
+ return deleteSchemaRevisionCallable;
+ }
+
@Override
public UnaryCallable deleteSchemaCallable() {
return deleteSchemaCallable;
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java
index 49546ad5d..fb9b368a8 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java
@@ -99,12 +99,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearName().build(), false))
+ .toBody("*", request.toBuilder().clearName().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -136,6 +137,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -170,12 +172,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().build(), false))
+ .toBody("*", request.toBuilder().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -208,6 +211,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -242,6 +246,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -276,13 +281,14 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody(
- "*", request.toBuilder().clearSubscription().build(), false))
+ "*", request.toBuilder().clearSubscription().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -312,12 +318,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearSubscription().build(), false))
+ .toBody("*", request.toBuilder().clearSubscription().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -345,12 +352,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer = ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearSubscription().build(), false))
+ .toBody("*", request.toBuilder().clearSubscription().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -382,13 +390,14 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody(
- "*", request.toBuilder().clearSubscription().build(), false))
+ "*", request.toBuilder().clearSubscription().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -419,6 +428,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -454,6 +464,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -487,12 +498,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearName().build(), false))
+ .toBody("*", request.toBuilder().clearName().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -524,12 +536,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().build(), false))
+ .toBody("*", request.toBuilder().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -560,6 +573,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -590,12 +604,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer = ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearSubscription().build(), false))
+ .toBody("*", request.toBuilder().clearSubscription().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -630,12 +645,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearResource().build(), false))
+ .toBody("*", request.toBuilder().clearResource().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
@@ -670,6 +686,7 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
@@ -707,12 +724,13 @@ public class HttpJsonSubscriberStub extends SubscriberStub {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
- .toBody("*", request.toBuilder().clearResource().build(), false))
+ .toBody("*", request.toBuilder().clearResource().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java
index 287162b97..c04234a61 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java
@@ -111,7 +111,10 @@
* topicAdminSettingsBuilder
* .createTopicSettings()
* .setRetrySettings(
- * topicAdminSettingsBuilder.createTopicSettings().getRetrySettings().toBuilder()
+ * topicAdminSettingsBuilder
+ * .createTopicSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* PublisherStubSettings topicAdminSettings = topicAdminSettingsBuilder.build();
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java
index 47aac9109..01446db22 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java
@@ -16,6 +16,7 @@
package com.google.cloud.pubsub.v1.stub;
+import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse;
import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse;
import com.google.api.gax.core.BackgroundResource;
@@ -26,11 +27,16 @@
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.protobuf.Empty;
+import com.google.pubsub.v1.CommitSchemaRequest;
import com.google.pubsub.v1.CreateSchemaRequest;
import com.google.pubsub.v1.DeleteSchemaRequest;
+import com.google.pubsub.v1.DeleteSchemaRevisionRequest;
import com.google.pubsub.v1.GetSchemaRequest;
+import com.google.pubsub.v1.ListSchemaRevisionsRequest;
+import com.google.pubsub.v1.ListSchemaRevisionsResponse;
import com.google.pubsub.v1.ListSchemasRequest;
import com.google.pubsub.v1.ListSchemasResponse;
+import com.google.pubsub.v1.RollbackSchemaRequest;
import com.google.pubsub.v1.Schema;
import com.google.pubsub.v1.ValidateMessageRequest;
import com.google.pubsub.v1.ValidateMessageResponse;
@@ -63,6 +69,28 @@ public UnaryCallable listSchemasCallabl
throw new UnsupportedOperationException("Not implemented: listSchemasCallable()");
}
+ public UnaryCallable
+ listSchemaRevisionsPagedCallable() {
+ throw new UnsupportedOperationException("Not implemented: listSchemaRevisionsPagedCallable()");
+ }
+
+ public UnaryCallable
+ listSchemaRevisionsCallable() {
+ throw new UnsupportedOperationException("Not implemented: listSchemaRevisionsCallable()");
+ }
+
+ public UnaryCallable commitSchemaCallable() {
+ throw new UnsupportedOperationException("Not implemented: commitSchemaCallable()");
+ }
+
+ public UnaryCallable rollbackSchemaCallable() {
+ throw new UnsupportedOperationException("Not implemented: rollbackSchemaCallable()");
+ }
+
+ public UnaryCallable deleteSchemaRevisionCallable() {
+ throw new UnsupportedOperationException("Not implemented: deleteSchemaRevisionCallable()");
+ }
+
public UnaryCallable deleteSchemaCallable() {
throw new UnsupportedOperationException("Not implemented: deleteSchemaCallable()");
}
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java
index ccf2d83bb..240ca05d0 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java
@@ -16,6 +16,7 @@
package com.google.cloud.pubsub.v1.stub;
+import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse;
import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse;
import com.google.api.core.ApiFunction;
@@ -53,11 +54,16 @@
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.protobuf.Empty;
+import com.google.pubsub.v1.CommitSchemaRequest;
import com.google.pubsub.v1.CreateSchemaRequest;
import com.google.pubsub.v1.DeleteSchemaRequest;
+import com.google.pubsub.v1.DeleteSchemaRevisionRequest;
import com.google.pubsub.v1.GetSchemaRequest;
+import com.google.pubsub.v1.ListSchemaRevisionsRequest;
+import com.google.pubsub.v1.ListSchemaRevisionsResponse;
import com.google.pubsub.v1.ListSchemasRequest;
import com.google.pubsub.v1.ListSchemasResponse;
+import com.google.pubsub.v1.RollbackSchemaRequest;
import com.google.pubsub.v1.Schema;
import com.google.pubsub.v1.ValidateMessageRequest;
import com.google.pubsub.v1.ValidateMessageResponse;
@@ -95,7 +101,10 @@
* schemaServiceSettingsBuilder
* .createSchemaSettings()
* .setRetrySettings(
- * schemaServiceSettingsBuilder.createSchemaSettings().getRetrySettings().toBuilder()
+ * schemaServiceSettingsBuilder
+ * .createSchemaSettings()
+ * .getRetrySettings()
+ * .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build();
@@ -114,6 +123,12 @@ public class SchemaServiceStubSettings extends StubSettings getSchemaSettings;
private final PagedCallSettings
listSchemasSettings;
+ private final PagedCallSettings<
+ ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse>
+ listSchemaRevisionsSettings;
+ private final UnaryCallSettings commitSchemaSettings;
+ private final UnaryCallSettings rollbackSchemaSettings;
+ private final UnaryCallSettings deleteSchemaRevisionSettings;
private final UnaryCallSettings deleteSchemaSettings;
private final UnaryCallSettings
validateSchemaSettings;
@@ -160,6 +175,46 @@ public Iterable extractResources(ListSchemasResponse payload) {
}
};
+ private static final PagedListDescriptor<
+ ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, Schema>
+ LIST_SCHEMA_REVISIONS_PAGE_STR_DESC =
+ new PagedListDescriptor<
+ ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, Schema>() {
+ @Override
+ public String emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListSchemaRevisionsRequest injectToken(
+ ListSchemaRevisionsRequest payload, String token) {
+ return ListSchemaRevisionsRequest.newBuilder(payload).setPageToken(token).build();
+ }
+
+ @Override
+ public ListSchemaRevisionsRequest injectPageSize(
+ ListSchemaRevisionsRequest payload, int pageSize) {
+ return ListSchemaRevisionsRequest.newBuilder(payload).setPageSize(pageSize).build();
+ }
+
+ @Override
+ public Integer extractPageSize(ListSchemaRevisionsRequest payload) {
+ return payload.getPageSize();
+ }
+
+ @Override
+ public String extractNextToken(ListSchemaRevisionsResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListSchemaRevisionsResponse payload) {
+ return payload.getSchemasList() == null
+ ? ImmutableList.of()
+ : payload.getSchemasList();
+ }
+ };
+
private static final PagedListResponseFactory<
ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse>
LIST_SCHEMAS_PAGE_STR_FACT =
@@ -177,6 +232,27 @@ public ApiFuture getFuturePagedResponse(
}
};
+ private static final PagedListResponseFactory<
+ ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse>
+ LIST_SCHEMA_REVISIONS_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ListSchemaRevisionsRequest,
+ ListSchemaRevisionsResponse,
+ ListSchemaRevisionsPagedResponse>() {
+ @Override
+ public ApiFuture getFuturePagedResponse(
+ UnaryCallable callable,
+ ListSchemaRevisionsRequest request,
+ ApiCallContext context,
+ ApiFuture futureResponse) {
+ PageContext
+ pageContext =
+ PageContext.create(
+ callable, LIST_SCHEMA_REVISIONS_PAGE_STR_DESC, request, context);
+ return ListSchemaRevisionsPagedResponse.createAsync(pageContext, futureResponse);
+ }
+ };
+
/** Returns the object with the settings used for calls to createSchema. */
public UnaryCallSettings createSchemaSettings() {
return createSchemaSettings;
@@ -193,6 +269,28 @@ public UnaryCallSettings getSchemaSettings() {
return listSchemasSettings;
}
+ /** Returns the object with the settings used for calls to listSchemaRevisions. */
+ public PagedCallSettings<
+ ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse>
+ listSchemaRevisionsSettings() {
+ return listSchemaRevisionsSettings;
+ }
+
+ /** Returns the object with the settings used for calls to commitSchema. */
+ public UnaryCallSettings commitSchemaSettings() {
+ return commitSchemaSettings;
+ }
+
+ /** Returns the object with the settings used for calls to rollbackSchema. */
+ public UnaryCallSettings rollbackSchemaSettings() {
+ return rollbackSchemaSettings;
+ }
+
+ /** Returns the object with the settings used for calls to deleteSchemaRevision. */
+ public UnaryCallSettings deleteSchemaRevisionSettings() {
+ return deleteSchemaRevisionSettings;
+ }
+
/** Returns the object with the settings used for calls to deleteSchema. */
public UnaryCallSettings deleteSchemaSettings() {
return deleteSchemaSettings;
@@ -334,6 +432,10 @@ protected SchemaServiceStubSettings(Builder settingsBuilder) throws IOException
createSchemaSettings = settingsBuilder.createSchemaSettings().build();
getSchemaSettings = settingsBuilder.getSchemaSettings().build();
listSchemasSettings = settingsBuilder.listSchemasSettings().build();
+ listSchemaRevisionsSettings = settingsBuilder.listSchemaRevisionsSettings().build();
+ commitSchemaSettings = settingsBuilder.commitSchemaSettings().build();
+ rollbackSchemaSettings = settingsBuilder.rollbackSchemaSettings().build();
+ deleteSchemaRevisionSettings = settingsBuilder.deleteSchemaRevisionSettings().build();
deleteSchemaSettings = settingsBuilder.deleteSchemaSettings().build();
validateSchemaSettings = settingsBuilder.validateSchemaSettings().build();
validateMessageSettings = settingsBuilder.validateMessageSettings().build();
@@ -350,6 +452,15 @@ public static class Builder extends StubSettings.Builder
listSchemasSettings;
+ private final PagedCallSettings.Builder<
+ ListSchemaRevisionsRequest,
+ ListSchemaRevisionsResponse,
+ ListSchemaRevisionsPagedResponse>
+ listSchemaRevisionsSettings;
+ private final UnaryCallSettings.Builder commitSchemaSettings;
+ private final UnaryCallSettings.Builder rollbackSchemaSettings;
+ private final UnaryCallSettings.Builder
+ deleteSchemaRevisionSettings;
private final UnaryCallSettings.Builder deleteSchemaSettings;
private final UnaryCallSettings.Builder
validateSchemaSettings;
@@ -389,6 +500,11 @@ protected Builder(ClientContext clientContext) {
createSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listSchemasSettings = PagedCallSettings.newBuilder(LIST_SCHEMAS_PAGE_STR_FACT);
+ listSchemaRevisionsSettings =
+ PagedCallSettings.newBuilder(LIST_SCHEMA_REVISIONS_PAGE_STR_FACT);
+ commitSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ rollbackSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ deleteSchemaRevisionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
validateSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
validateMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -401,6 +517,10 @@ protected Builder(ClientContext clientContext) {
createSchemaSettings,
getSchemaSettings,
listSchemasSettings,
+ listSchemaRevisionsSettings,
+ commitSchemaSettings,
+ rollbackSchemaSettings,
+ deleteSchemaRevisionSettings,
deleteSchemaSettings,
validateSchemaSettings,
validateMessageSettings,
@@ -416,6 +536,10 @@ protected Builder(SchemaServiceStubSettings settings) {
createSchemaSettings = settings.createSchemaSettings.toBuilder();
getSchemaSettings = settings.getSchemaSettings.toBuilder();
listSchemasSettings = settings.listSchemasSettings.toBuilder();
+ listSchemaRevisionsSettings = settings.listSchemaRevisionsSettings.toBuilder();
+ commitSchemaSettings = settings.commitSchemaSettings.toBuilder();
+ rollbackSchemaSettings = settings.rollbackSchemaSettings.toBuilder();
+ deleteSchemaRevisionSettings = settings.deleteSchemaRevisionSettings.toBuilder();
deleteSchemaSettings = settings.deleteSchemaSettings.toBuilder();
validateSchemaSettings = settings.validateSchemaSettings.toBuilder();
validateMessageSettings = settings.validateMessageSettings.toBuilder();
@@ -428,6 +552,10 @@ protected Builder(SchemaServiceStubSettings settings) {
createSchemaSettings,
getSchemaSettings,
listSchemasSettings,
+ listSchemaRevisionsSettings,
+ commitSchemaSettings,
+ rollbackSchemaSettings,
+ deleteSchemaRevisionSettings,
deleteSchemaSettings,
validateSchemaSettings,
validateMessageSettings,
@@ -478,6 +606,26 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+ builder
+ .listSchemaRevisionsSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .commitSchemaSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .rollbackSchemaSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .deleteSchemaRevisionSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
builder
.deleteSchemaSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
@@ -543,6 +691,31 @@ public UnaryCallSettings.Builder getSchemaSettings() {
return listSchemasSettings;
}
+ /** Returns the builder for the settings used for calls to listSchemaRevisions. */
+ public PagedCallSettings.Builder<
+ ListSchemaRevisionsRequest,
+ ListSchemaRevisionsResponse,
+ ListSchemaRevisionsPagedResponse>
+ listSchemaRevisionsSettings() {
+ return listSchemaRevisionsSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to commitSchema. */
+ public UnaryCallSettings.Builder commitSchemaSettings() {
+ return commitSchemaSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to rollbackSchema. */
+ public UnaryCallSettings.Builder rollbackSchemaSettings() {
+ return rollbackSchemaSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to deleteSchemaRevision. */
+ public UnaryCallSettings.Builder