diff --git a/.kokoro/build.sh b/.kokoro/build.sh
index 14fc8b4ae..0427b6149 100755
--- a/.kokoro/build.sh
+++ b/.kokoro/build.sh
@@ -110,8 +110,8 @@ bash .kokoro/coerce_logs.sh
if [[ "${ENABLE_BUILD_COP}" == "true" ]]
then
- chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot
- ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-pubsub
+ chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop
+ ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-pubsub
fi
echo "exiting with ${RETURN_CODE}"
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceClient.java
new file mode 100644
index 000000000..4ccac0cfd
--- /dev/null
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceClient.java
@@ -0,0 +1,861 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.pubsub.v1;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.pubsub.v1.stub.SchemaServiceStub;
+import com.google.cloud.pubsub.v1.stub.SchemaServiceStubSettings;
+import com.google.common.util.concurrent.MoreExecutors;
+import com.google.protobuf.Empty;
+import com.google.pubsub.v1.CreateSchemaRequest;
+import com.google.pubsub.v1.DeleteSchemaRequest;
+import com.google.pubsub.v1.GetSchemaRequest;
+import com.google.pubsub.v1.ListSchemasRequest;
+import com.google.pubsub.v1.ListSchemasResponse;
+import com.google.pubsub.v1.ProjectName;
+import com.google.pubsub.v1.Schema;
+import com.google.pubsub.v1.SchemaName;
+import com.google.pubsub.v1.ValidateMessageRequest;
+import com.google.pubsub.v1.ValidateMessageResponse;
+import com.google.pubsub.v1.ValidateSchemaRequest;
+import com.google.pubsub.v1.ValidateSchemaResponse;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND SERVICE
+/**
+ * Service Description:
+ *
+ *
This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ *
Note: close() needs to be called on the schemaServiceClient object to clean up resources such
+ * as threads. In the example above, try-with-resources is used, which automatically calls close().
+ *
+ *
The surface of this class includes several types of Java methods for each of the API's
+ * methods:
+ *
+ *
+ *
A "flattened" method. With this type of method, the fields of the request type have been
+ * converted into function parameters. It may be the case that not all fields are available as
+ * parameters, and not every API method will have a flattened method entry point.
+ *
A "request object" method. This type of method only takes one parameter, a request object,
+ * which must be constructed before the call. Not every API method will have a request object
+ * method.
+ *
A "callable" method. This type of method takes no parameters and returns an immutable API
+ * callable object, which can be used to initiate calls to the service.
+ *
+ *
+ *
See the individual methods for example code.
+ *
+ *
Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ *
This class can be customized by passing in a custom instance of SchemaServiceSettings to
+ * create(). For example:
+ *
+ *
+ */
+@Generated("by gapic-generator")
+public class SchemaServiceClient implements BackgroundResource {
+ private final SchemaServiceSettings settings;
+ private final SchemaServiceStub stub;
+
+ /** Constructs an instance of SchemaServiceClient with default settings. */
+ public static final SchemaServiceClient create() throws IOException {
+ return create(SchemaServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of SchemaServiceClient, using the given settings. The channels are
+ * created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final SchemaServiceClient create(SchemaServiceSettings settings)
+ throws IOException {
+ return new SchemaServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of SchemaServiceClient, using the given stub for making calls. This is
+ * for advanced usage - prefer to use SchemaServiceSettings}.
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final SchemaServiceClient create(SchemaServiceStub stub) {
+ return new SchemaServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of SchemaServiceClient, using the given settings. This is protected so
+ * that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
+ */
+ protected SchemaServiceClient(SchemaServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((SchemaServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected SchemaServiceClient(SchemaServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final SchemaServiceSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public SchemaServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a schema.
+ *
+ *
+ *
+ * @param parent Required. The name of the project in which to create the schema. Format is
+ * `projects/{project-id}`.
+ * @param schema Required. The schema object to create.
+ *
This schema's `name` parameter is ignored. The schema object returned by CreateSchema
+ * will have a `name` made using the given `parent` and `schema_id`.
+ * @param schemaId The ID to use for the schema, which will become the final component of the
+ * schema's resource name.
+ *
See https://cloud.google.com/pubsub/docs/admin#resource_names for resource name
+ * constraints.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Schema createSchema(ProjectName parent, Schema schema, String schemaId) {
+ CreateSchemaRequest request =
+ CreateSchemaRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setSchema(schema)
+ .setSchemaId(schemaId)
+ .build();
+ return createSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a schema.
+ *
+ *
+ *
+ * @param parent Required. The name of the project in which to create the schema. Format is
+ * `projects/{project-id}`.
+ * @param schema Required. The schema object to create.
+ *
This schema's `name` parameter is ignored. The schema object returned by CreateSchema
+ * will have a `name` made using the given `parent` and `schema_id`.
+ * @param schemaId The ID to use for the schema, which will become the final component of the
+ * schema's resource name.
+ *
See https://cloud.google.com/pubsub/docs/admin#resource_names for resource name
+ * constraints.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Schema createSchema(String parent, Schema schema, String schemaId) {
+ CreateSchemaRequest request =
+ CreateSchemaRequest.newBuilder()
+ .setParent(parent)
+ .setSchema(schema)
+ .setSchemaId(schemaId)
+ .build();
+ return createSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a schema.
+ *
+ *
+ *
+ * @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 createSchema(CreateSchemaRequest request) {
+ return createSchemaCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a schema.
+ *
+ *
+ *
+ * @param name Required. The name of the schema to get. Format is
+ * `projects/{project}/schemas/{schema}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Schema getSchema(String name) {
+ GetSchemaRequest request = GetSchemaRequest.newBuilder().setName(name).build();
+ return getSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a schema.
+ *
+ *
+ *
+ * @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 getSchema(GetSchemaRequest request) {
+ return getSchemaCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a schema.
+ *
+ *
+ *
+ * @param parent Required. The name of the project in which to list schemas. Format is
+ * `projects/{project-id}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSchemasPagedResponse listSchemas(ProjectName parent) {
+ ListSchemasRequest request =
+ ListSchemasRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listSchemas(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists schemas in a project.
+ *
+ *
+ *
+ * @param parent Required. The name of the project in which to list schemas. Format is
+ * `projects/{project-id}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSchemasPagedResponse listSchemas(String parent) {
+ ListSchemasRequest request = ListSchemasRequest.newBuilder().setParent(parent).build();
+ return listSchemas(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists schemas in a project.
+ *
+ *
+ *
+ * @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 ListSchemasPagedResponse listSchemas(ListSchemasRequest request) {
+ return listSchemasPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists schemas in a project.
+ *
+ *
+ *
+ * @param name Required. Name of the schema to delete. Format is
+ * `projects/{project}/schemas/{schema}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteSchema(String name) {
+ DeleteSchemaRequest request = DeleteSchemaRequest.newBuilder().setName(name).build();
+ deleteSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a schema.
+ *
+ *
+ *
+ * @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 void deleteSchema(DeleteSchemaRequest request) {
+ deleteSchemaCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a schema.
+ *
+ *
+ *
+ * @param parent Required. The name of the project in which to validate schemas. Format is
+ * `projects/{project-id}`.
+ * @param schema Required. The schema object to validate.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ValidateSchemaResponse validateSchema(String parent, Schema schema) {
+ ValidateSchemaRequest request =
+ ValidateSchemaRequest.newBuilder().setParent(parent).setSchema(schema).build();
+ return validateSchema(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Validates a schema.
+ *
+ *
+ *
+ * @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 ValidateSchemaResponse validateSchema(ValidateSchemaRequest request) {
+ return validateSchemaCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Validates a schema.
+ *
+ *
+ *
+ * @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 ValidateMessageResponse validateMessage(ValidateMessageRequest request) {
+ return validateMessageCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Validates a message against a schema.
+ *
+ *
+ */
+ public final UnaryCallable
+ validateMessageCallable() {
+ return stub.validateMessageCallable();
+ }
+
+ @Override
+ public final void close() {
+ stub.close();
+ }
+
+ @Override
+ public void shutdown() {
+ stub.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return stub.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return stub.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ stub.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return stub.awaitTermination(duration, unit);
+ }
+
+ public static class ListSchemasPagedResponse
+ extends AbstractPagedListResponse<
+ ListSchemasRequest,
+ ListSchemasResponse,
+ Schema,
+ ListSchemasPage,
+ ListSchemasFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListSchemasPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ new ApiFunction() {
+ @Override
+ public ListSchemasPagedResponse apply(ListSchemasPage input) {
+ return new ListSchemasPagedResponse(input);
+ }
+ },
+ MoreExecutors.directExecutor());
+ }
+
+ private ListSchemasPagedResponse(ListSchemasPage page) {
+ super(page, ListSchemasFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListSchemasPage
+ extends AbstractPage {
+
+ private ListSchemasPage(
+ PageContext context,
+ ListSchemasResponse response) {
+ super(context, response);
+ }
+
+ private static ListSchemasPage createEmptyPage() {
+ return new ListSchemasPage(null, null);
+ }
+
+ @Override
+ protected ListSchemasPage createPage(
+ PageContext context,
+ ListSchemasResponse response) {
+ return new ListSchemasPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListSchemasFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListSchemasRequest,
+ ListSchemasResponse,
+ Schema,
+ ListSchemasPage,
+ ListSchemasFixedSizeCollection> {
+
+ private ListSchemasFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListSchemasFixedSizeCollection createEmptyCollection() {
+ return new ListSchemasFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListSchemasFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListSchemasFixedSizeCollection(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
new file mode 100644
index 000000000..4d2590c18
--- /dev/null
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java
@@ -0,0 +1,248 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.pubsub.v1;
+
+import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.cloud.pubsub.v1.stub.SchemaServiceStubSettings;
+import com.google.protobuf.Empty;
+import com.google.pubsub.v1.CreateSchemaRequest;
+import com.google.pubsub.v1.DeleteSchemaRequest;
+import com.google.pubsub.v1.GetSchemaRequest;
+import com.google.pubsub.v1.ListSchemasRequest;
+import com.google.pubsub.v1.ListSchemasResponse;
+import com.google.pubsub.v1.Schema;
+import com.google.pubsub.v1.ValidateMessageRequest;
+import com.google.pubsub.v1.ValidateMessageResponse;
+import com.google.pubsub.v1.ValidateSchemaRequest;
+import com.google.pubsub.v1.ValidateSchemaResponse;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Settings class to configure an instance of {@link SchemaServiceClient}.
+ *
+ *
The default instance has everything set to sensible defaults:
+ *
+ *
+ *
The default service address (pubsub.googleapis.com) and default port (443) are used.
+ *
Credentials are acquired automatically through Application Default Credentials.
+ *
Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ *
The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ *
For example, to set the total timeout of createSchema to 30 seconds:
+ *
+ *
+ */
+@Generated("by gapic-generator")
+public class SchemaServiceSettings extends ClientSettings {
+ /** Returns the object with the settings used for calls to createSchema. */
+ public UnaryCallSettings createSchemaSettings() {
+ return ((SchemaServiceStubSettings) getStubSettings()).createSchemaSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getSchema. */
+ public UnaryCallSettings getSchemaSettings() {
+ return ((SchemaServiceStubSettings) getStubSettings()).getSchemaSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listSchemas. */
+ public PagedCallSettings
+ listSchemasSettings() {
+ return ((SchemaServiceStubSettings) getStubSettings()).listSchemasSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteSchema. */
+ public UnaryCallSettings deleteSchemaSettings() {
+ return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaSettings();
+ }
+
+ /** Returns the object with the settings used for calls to validateSchema. */
+ public UnaryCallSettings validateSchemaSettings() {
+ return ((SchemaServiceStubSettings) getStubSettings()).validateSchemaSettings();
+ }
+
+ /** Returns the object with the settings used for calls to validateMessage. */
+ public UnaryCallSettings
+ validateMessageSettings() {
+ return ((SchemaServiceStubSettings) getStubSettings()).validateMessageSettings();
+ }
+
+ public static final SchemaServiceSettings create(SchemaServiceStubSettings stub)
+ throws IOException {
+ return new SchemaServiceSettings.Builder(stub.toBuilder()).build();
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return SchemaServiceStubSettings.defaultExecutorProviderBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ public static String getDefaultEndpoint() {
+ return SchemaServiceStubSettings.getDefaultEndpoint();
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return SchemaServiceStubSettings.getDefaultServiceScopes();
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return SchemaServiceStubSettings.defaultCredentialsProviderBuilder();
+ }
+
+ /** Returns a builder for the default ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return SchemaServiceStubSettings.defaultGrpcTransportProviderBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return SchemaServiceStubSettings.defaultTransportChannelProvider();
+ }
+
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return SchemaServiceStubSettings.defaultApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder() {
+ return Builder.createDefault();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder(ClientContext clientContext) {
+ return new Builder(clientContext);
+ }
+
+ /** Returns a builder containing all the values of this settings class. */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ protected SchemaServiceSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+ }
+
+ /** Builder for SchemaServiceSettings. */
+ public static class Builder extends ClientSettings.Builder {
+ protected Builder() throws IOException {
+ this((ClientContext) null);
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(SchemaServiceStubSettings.newBuilder(clientContext));
+ }
+
+ private static Builder createDefault() {
+ return new Builder(SchemaServiceStubSettings.newBuilder());
+ }
+
+ protected Builder(SchemaServiceSettings settings) {
+ super(settings.getStubSettings().toBuilder());
+ }
+
+ protected Builder(SchemaServiceStubSettings.Builder stubSettings) {
+ super(stubSettings);
+ }
+
+ public SchemaServiceStubSettings.Builder getStubSettingsBuilder() {
+ return ((SchemaServiceStubSettings.Builder) getStubSettings());
+ }
+
+ // NEXT_MAJOR_VER: remove 'throws Exception'
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ *
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) throws Exception {
+ super.applyToAllUnaryMethods(
+ getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
+ return this;
+ }
+
+ /** Returns the builder for the settings used for calls to createSchema. */
+ public UnaryCallSettings.Builder createSchemaSettings() {
+ return getStubSettingsBuilder().createSchemaSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getSchema. */
+ public UnaryCallSettings.Builder getSchemaSettings() {
+ return getStubSettingsBuilder().getSchemaSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listSchemas. */
+ public PagedCallSettings.Builder<
+ ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse>
+ listSchemasSettings() {
+ return getStubSettingsBuilder().listSchemasSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteSchema. */
+ public UnaryCallSettings.Builder deleteSchemaSettings() {
+ return getStubSettingsBuilder().deleteSchemaSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to validateSchema. */
+ public UnaryCallSettings.Builder
+ validateSchemaSettings() {
+ return getStubSettingsBuilder().validateSchemaSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to validateMessage. */
+ public UnaryCallSettings.Builder
+ validateMessageSettings() {
+ return getStubSettingsBuilder().validateMessageSettings();
+ }
+
+ @Override
+ public SchemaServiceSettings build() throws IOException {
+ return new SchemaServiceSettings(this);
+ }
+ }
+}
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 68ea83759..6c5b7a43d 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
@@ -2031,8 +2031,8 @@ public final UnaryCallable deleteSnapshotCallable(
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided
- * in the request. Snapshots are used in [Seek](
- * https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage
+ * in the request. Snapshots are used in [Seek]
+ * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage
* message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in
* an existing subscription to the state captured by a snapshot. Note that both the subscription
* and the snapshot must be on the same topic.
@@ -2059,8 +2059,8 @@ public final SeekResponse seek(SeekRequest request) {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided
- * in the request. Snapshots are used in [Seek](
- * https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage
+ * in the request. Snapshots are used in [Seek]
+ * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage
* message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in
* an existing subscription to the state captured by a snapshot. Note that both the subscription
* and the snapshot must be on the same topic.
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 f4b0120f8..52920223e 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
@@ -182,8 +182,8 @@ public PublisherStub getStub() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates the given topic with the given name. See the [resource name rules](
- * https://cloud.google.com/pubsub/docs/admin#resource_names).
+ * Creates the given topic with the given name. See the [resource name rules]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names).
*
*
Sample code:
*
@@ -208,8 +208,8 @@ public final Topic createTopic(TopicName name) {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates the given topic with the given name. See the [resource name rules](
- * https://cloud.google.com/pubsub/docs/admin#resource_names).
+ * Creates the given topic with the given name. See the [resource name rules]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names).
*
*
Sample code:
*
@@ -263,8 +263,8 @@ public final Topic createTopic(ProjectTopicName name) {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates the given topic with the given name. See the [resource name rules](
- * https://cloud.google.com/pubsub/docs/admin#resource_names).
+ * Creates the given topic with the given name. See the [resource name rules]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names).
*
*
Sample code:
*
@@ -287,8 +287,8 @@ public final Topic createTopic(Topic request) {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates the given topic with the given name. See the [resource name rules](
- * https://cloud.google.com/pubsub/docs/admin#resource_names).
+ * Creates the given topic with the given name. See the [resource name rules]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names).
*
*
Service Description: The service that an application uses to manipulate topics, and to send
* messages to a topic.
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java
new file mode 100644
index 000000000..c7e5d89e2
--- /dev/null
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.pubsub.v1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcCallableFactory;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.BidiStreamingCallable;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientStreamingCallable;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.StreamingCallSettings;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * gRPC callable factory implementation for Cloud Pub/Sub API.
+ *
+ *
This class is for advanced usage.
+ */
+@Generated("by gapic-generator")
+@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+public class GrpcSchemaServiceCallableFactory implements GrpcStubCallableFactory {
+ @Override
+ public UnaryCallable createUnaryCallable(
+ GrpcCallSettings grpcCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ GrpcCallSettings grpcCallSettings,
+ PagedCallSettings pagedCallSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createPagedCallable(
+ grpcCallSettings, pagedCallSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ GrpcCallSettings grpcCallSettings,
+ BatchingCallSettings batchingCallSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createBatchingCallable(
+ grpcCallSettings, batchingCallSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ GrpcCallSettings grpcCallSettings,
+ OperationCallSettings operationCallSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ return GrpcCallableFactory.createOperationCallable(
+ grpcCallSettings, operationCallSettings, clientContext, operationsStub);
+ }
+
+ @Override
+ public
+ BidiStreamingCallable createBidiStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ StreamingCallSettings streamingCallSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createBidiStreamingCallable(
+ grpcCallSettings, streamingCallSettings, clientContext);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ ServerStreamingCallSettings streamingCallSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createServerStreamingCallable(
+ grpcCallSettings, streamingCallSettings, clientContext);
+ }
+
+ @Override
+ public
+ ClientStreamingCallable createClientStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ StreamingCallSettings streamingCallSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createClientStreamingCallable(
+ grpcCallSettings, streamingCallSettings, clientContext);
+ }
+}
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
new file mode 100644
index 000000000..220d4592c
--- /dev/null
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java
@@ -0,0 +1,322 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.pubsub.v1.stub;
+
+import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.RequestParamsExtractor;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.common.collect.ImmutableMap;
+import com.google.protobuf.Empty;
+import com.google.pubsub.v1.CreateSchemaRequest;
+import com.google.pubsub.v1.DeleteSchemaRequest;
+import com.google.pubsub.v1.GetSchemaRequest;
+import com.google.pubsub.v1.ListSchemasRequest;
+import com.google.pubsub.v1.ListSchemasResponse;
+import com.google.pubsub.v1.Schema;
+import com.google.pubsub.v1.ValidateMessageRequest;
+import com.google.pubsub.v1.ValidateMessageResponse;
+import com.google.pubsub.v1.ValidateSchemaRequest;
+import com.google.pubsub.v1.ValidateSchemaResponse;
+import io.grpc.MethodDescriptor;
+import io.grpc.protobuf.ProtoUtils;
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * gRPC stub implementation for Cloud Pub/Sub API.
+ *
+ *
This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator")
+@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+public class GrpcSchemaServiceStub extends SchemaServiceStub {
+
+ private static final MethodDescriptor createSchemaMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.pubsub.v1.SchemaService/CreateSchema")
+ .setRequestMarshaller(ProtoUtils.marshaller(CreateSchemaRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance()))
+ .build();
+ private static final MethodDescriptor getSchemaMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.pubsub.v1.SchemaService/GetSchema")
+ .setRequestMarshaller(ProtoUtils.marshaller(GetSchemaRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance()))
+ .build();
+ private static final MethodDescriptor
+ listSchemasMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.pubsub.v1.SchemaService/ListSchemas")
+ .setRequestMarshaller(ProtoUtils.marshaller(ListSchemasRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListSchemasResponse.getDefaultInstance()))
+ .build();
+ private static final MethodDescriptor deleteSchemaMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.pubsub.v1.SchemaService/DeleteSchema")
+ .setRequestMarshaller(ProtoUtils.marshaller(DeleteSchemaRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+ .build();
+ private static final MethodDescriptor
+ validateSchemaMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.pubsub.v1.SchemaService/ValidateSchema")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ValidateSchemaRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ValidateSchemaResponse.getDefaultInstance()))
+ .build();
+ private static final MethodDescriptor
+ validateMessageMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.pubsub.v1.SchemaService/ValidateMessage")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ValidateMessageRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ValidateMessageResponse.getDefaultInstance()))
+ .build();
+
+ private final BackgroundResource backgroundResources;
+
+ private final UnaryCallable createSchemaCallable;
+ private final UnaryCallable getSchemaCallable;
+ private final UnaryCallable listSchemasCallable;
+ private final UnaryCallable
+ listSchemasPagedCallable;
+ private final UnaryCallable deleteSchemaCallable;
+ private final UnaryCallable validateSchemaCallable;
+ private final UnaryCallable
+ validateMessageCallable;
+
+ private final GrpcStubCallableFactory callableFactory;
+
+ public static final GrpcSchemaServiceStub create(SchemaServiceStubSettings settings)
+ throws IOException {
+ return new GrpcSchemaServiceStub(settings, ClientContext.create(settings));
+ }
+
+ public static final GrpcSchemaServiceStub create(ClientContext clientContext) throws IOException {
+ return new GrpcSchemaServiceStub(SchemaServiceStubSettings.newBuilder().build(), clientContext);
+ }
+
+ public static final GrpcSchemaServiceStub create(
+ ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
+ return new GrpcSchemaServiceStub(
+ SchemaServiceStubSettings.newBuilder().build(), clientContext, callableFactory);
+ }
+
+ /**
+ * Constructs an instance of GrpcSchemaServiceStub, using the given settings. This is protected so
+ * that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
+ */
+ protected GrpcSchemaServiceStub(SchemaServiceStubSettings settings, ClientContext clientContext)
+ throws IOException {
+ this(settings, clientContext, new GrpcSchemaServiceCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of GrpcSchemaServiceStub, using the given settings. This is protected so
+ * that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
+ */
+ protected GrpcSchemaServiceStub(
+ SchemaServiceStubSettings settings,
+ ClientContext clientContext,
+ GrpcStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+
+ GrpcCallSettings createSchemaTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(createSchemaMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(CreateSchemaRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("parent", String.valueOf(request.getParent()));
+ return params.build();
+ }
+ })
+ .build();
+ GrpcCallSettings getSchemaTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(getSchemaMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(GetSchemaRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("name", String.valueOf(request.getName()));
+ return params.build();
+ }
+ })
+ .build();
+ GrpcCallSettings listSchemasTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listSchemasMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(ListSchemasRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("parent", String.valueOf(request.getParent()));
+ return params.build();
+ }
+ })
+ .build();
+ GrpcCallSettings deleteSchemaTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(deleteSchemaMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(DeleteSchemaRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("name", String.valueOf(request.getName()));
+ return params.build();
+ }
+ })
+ .build();
+ GrpcCallSettings
+ validateSchemaTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(validateSchemaMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(ValidateSchemaRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("parent", String.valueOf(request.getParent()));
+ return params.build();
+ }
+ })
+ .build();
+ GrpcCallSettings
+ validateMessageTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(validateMessageMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(ValidateMessageRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("parent", String.valueOf(request.getParent()));
+ return params.build();
+ }
+ })
+ .build();
+
+ this.createSchemaCallable =
+ callableFactory.createUnaryCallable(
+ createSchemaTransportSettings, settings.createSchemaSettings(), clientContext);
+ this.getSchemaCallable =
+ callableFactory.createUnaryCallable(
+ getSchemaTransportSettings, settings.getSchemaSettings(), clientContext);
+ this.listSchemasCallable =
+ callableFactory.createUnaryCallable(
+ listSchemasTransportSettings, settings.listSchemasSettings(), clientContext);
+ this.listSchemasPagedCallable =
+ callableFactory.createPagedCallable(
+ listSchemasTransportSettings, settings.listSchemasSettings(), clientContext);
+ this.deleteSchemaCallable =
+ callableFactory.createUnaryCallable(
+ deleteSchemaTransportSettings, settings.deleteSchemaSettings(), clientContext);
+ this.validateSchemaCallable =
+ callableFactory.createUnaryCallable(
+ validateSchemaTransportSettings, settings.validateSchemaSettings(), clientContext);
+ this.validateMessageCallable =
+ callableFactory.createUnaryCallable(
+ validateMessageTransportSettings, settings.validateMessageSettings(), clientContext);
+
+ backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ public UnaryCallable createSchemaCallable() {
+ return createSchemaCallable;
+ }
+
+ public UnaryCallable getSchemaCallable() {
+ return getSchemaCallable;
+ }
+
+ public UnaryCallable listSchemasPagedCallable() {
+ return listSchemasPagedCallable;
+ }
+
+ public UnaryCallable listSchemasCallable() {
+ return listSchemasCallable;
+ }
+
+ public UnaryCallable deleteSchemaCallable() {
+ return deleteSchemaCallable;
+ }
+
+ public UnaryCallable validateSchemaCallable() {
+ return validateSchemaCallable;
+ }
+
+ public UnaryCallable validateMessageCallable() {
+ return validateMessageCallable;
+ }
+
+ @Override
+ public final void close() {
+ shutdown();
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
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 457731c61..696671660 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
@@ -572,32 +572,25 @@ public static class Builder extends StubSettings.Builder> definitions =
ImmutableMap.builder();
definitions.put(
- "idempotent",
- ImmutableSet.copyOf(
- Lists.newArrayList(
- StatusCode.Code.ABORTED, StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN)));
- definitions.put(
- "non_idempotent2", ImmutableSet.copyOf(Lists.newArrayList()));
- definitions.put(
- "non_idempotent",
+ "retry_policy_1_codes",
ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
+ definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
definitions.put(
- "idempotent2",
+ "retry_policy_3_codes",
ImmutableSet.copyOf(
Lists.newArrayList(
- StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
- definitions.put("none", ImmutableSet.copyOf(Lists.newArrayList()));
+ StatusCode.Code.UNKNOWN, StatusCode.Code.ABORTED, StatusCode.Code.UNAVAILABLE)));
definitions.put(
- "publish",
+ "retry_policy_2_codes",
ImmutableSet.copyOf(
Lists.newArrayList(
StatusCode.Code.ABORTED,
StatusCode.Code.CANCELLED,
- StatusCode.Code.DEADLINE_EXCEEDED,
StatusCode.Code.INTERNAL,
StatusCode.Code.RESOURCE_EXHAUSTED,
+ StatusCode.Code.UNKNOWN,
StatusCode.Code.UNAVAILABLE,
- StatusCode.Code.UNKNOWN)));
+ StatusCode.Code.DEADLINE_EXCEEDED)));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}
@@ -614,20 +607,33 @@ public static class Builder extends StubSettings.BuilderThis class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator")
+@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+public abstract class SchemaServiceStub implements BackgroundResource {
+
+ public UnaryCallable createSchemaCallable() {
+ throw new UnsupportedOperationException("Not implemented: createSchemaCallable()");
+ }
+
+ public UnaryCallable getSchemaCallable() {
+ throw new UnsupportedOperationException("Not implemented: getSchemaCallable()");
+ }
+
+ public UnaryCallable listSchemasPagedCallable() {
+ throw new UnsupportedOperationException("Not implemented: listSchemasPagedCallable()");
+ }
+
+ public UnaryCallable listSchemasCallable() {
+ throw new UnsupportedOperationException("Not implemented: listSchemasCallable()");
+ }
+
+ public UnaryCallable deleteSchemaCallable() {
+ throw new UnsupportedOperationException("Not implemented: deleteSchemaCallable()");
+ }
+
+ public UnaryCallable validateSchemaCallable() {
+ throw new UnsupportedOperationException("Not implemented: validateSchemaCallable()");
+ }
+
+ public UnaryCallable validateMessageCallable() {
+ throw new UnsupportedOperationException("Not implemented: validateMessageCallable()");
+ }
+
+ @Override
+ public abstract void close();
+}
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
new file mode 100644
index 000000000..c78c64fc2
--- /dev/null
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java
@@ -0,0 +1,561 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.pubsub.v1.stub;
+
+import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.GaxProperties;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.GaxGrpcProperties;
+import com.google.api.gax.grpc.GrpcTransportChannel;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.retrying.RetrySettings;
+import com.google.api.gax.rpc.ApiCallContext;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.PagedListDescriptor;
+import com.google.api.gax.rpc.PagedListResponseFactory;
+import com.google.api.gax.rpc.StatusCode;
+import com.google.api.gax.rpc.StubSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.protobuf.Empty;
+import com.google.pubsub.v1.CreateSchemaRequest;
+import com.google.pubsub.v1.DeleteSchemaRequest;
+import com.google.pubsub.v1.GetSchemaRequest;
+import com.google.pubsub.v1.ListSchemasRequest;
+import com.google.pubsub.v1.ListSchemasResponse;
+import com.google.pubsub.v1.Schema;
+import com.google.pubsub.v1.ValidateMessageRequest;
+import com.google.pubsub.v1.ValidateMessageResponse;
+import com.google.pubsub.v1.ValidateSchemaRequest;
+import com.google.pubsub.v1.ValidateSchemaResponse;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+import org.threeten.bp.Duration;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Settings class to configure an instance of {@link SchemaServiceStub}.
+ *
+ *
The default instance has everything set to sensible defaults:
+ *
+ *
+ *
The default service address (pubsub.googleapis.com) and default port (443) are used.
+ *
Credentials are acquired automatically through Application Default Credentials.
+ *
Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ *
The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ *
For example, to set the total timeout of createSchema to 30 seconds:
+ *
+ *