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: + * + *

+ * 
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Schema schema = Schema.newBuilder().build();
+ *   String schemaId = "";
+ *   Schema response = schemaServiceClient.createSchema(parent, schema, schemaId);
+ * }
+ * 
+ * 
+ * + *

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: + * + *

    + *
  1. 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. + *
  2. 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. + *
  3. 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: + * + *

To customize credentials: + * + *

+ * 
+ * SchemaServiceSettings schemaServiceSettings =
+ *     SchemaServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SchemaServiceClient schemaServiceClient =
+ *     SchemaServiceClient.create(schemaServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * SchemaServiceSettings schemaServiceSettings =
+ *     SchemaServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SchemaServiceClient schemaServiceClient =
+ *     SchemaServiceClient.create(schemaServiceSettings);
+ * 
+ * 
+ */ +@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. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Schema schema = Schema.newBuilder().build();
+   *   String schemaId = "";
+   *   Schema response = schemaServiceClient.createSchema(parent, schema, schemaId);
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Schema schema = Schema.newBuilder().build();
+   *   String schemaId = "";
+   *   Schema response = schemaServiceClient.createSchema(parent.toString(), schema, schemaId);
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Schema schema = Schema.newBuilder().build();
+   *   CreateSchemaRequest request = CreateSchemaRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setSchema(schema)
+   *     .build();
+   *   Schema response = schemaServiceClient.createSchema(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 createSchema(CreateSchemaRequest request) { + return createSchemaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Schema schema = Schema.newBuilder().build();
+   *   CreateSchemaRequest request = CreateSchemaRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setSchema(schema)
+   *     .build();
+   *   ApiFuture<Schema> future = schemaServiceClient.createSchemaCallable().futureCall(request);
+   *   // Do something
+   *   Schema response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createSchemaCallable() { + return stub.createSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
+   *   Schema response = schemaServiceClient.getSchema(name);
+   * }
+   * 
+ * + * @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(SchemaName name) { + GetSchemaRequest request = + GetSchemaRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSchema(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
+   *   Schema response = schemaServiceClient.getSchema(name.toString());
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
+   *   GetSchemaRequest request = GetSchemaRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Schema response = schemaServiceClient.getSchema(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 getSchema(GetSchemaRequest request) { + return getSchemaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
+   *   GetSchemaRequest request = GetSchemaRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Schema> future = schemaServiceClient.getSchemaCallable().futureCall(request);
+   *   // Do something
+   *   Schema response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getSchemaCallable() { + return stub.getSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists schemas in a project. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (Schema element : schemaServiceClient.listSchemas(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (Schema element : schemaServiceClient.listSchemas(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListSchemasRequest request = ListSchemasRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Schema element : schemaServiceClient.listSchemas(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListSchemasRequest request = ListSchemasRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListSchemasPagedResponse> future = schemaServiceClient.listSchemasPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Schema element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listSchemasPagedCallable() { + return stub.listSchemasPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists schemas in a project. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListSchemasRequest request = ListSchemasRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListSchemasResponse response = schemaServiceClient.listSchemasCallable().call(request);
+   *     for (Schema element : response.getSchemasList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listSchemasCallable() { + return stub.listSchemasCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
+   *   schemaServiceClient.deleteSchema(name);
+   * }
+   * 
+ * + * @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(SchemaName name) { + DeleteSchemaRequest request = + DeleteSchemaRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteSchema(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
+   *   schemaServiceClient.deleteSchema(name.toString());
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
+   *   DeleteSchemaRequest request = DeleteSchemaRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   schemaServiceClient.deleteSchema(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 void deleteSchema(DeleteSchemaRequest request) { + deleteSchemaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
+   *   DeleteSchemaRequest request = DeleteSchemaRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = schemaServiceClient.deleteSchemaCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteSchemaCallable() { + return stub.deleteSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Validates a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Schema schema = Schema.newBuilder().build();
+   *   ValidateSchemaResponse response = schemaServiceClient.validateSchema(parent, 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(ProjectName parent, Schema schema) { + ValidateSchemaRequest request = + ValidateSchemaRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSchema(schema) + .build(); + return validateSchema(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Validates a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Schema schema = Schema.newBuilder().build();
+   *   ValidateSchemaResponse response = schemaServiceClient.validateSchema(parent.toString(), 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. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Schema schema = Schema.newBuilder().build();
+   *   ValidateSchemaRequest request = ValidateSchemaRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setSchema(schema)
+   *     .build();
+   *   ValidateSchemaResponse response = schemaServiceClient.validateSchema(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 ValidateSchemaResponse validateSchema(ValidateSchemaRequest request) { + return validateSchemaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Validates a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Schema schema = Schema.newBuilder().build();
+   *   ValidateSchemaRequest request = ValidateSchemaRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setSchema(schema)
+   *     .build();
+   *   ApiFuture<ValidateSchemaResponse> future = schemaServiceClient.validateSchemaCallable().futureCall(request);
+   *   // Do something
+   *   ValidateSchemaResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + validateSchemaCallable() { + return stub.validateSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Validates a message against a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ValidateMessageRequest request = ValidateMessageRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ValidateMessageResponse response = schemaServiceClient.validateMessage(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 ValidateMessageResponse validateMessage(ValidateMessageRequest request) { + return validateMessageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Validates a message against a schema. + * + *

Sample code: + * + *


+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ValidateMessageRequest request = ValidateMessageRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ValidateMessageResponse> future = schemaServiceClient.validateMessageCallable().futureCall(request);
+   *   // Do something
+   *   ValidateMessageResponse response = future.get();
+   * }
+   * 
+ */ + 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: + * + *

+ * 
+ * SchemaServiceSettings.Builder schemaServiceSettingsBuilder =
+ *     SchemaServiceSettings.newBuilder();
+ * schemaServiceSettingsBuilder
+ *     .createSchemaSettings()
+ *     .setRetrySettings(
+ *         schemaServiceSettingsBuilder.createSchemaSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@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). * *

Sample code: * diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/package-info.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/package-info.java index f7d1e28c2..88af5d794 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/package-info.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/package-info.java @@ -19,7 +19,24 @@ * *

The interfaces provided are listed below, along with usage samples. * - *

================ TopicAdminClient ================ + *

=================== SchemaServiceClient =================== + * + *

Service Description: + * + *

Sample for SchemaServiceClient: + * + *

+ * 
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Schema schema = Schema.newBuilder().build();
+ *   String schemaId = "";
+ *   Schema response = schemaServiceClient.createSchema(parent, schema, schemaId);
+ * }
+ * 
+ * 
+ * + * ================ TopicAdminClient ================ * *

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: + * + *

+ * 
+ * SchemaServiceStubSettings.Builder schemaServiceSettingsBuilder =
+ *     SchemaServiceStubSettings.newBuilder();
+ * schemaServiceSettingsBuilder
+ *     .createSchemaSettings()
+ *     .setRetrySettings(
+ *         schemaServiceSettingsBuilder.createSchemaSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +public class SchemaServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/pubsub") + .build(); + + private final UnaryCallSettings createSchemaSettings; + private final UnaryCallSettings getSchemaSettings; + private final PagedCallSettings + listSchemasSettings; + private final UnaryCallSettings deleteSchemaSettings; + private final UnaryCallSettings + validateSchemaSettings; + private final UnaryCallSettings + validateMessageSettings; + + /** Returns the object with the settings used for calls to createSchema. */ + public UnaryCallSettings createSchemaSettings() { + return createSchemaSettings; + } + + /** Returns the object with the settings used for calls to getSchema. */ + public UnaryCallSettings getSchemaSettings() { + return getSchemaSettings; + } + + /** Returns the object with the settings used for calls to listSchemas. */ + public PagedCallSettings + listSchemasSettings() { + return listSchemasSettings; + } + + /** Returns the object with the settings used for calls to deleteSchema. */ + public UnaryCallSettings deleteSchemaSettings() { + return deleteSchemaSettings; + } + + /** Returns the object with the settings used for calls to validateSchema. */ + public UnaryCallSettings validateSchemaSettings() { + return validateSchemaSettings; + } + + /** Returns the object with the settings used for calls to validateMessage. */ + public UnaryCallSettings + validateMessageSettings() { + return validateMessageSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SchemaServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSchemaServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "pubsub.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SchemaServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** 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 SchemaServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSchemaSettings = settingsBuilder.createSchemaSettings().build(); + getSchemaSettings = settingsBuilder.getSchemaSettings().build(); + listSchemasSettings = settingsBuilder.listSchemasSettings().build(); + deleteSchemaSettings = settingsBuilder.deleteSchemaSettings().build(); + validateSchemaSettings = settingsBuilder.validateSchemaSettings().build(); + validateMessageSettings = settingsBuilder.validateMessageSettings().build(); + } + + private static final PagedListDescriptor + LIST_SCHEMAS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSchemasRequest injectToken(ListSchemasRequest payload, String token) { + return ListSchemasRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSchemasRequest injectPageSize(ListSchemasRequest payload, int pageSize) { + return ListSchemasRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSchemasRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSchemasResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSchemasResponse payload) { + return payload.getSchemasList() != null + ? payload.getSchemasList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse> + LIST_SCHEMAS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSchemasRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SCHEMAS_PAGE_STR_DESC, request, context); + return ListSchemasPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for SchemaServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder createSchemaSettings; + private final UnaryCallSettings.Builder getSchemaSettings; + private final PagedCallSettings.Builder< + ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse> + listSchemasSettings; + private final UnaryCallSettings.Builder deleteSchemaSettings; + private final UnaryCallSettings.Builder + validateSchemaSettings; + private final UnaryCallSettings.Builder + validateMessageSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_4_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.RESOURCE_EXHAUSTED, + StatusCode.Code.ABORTED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_6_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_3_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNKNOWN, StatusCode.Code.ABORTED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.ABORTED, + StatusCode.Code.CANCELLED, + StatusCode.Code.INTERNAL, + StatusCode.Code.RESOURCE_EXHAUSTED, + StatusCode.Code.UNKNOWN, + StatusCode.Code.UNAVAILABLE, + StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "retry_policy_5_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNKNOWN, StatusCode.Code.ABORTED, StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_3_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_6_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(900000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(900000L)) + .setTotalTimeout(Duration.ofMillis(900000L)) + .build(); + definitions.put("retry_policy_4_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_5_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listSchemasSettings = PagedCallSettings.newBuilder(LIST_SCHEMAS_PAGE_STR_FACT); + + deleteSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + validateSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + validateMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSchemaSettings, + getSchemaSettings, + listSchemasSettings, + deleteSchemaSettings, + validateSchemaSettings, + validateMessageSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listSchemasSettings() + .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")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .validateSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .validateMessageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + protected Builder(SchemaServiceStubSettings settings) { + super(settings); + + createSchemaSettings = settings.createSchemaSettings.toBuilder(); + getSchemaSettings = settings.getSchemaSettings.toBuilder(); + listSchemasSettings = settings.listSchemasSettings.toBuilder(); + deleteSchemaSettings = settings.deleteSchemaSettings.toBuilder(); + validateSchemaSettings = settings.validateSchemaSettings.toBuilder(); + validateMessageSettings = settings.validateMessageSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSchemaSettings, + getSchemaSettings, + listSchemasSettings, + deleteSchemaSettings, + validateSchemaSettings, + validateMessageSettings); + } + + // 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(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSchema. */ + public UnaryCallSettings.Builder createSchemaSettings() { + return createSchemaSettings; + } + + /** Returns the builder for the settings used for calls to getSchema. */ + public UnaryCallSettings.Builder getSchemaSettings() { + return getSchemaSettings; + } + + /** Returns the builder for the settings used for calls to listSchemas. */ + public PagedCallSettings.Builder< + ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse> + listSchemasSettings() { + return listSchemasSettings; + } + + /** Returns the builder for the settings used for calls to deleteSchema. */ + public UnaryCallSettings.Builder deleteSchemaSettings() { + return deleteSchemaSettings; + } + + /** Returns the builder for the settings used for calls to validateSchema. */ + public UnaryCallSettings.Builder + validateSchemaSettings() { + return validateSchemaSettings; + } + + /** Returns the builder for the settings used for calls to validateMessage. */ + public UnaryCallSettings.Builder + validateMessageSettings() { + return validateMessageSettings; + } + + @Override + public SchemaServiceStubSettings build() throws IOException { + return new SchemaServiceStubSettings(this); + } + } +} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java index a6d1a9826..d061959f1 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java @@ -490,27 +490,23 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_4_codes", ImmutableSet.copyOf( Lists.newArrayList( - StatusCode.Code.ABORTED, StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.RESOURCE_EXHAUSTED, + StatusCode.Code.ABORTED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNAVAILABLE))); definitions.put( - "non_idempotent", + "retry_policy_6_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "idempotent2", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "streaming_pull", + "retry_policy_5_codes", ImmutableSet.copyOf( Lists.newArrayList( - StatusCode.Code.ABORTED, - StatusCode.Code.DEADLINE_EXCEEDED, - StatusCode.Code.INTERNAL, - StatusCode.Code.RESOURCE_EXHAUSTED, - StatusCode.Code.UNAVAILABLE))); + StatusCode.Code.UNKNOWN, StatusCode.Code.ABORTED, StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -527,31 +523,33 @@ public static class Builder extends StubSettings.Builder getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java new file mode 100644 index 000000000..be26a2894 --- /dev/null +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java @@ -0,0 +1,156 @@ +/* + * 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.BetaApi; +import com.google.protobuf.AbstractMessage; +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.SchemaServiceGrpc.SchemaServiceImplBase; +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.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockSchemaServiceImpl extends SchemaServiceImplBase { + private List requests; + private Queue responses; + + public MockSchemaServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createSchema(CreateSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Schema) { + requests.add(request); + responseObserver.onNext((Schema) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getSchema(GetSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Schema) { + requests.add(request); + responseObserver.onNext((Schema) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listSchemas( + ListSchemasRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListSchemasResponse) { + requests.add(request); + responseObserver.onNext((ListSchemasResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteSchema(DeleteSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void validateSchema( + ValidateSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ValidateSchemaResponse) { + requests.add(request); + responseObserver.onNext((ValidateSchemaResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void validateMessage( + ValidateMessageRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ValidateMessageResponse) { + requests.add(request); + responseObserver.onNext((ValidateMessageResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java new file mode 100644 index 000000000..286a1362b --- /dev/null +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java @@ -0,0 +1,356 @@ +/* + * 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.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +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 io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class SchemaServiceClientTest { + private static MockSchemaService mockSchemaService; + private static MockPublisher mockPublisher; + private static MockIAMPolicy mockIAMPolicy; + private static MockSubscriber mockSubscriber; + private static MockServiceHelper serviceHelper; + private SchemaServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockSchemaService = new MockSchemaService(); + mockPublisher = new MockPublisher(); + mockIAMPolicy = new MockIAMPolicy(); + mockSubscriber = new MockSubscriber(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockSchemaService, mockPublisher, mockIAMPolicy, mockSubscriber)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + SchemaServiceSettings settings = + SchemaServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SchemaServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createSchemaTest() { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + String definition = "definition-1014418093"; + Schema expectedResponse = + Schema.newBuilder().setName(name.toString()).setDefinition(definition).build(); + mockSchemaService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-153006983"; + + Schema actualResponse = client.createSchema(parent, schema, schemaId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSchemaRequest actualRequest = (CreateSchemaRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(schema, actualRequest.getSchema()); + Assert.assertEquals(schemaId, actualRequest.getSchemaId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-153006983"; + + client.createSchema(parent, schema, schemaId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getSchemaTest() { + SchemaName name2 = SchemaName.of("[PROJECT]", "[SCHEMA]"); + String definition = "definition-1014418093"; + Schema expectedResponse = + Schema.newBuilder().setName(name2.toString()).setDefinition(definition).build(); + mockSchemaService.addResponse(expectedResponse); + + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + + Schema actualResponse = client.getSchema(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSchemaRequest actualRequest = (GetSchemaRequest) actualRequests.get(0); + + Assert.assertEquals(name, SchemaName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + + client.getSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listSchemasTest() { + String nextPageToken = ""; + Schema schemasElement = Schema.newBuilder().build(); + List schemas = Arrays.asList(schemasElement); + ListSchemasResponse expectedResponse = + ListSchemasResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllSchemas(schemas) + .build(); + mockSchemaService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListSchemasPagedResponse pagedListResponse = client.listSchemas(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSchemasList().get(0), resources.get(0)); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSchemasRequest actualRequest = (ListSchemasRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listSchemasExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + + client.listSchemas(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteSchemaTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockSchemaService.addResponse(expectedResponse); + + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + + client.deleteSchema(name); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSchemaRequest actualRequest = (DeleteSchemaRequest) actualRequests.get(0); + + Assert.assertEquals(name, SchemaName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + + client.deleteSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void validateSchemaTest() { + ValidateSchemaResponse expectedResponse = ValidateSchemaResponse.newBuilder().build(); + mockSchemaService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + Schema schema = Schema.newBuilder().build(); + + ValidateSchemaResponse actualResponse = client.validateSchema(parent, schema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ValidateSchemaRequest actualRequest = (ValidateSchemaRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(schema, actualRequest.getSchema()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void validateSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + Schema schema = Schema.newBuilder().build(); + + client.validateSchema(parent, schema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void validateMessageTest() { + ValidateMessageResponse expectedResponse = ValidateMessageResponse.newBuilder().build(); + mockSchemaService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + ValidateMessageRequest request = + ValidateMessageRequest.newBuilder().setParent(parent.toString()).build(); + + ValidateMessageResponse actualResponse = client.validateMessage(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ValidateMessageRequest actualRequest = (ValidateMessageRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void validateMessageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + ValidateMessageRequest request = + ValidateMessageRequest.newBuilder().setParent(parent.toString()).build(); + + client.validateMessage(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java index ac0be311c..16cf9889b 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java @@ -86,6 +86,7 @@ @javax.annotation.Generated("by GAPIC") public class SubscriptionAdminClientTest { + private static MockSchemaService mockSchemaService; private static MockPublisher mockPublisher; private static MockIAMPolicy mockIAMPolicy; private static MockSubscriber mockSubscriber; @@ -95,13 +96,15 @@ public class SubscriptionAdminClientTest { @BeforeClass public static void startStaticServer() { + mockSchemaService = new MockSchemaService(); mockPublisher = new MockPublisher(); mockIAMPolicy = new MockIAMPolicy(); mockSubscriber = new MockSubscriber(); serviceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList(mockPublisher, mockIAMPolicy, mockSubscriber)); + Arrays.asList( + mockSchemaService, mockPublisher, mockIAMPolicy, mockSubscriber)); serviceHelper.start(); } diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java index 1f8e26ac8..f6c1607db 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java @@ -72,6 +72,7 @@ @javax.annotation.Generated("by GAPIC") public class TopicAdminClientTest { + private static MockSchemaService mockSchemaService; private static MockPublisher mockPublisher; private static MockIAMPolicy mockIAMPolicy; private static MockSubscriber mockSubscriber; @@ -81,13 +82,15 @@ public class TopicAdminClientTest { @BeforeClass public static void startStaticServer() { + mockSchemaService = new MockSchemaService(); mockPublisher = new MockPublisher(); mockIAMPolicy = new MockIAMPolicy(); mockSubscriber = new MockSubscriber(); serviceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList(mockPublisher, mockIAMPolicy, mockSubscriber)); + Arrays.asList( + mockSchemaService, mockPublisher, mockIAMPolicy, mockSubscriber)); serviceHelper.start(); } @@ -118,8 +121,13 @@ public void tearDown() throws Exception { public void createTopicTest() { TopicName name2 = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); String kmsKeyName = "kmsKeyName2094986649"; + boolean satisfiesPzs = false; Topic expectedResponse = - Topic.newBuilder().setName(name2.toString()).setKmsKeyName(kmsKeyName).build(); + Topic.newBuilder() + .setName(name2.toString()) + .setKmsKeyName(kmsKeyName) + .setSatisfiesPzs(satisfiesPzs) + .build(); mockPublisher.addResponse(expectedResponse); TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); @@ -159,8 +167,13 @@ public void createTopicExceptionTest() throws Exception { public void updateTopicTest() { TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); String kmsKeyName = "kmsKeyName2094986649"; + boolean satisfiesPzs = false; Topic expectedResponse = - Topic.newBuilder().setName(name.toString()).setKmsKeyName(kmsKeyName).build(); + Topic.newBuilder() + .setName(name.toString()) + .setKmsKeyName(kmsKeyName) + .setSatisfiesPzs(satisfiesPzs) + .build(); mockPublisher.addResponse(expectedResponse); Topic topic = Topic.newBuilder().build(); @@ -255,8 +268,13 @@ public void publishExceptionTest() throws Exception { public void getTopicTest() { TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); String kmsKeyName = "kmsKeyName2094986649"; + boolean satisfiesPzs = false; Topic expectedResponse = - Topic.newBuilder().setName(name.toString()).setKmsKeyName(kmsKeyName).build(); + Topic.newBuilder() + .setName(name.toString()) + .setKmsKeyName(kmsKeyName) + .setSatisfiesPzs(satisfiesPzs) + .build(); mockPublisher.addResponse(expectedResponse); TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); diff --git a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java index d1e85d8f4..9e0404ebc 100644 --- a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java +++ b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java @@ -468,8 +468,8 @@ public abstract static class PublisherImplBase implements io.grpc.BindableServic * * *
-     * 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).
      * 
*/ public void createTopic( @@ -683,8 +683,8 @@ protected PublisherStub build(io.grpc.Channel channel, io.grpc.CallOptions callO * * *
-     * 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).
      * 
*/ public void createTopic( @@ -859,8 +859,8 @@ protected PublisherBlockingStub build( * * *
-     * 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).
      * 
*/ public com.google.pubsub.v1.Topic createTopic(com.google.pubsub.v1.Topic request) { @@ -1000,8 +1000,8 @@ protected PublisherFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions * * *
-     * 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).
      * 
*/ public com.google.common.util.concurrent.ListenableFuture diff --git a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java new file mode 100644 index 000000000..d68736ce2 --- /dev/null +++ b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java @@ -0,0 +1,868 @@ +/* + * 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.pubsub.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/pubsub/v1/schema.proto") +public final class SchemaServiceGrpc { + + private SchemaServiceGrpc() {} + + public static final String SERVICE_NAME = "google.pubsub.v1.SchemaService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.CreateSchemaRequest, com.google.pubsub.v1.Schema> + getCreateSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSchema", + requestType = com.google.pubsub.v1.CreateSchemaRequest.class, + responseType = com.google.pubsub.v1.Schema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.CreateSchemaRequest, com.google.pubsub.v1.Schema> + getCreateSchemaMethod() { + io.grpc.MethodDescriptor + getCreateSchemaMethod; + if ((getCreateSchemaMethod = SchemaServiceGrpc.getCreateSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getCreateSchemaMethod = SchemaServiceGrpc.getCreateSchemaMethod) == null) { + SchemaServiceGrpc.getCreateSchemaMethod = + getCreateSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.CreateSchemaRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Schema.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("CreateSchema")) + .build(); + } + } + } + return getCreateSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.GetSchemaRequest, com.google.pubsub.v1.Schema> + getGetSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSchema", + requestType = com.google.pubsub.v1.GetSchemaRequest.class, + responseType = com.google.pubsub.v1.Schema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.GetSchemaRequest, com.google.pubsub.v1.Schema> + getGetSchemaMethod() { + io.grpc.MethodDescriptor + getGetSchemaMethod; + if ((getGetSchemaMethod = SchemaServiceGrpc.getGetSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getGetSchemaMethod = SchemaServiceGrpc.getGetSchemaMethod) == null) { + SchemaServiceGrpc.getGetSchemaMethod = + getGetSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.GetSchemaRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Schema.getDefaultInstance())) + .setSchemaDescriptor(new SchemaServiceMethodDescriptorSupplier("GetSchema")) + .build(); + } + } + } + return getGetSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSchemasRequest, com.google.pubsub.v1.ListSchemasResponse> + getListSchemasMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSchemas", + requestType = com.google.pubsub.v1.ListSchemasRequest.class, + responseType = com.google.pubsub.v1.ListSchemasResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSchemasRequest, com.google.pubsub.v1.ListSchemasResponse> + getListSchemasMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSchemasRequest, com.google.pubsub.v1.ListSchemasResponse> + getListSchemasMethod; + if ((getListSchemasMethod = SchemaServiceGrpc.getListSchemasMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getListSchemasMethod = SchemaServiceGrpc.getListSchemasMethod) == null) { + SchemaServiceGrpc.getListSchemasMethod = + getListSchemasMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSchemas")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListSchemasRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListSchemasResponse.getDefaultInstance())) + .setSchemaDescriptor(new SchemaServiceMethodDescriptorSupplier("ListSchemas")) + .build(); + } + } + } + return getListSchemasMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteSchemaRequest, com.google.protobuf.Empty> + getDeleteSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSchema", + requestType = com.google.pubsub.v1.DeleteSchemaRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteSchemaRequest, com.google.protobuf.Empty> + getDeleteSchemaMethod() { + io.grpc.MethodDescriptor + getDeleteSchemaMethod; + if ((getDeleteSchemaMethod = SchemaServiceGrpc.getDeleteSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getDeleteSchemaMethod = SchemaServiceGrpc.getDeleteSchemaMethod) == null) { + SchemaServiceGrpc.getDeleteSchemaMethod = + getDeleteSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.DeleteSchemaRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("DeleteSchema")) + .build(); + } + } + } + return getDeleteSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateSchemaRequest, com.google.pubsub.v1.ValidateSchemaResponse> + getValidateSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ValidateSchema", + requestType = com.google.pubsub.v1.ValidateSchemaRequest.class, + responseType = com.google.pubsub.v1.ValidateSchemaResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateSchemaRequest, com.google.pubsub.v1.ValidateSchemaResponse> + getValidateSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateSchemaRequest, com.google.pubsub.v1.ValidateSchemaResponse> + getValidateSchemaMethod; + if ((getValidateSchemaMethod = SchemaServiceGrpc.getValidateSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getValidateSchemaMethod = SchemaServiceGrpc.getValidateSchemaMethod) == null) { + SchemaServiceGrpc.getValidateSchemaMethod = + getValidateSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ValidateSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ValidateSchemaRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ValidateSchemaResponse.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("ValidateSchema")) + .build(); + } + } + } + return getValidateSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateMessageRequest, com.google.pubsub.v1.ValidateMessageResponse> + getValidateMessageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ValidateMessage", + requestType = com.google.pubsub.v1.ValidateMessageRequest.class, + responseType = com.google.pubsub.v1.ValidateMessageResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateMessageRequest, com.google.pubsub.v1.ValidateMessageResponse> + getValidateMessageMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateMessageRequest, + com.google.pubsub.v1.ValidateMessageResponse> + getValidateMessageMethod; + if ((getValidateMessageMethod = SchemaServiceGrpc.getValidateMessageMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getValidateMessageMethod = SchemaServiceGrpc.getValidateMessageMethod) == null) { + SchemaServiceGrpc.getValidateMessageMethod = + getValidateMessageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ValidateMessage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ValidateMessageRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ValidateMessageResponse.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("ValidateMessage")) + .build(); + } + } + } + return getValidateMessageMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SchemaServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SchemaServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceStub(channel, callOptions); + } + }; + return SchemaServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SchemaServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SchemaServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceBlockingStub(channel, callOptions); + } + }; + return SchemaServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SchemaServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SchemaServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceFutureStub(channel, callOptions); + } + }; + return SchemaServiceFutureStub.newStub(factory, channel); + } + + /** */ + public abstract static class SchemaServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a schema.
+     * 
+ */ + public void createSchema( + com.google.pubsub.v1.CreateSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a schema.
+     * 
+ */ + public void getSchema( + com.google.pubsub.v1.GetSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists schemas in a project.
+     * 
+ */ + public void listSchemas( + com.google.pubsub.v1.ListSchemasRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListSchemasMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a schema.
+     * 
+ */ + public void deleteSchema( + com.google.pubsub.v1.DeleteSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Validates a schema.
+     * 
+ */ + public void validateSchema( + com.google.pubsub.v1.ValidateSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getValidateSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Validates a message against a schema.
+     * 
+ */ + public void validateMessage( + com.google.pubsub.v1.ValidateMessageRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getValidateMessageMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSchemaMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.CreateSchemaRequest, com.google.pubsub.v1.Schema>( + this, METHODID_CREATE_SCHEMA))) + .addMethod( + getGetSchemaMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.GetSchemaRequest, com.google.pubsub.v1.Schema>( + this, METHODID_GET_SCHEMA))) + .addMethod( + getListSchemasMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ListSchemasRequest, + com.google.pubsub.v1.ListSchemasResponse>(this, METHODID_LIST_SCHEMAS))) + .addMethod( + getDeleteSchemaMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.DeleteSchemaRequest, com.google.protobuf.Empty>( + this, METHODID_DELETE_SCHEMA))) + .addMethod( + getValidateSchemaMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ValidateSchemaRequest, + com.google.pubsub.v1.ValidateSchemaResponse>(this, METHODID_VALIDATE_SCHEMA))) + .addMethod( + getValidateMessageMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ValidateMessageRequest, + com.google.pubsub.v1.ValidateMessageResponse>( + this, METHODID_VALIDATE_MESSAGE))) + .build(); + } + } + + /** */ + public static final class SchemaServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SchemaServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SchemaServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a schema.
+     * 
+ */ + public void createSchema( + com.google.pubsub.v1.CreateSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a schema.
+     * 
+ */ + public void getSchema( + com.google.pubsub.v1.GetSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetSchemaMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists schemas in a project.
+     * 
+ */ + public void listSchemas( + com.google.pubsub.v1.ListSchemasRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListSchemasMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a schema.
+     * 
+ */ + public void deleteSchema( + com.google.pubsub.v1.DeleteSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Validates a schema.
+     * 
+ */ + public void validateSchema( + com.google.pubsub.v1.ValidateSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getValidateSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Validates a message against a schema.
+     * 
+ */ + public void validateMessage( + com.google.pubsub.v1.ValidateMessageRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getValidateMessageMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** */ + public static final class SchemaServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SchemaServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SchemaServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a schema.
+     * 
+ */ + public com.google.pubsub.v1.Schema createSchema( + com.google.pubsub.v1.CreateSchemaRequest request) { + return blockingUnaryCall(getChannel(), getCreateSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a schema.
+     * 
+ */ + public com.google.pubsub.v1.Schema getSchema(com.google.pubsub.v1.GetSchemaRequest request) { + return blockingUnaryCall(getChannel(), getGetSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists schemas in a project.
+     * 
+ */ + public com.google.pubsub.v1.ListSchemasResponse listSchemas( + com.google.pubsub.v1.ListSchemasRequest request) { + return blockingUnaryCall(getChannel(), getListSchemasMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a schema.
+     * 
+ */ + public com.google.protobuf.Empty deleteSchema( + com.google.pubsub.v1.DeleteSchemaRequest request) { + return blockingUnaryCall(getChannel(), getDeleteSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Validates a schema.
+     * 
+ */ + public com.google.pubsub.v1.ValidateSchemaResponse validateSchema( + com.google.pubsub.v1.ValidateSchemaRequest request) { + return blockingUnaryCall(getChannel(), getValidateSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Validates a message against a schema.
+     * 
+ */ + public com.google.pubsub.v1.ValidateMessageResponse validateMessage( + com.google.pubsub.v1.ValidateMessageRequest request) { + return blockingUnaryCall(getChannel(), getValidateMessageMethod(), getCallOptions(), request); + } + } + + /** */ + public static final class SchemaServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SchemaServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SchemaServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a schema.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSchema(com.google.pubsub.v1.CreateSchemaRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a schema.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getSchema(com.google.pubsub.v1.GetSchemaRequest request) { + return futureUnaryCall(getChannel().newCall(getGetSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists schemas in a project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.ListSchemasResponse> + listSchemas(com.google.pubsub.v1.ListSchemasRequest request) { + return futureUnaryCall( + getChannel().newCall(getListSchemasMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a schema.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSchema(com.google.pubsub.v1.DeleteSchemaRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Validates a schema.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.ValidateSchemaResponse> + validateSchema(com.google.pubsub.v1.ValidateSchemaRequest request) { + return futureUnaryCall( + getChannel().newCall(getValidateSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Validates a message against a schema.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.ValidateMessageResponse> + validateMessage(com.google.pubsub.v1.ValidateMessageRequest request) { + return futureUnaryCall( + getChannel().newCall(getValidateMessageMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SCHEMA = 0; + private static final int METHODID_GET_SCHEMA = 1; + private static final int METHODID_LIST_SCHEMAS = 2; + private static final int METHODID_DELETE_SCHEMA = 3; + private static final int METHODID_VALIDATE_SCHEMA = 4; + private static final int METHODID_VALIDATE_MESSAGE = 5; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final SchemaServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SchemaServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_SCHEMA: + serviceImpl.createSchema( + (com.google.pubsub.v1.CreateSchemaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SCHEMA: + serviceImpl.getSchema( + (com.google.pubsub.v1.GetSchemaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SCHEMAS: + serviceImpl.listSchemas( + (com.google.pubsub.v1.ListSchemasRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SCHEMA: + serviceImpl.deleteSchema( + (com.google.pubsub.v1.DeleteSchemaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_VALIDATE_SCHEMA: + serviceImpl.validateSchema( + (com.google.pubsub.v1.ValidateSchemaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_VALIDATE_MESSAGE: + serviceImpl.validateMessage( + (com.google.pubsub.v1.ValidateMessageRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class SchemaServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SchemaServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.pubsub.v1.SchemaProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SchemaService"); + } + } + + private static final class SchemaServiceFileDescriptorSupplier + extends SchemaServiceBaseDescriptorSupplier { + SchemaServiceFileDescriptorSupplier() {} + } + + private static final class SchemaServiceMethodDescriptorSupplier + extends SchemaServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SchemaServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SchemaServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SchemaServiceFileDescriptorSupplier()) + .addMethod(getCreateSchemaMethod()) + .addMethod(getGetSchemaMethod()) + .addMethod(getListSchemasMethod()) + .addMethod(getDeleteSchemaMethod()) + .addMethod(getValidateSchemaMethod()) + .addMethod(getValidateMessageMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java index 37ba4c003..411cc9243 100644 --- a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java +++ b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java @@ -1015,8 +1015,8 @@ public void deleteSnapshot( * *
      * 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
+     * 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 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
@@ -1464,8 +1464,8 @@ public void deleteSnapshot(
      *
      * 
      * 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
+     * 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 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
@@ -1743,8 +1743,8 @@ public com.google.protobuf.Empty deleteSnapshot(
      *
      * 
      * 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
+     * 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 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
@@ -2029,8 +2029,8 @@ protected SubscriberFutureStub build(io.grpc.Channel channel, io.grpc.CallOption
      *
      * 
      * 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
+     * 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 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
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequest.java
new file mode 100644
index 000000000..6c7618f9c
--- /dev/null
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequest.java
@@ -0,0 +1,1156 @@
+/*
+ * 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.
+ */
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/pubsub/v1/schema.proto
+
+package com.google.pubsub.v1;
+
+/**
+ *
+ *
+ * 
+ * Request for the CreateSchema method.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.CreateSchemaRequest} + */ +public final class CreateSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.CreateSchemaRequest) + CreateSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSchemaRequest.newBuilder() to construct. + private CreateSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSchemaRequest() { + parent_ = ""; + schemaId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSchemaRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateSchemaRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.pubsub.v1.Schema.Builder subBuilder = null; + if (schema_ != null) { + subBuilder = schema_.toBuilder(); + } + schema_ = input.readMessage(com.google.pubsub.v1.Schema.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(schema_); + schema_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + schemaId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_CreateSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_CreateSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.CreateSchemaRequest.class, + com.google.pubsub.v1.CreateSchemaRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the project in which to create the schema.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the project in which to create the schema.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCHEMA_FIELD_NUMBER = 2; + private com.google.pubsub.v1.Schema 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`.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return schema_ != null; + } + /** + * + * + *
+   * 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`.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schema. + */ + @java.lang.Override + public com.google.pubsub.v1.Schema getSchema() { + return schema_ == null ? com.google.pubsub.v1.Schema.getDefaultInstance() : 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`.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaOrBuilder getSchemaOrBuilder() { + return getSchema(); + } + + public static final int SCHEMA_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object 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.
+   * 
+ * + * string schema_id = 3; + * + * @return The schemaId. + */ + @java.lang.Override + public java.lang.String getSchemaId() { + java.lang.Object ref = schemaId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaId_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string schema_id = 3; + * + * @return The bytes for schemaId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaIdBytes() { + java.lang.Object ref = schemaId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (schema_ != null) { + output.writeMessage(2, getSchema()); + } + if (!getSchemaIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, schemaId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (schema_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSchema()); + } + if (!getSchemaIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, schemaId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.CreateSchemaRequest)) { + return super.equals(obj); + } + com.google.pubsub.v1.CreateSchemaRequest other = (com.google.pubsub.v1.CreateSchemaRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasSchema() != other.hasSchema()) return false; + if (hasSchema()) { + if (!getSchema().equals(other.getSchema())) return false; + } + if (!getSchemaId().equals(other.getSchemaId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSchema()) { + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema().hashCode(); + } + hash = (37 * hash) + SCHEMA_ID_FIELD_NUMBER; + hash = (53 * hash) + getSchemaId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.CreateSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.CreateSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the CreateSchema method.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.CreateSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.CreateSchemaRequest) + com.google.pubsub.v1.CreateSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_CreateSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_CreateSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.CreateSchemaRequest.class, + com.google.pubsub.v1.CreateSchemaRequest.Builder.class); + } + + // Construct using com.google.pubsub.v1.CreateSchemaRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (schemaBuilder_ == null) { + schema_ = null; + } else { + schema_ = null; + schemaBuilder_ = null; + } + schemaId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_CreateSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.CreateSchemaRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.CreateSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.CreateSchemaRequest build() { + com.google.pubsub.v1.CreateSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.CreateSchemaRequest buildPartial() { + com.google.pubsub.v1.CreateSchemaRequest result = + new com.google.pubsub.v1.CreateSchemaRequest(this); + result.parent_ = parent_; + if (schemaBuilder_ == null) { + result.schema_ = schema_; + } else { + result.schema_ = schemaBuilder_.build(); + } + result.schemaId_ = schemaId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.CreateSchemaRequest) { + return mergeFrom((com.google.pubsub.v1.CreateSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.CreateSchemaRequest other) { + if (other == com.google.pubsub.v1.CreateSchemaRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasSchema()) { + mergeSchema(other.getSchema()); + } + if (!other.getSchemaId().isEmpty()) { + schemaId_ = other.schemaId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.CreateSchemaRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.CreateSchemaRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the project in which to create the schema.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the project in which to create the schema.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the project in which to create the schema.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which to create the schema.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which to create the schema.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.pubsub.v1.Schema schema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder> + schemaBuilder_; + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the schema field is set. + */ + public boolean hasSchema() { + return schemaBuilder_ != null || schema_ != null; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schema. + */ + public com.google.pubsub.v1.Schema getSchema() { + if (schemaBuilder_ == null) { + return schema_ == null ? com.google.pubsub.v1.Schema.getDefaultInstance() : schema_; + } else { + return schemaBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSchema(com.google.pubsub.v1.Schema value) { + if (schemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schema_ = value; + onChanged(); + } else { + schemaBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSchema(com.google.pubsub.v1.Schema.Builder builderForValue) { + if (schemaBuilder_ == null) { + schema_ = builderForValue.build(); + onChanged(); + } else { + schemaBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeSchema(com.google.pubsub.v1.Schema value) { + if (schemaBuilder_ == null) { + if (schema_ != null) { + schema_ = com.google.pubsub.v1.Schema.newBuilder(schema_).mergeFrom(value).buildPartial(); + } else { + schema_ = value; + } + onChanged(); + } else { + schemaBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearSchema() { + if (schemaBuilder_ == null) { + schema_ = null; + onChanged(); + } else { + schema_ = null; + schemaBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.pubsub.v1.Schema.Builder getSchemaBuilder() { + + onChanged(); + return getSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.pubsub.v1.SchemaOrBuilder getSchemaOrBuilder() { + if (schemaBuilder_ != null) { + return schemaBuilder_.getMessageOrBuilder(); + } else { + return schema_ == null ? com.google.pubsub.v1.Schema.getDefaultInstance() : 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`.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder> + getSchemaFieldBuilder() { + if (schemaBuilder_ == null) { + schemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder>( + getSchema(), getParentForChildren(), isClean()); + schema_ = null; + } + return schemaBuilder_; + } + + private java.lang.Object 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.
+     * 
+ * + * string schema_id = 3; + * + * @return The schemaId. + */ + public java.lang.String getSchemaId() { + java.lang.Object ref = schemaId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string schema_id = 3; + * + * @return The bytes for schemaId. + */ + public com.google.protobuf.ByteString getSchemaIdBytes() { + java.lang.Object ref = schemaId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string schema_id = 3; + * + * @param value The schemaId to set. + * @return This builder for chaining. + */ + public Builder setSchemaId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + schemaId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string schema_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearSchemaId() { + + schemaId_ = getDefaultInstance().getSchemaId(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string schema_id = 3; + * + * @param value The bytes for schemaId to set. + * @return This builder for chaining. + */ + public Builder setSchemaIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + schemaId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.CreateSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.CreateSchemaRequest) + private static final com.google.pubsub.v1.CreateSchemaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.CreateSchemaRequest(); + } + + public static com.google.pubsub.v1.CreateSchemaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSchemaRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.CreateSchemaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequestOrBuilder.java new file mode 100644 index 000000000..395a549cf --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequestOrBuilder.java @@ -0,0 +1,131 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface CreateSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.CreateSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project in which to create the schema.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the project in which to create the schema.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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`.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the schema field is set. + */ + boolean hasSchema(); + /** + * + * + *
+   * 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`.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schema. + */ + com.google.pubsub.v1.Schema getSchema(); + /** + * + * + *
+   * 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`.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.pubsub.v1.SchemaOrBuilder getSchemaOrBuilder(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string schema_id = 3; + * + * @return The schemaId. + */ + java.lang.String getSchemaId(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string schema_id = 3; + * + * @return The bytes for schemaId. + */ + com.google.protobuf.ByteString getSchemaIdBytes(); +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequest.java new file mode 100644 index 000000000..b09de9b8e --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequest.java @@ -0,0 +1,654 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Request for the `DeleteSchema` method.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.DeleteSchemaRequest} + */ +public final class DeleteSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.DeleteSchemaRequest) + DeleteSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSchemaRequest.newBuilder() to construct. + private DeleteSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSchemaRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSchemaRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteSchemaRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_DeleteSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_DeleteSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.DeleteSchemaRequest.class, + com.google.pubsub.v1.DeleteSchemaRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the schema to delete.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the schema to delete.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.DeleteSchemaRequest)) { + return super.equals(obj); + } + com.google.pubsub.v1.DeleteSchemaRequest other = (com.google.pubsub.v1.DeleteSchemaRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.DeleteSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `DeleteSchema` method.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.DeleteSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.DeleteSchemaRequest) + com.google.pubsub.v1.DeleteSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_DeleteSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_DeleteSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.DeleteSchemaRequest.class, + com.google.pubsub.v1.DeleteSchemaRequest.Builder.class); + } + + // Construct using com.google.pubsub.v1.DeleteSchemaRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_DeleteSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.DeleteSchemaRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.DeleteSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.DeleteSchemaRequest build() { + com.google.pubsub.v1.DeleteSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.DeleteSchemaRequest buildPartial() { + com.google.pubsub.v1.DeleteSchemaRequest result = + new com.google.pubsub.v1.DeleteSchemaRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.DeleteSchemaRequest) { + return mergeFrom((com.google.pubsub.v1.DeleteSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.DeleteSchemaRequest other) { + if (other == com.google.pubsub.v1.DeleteSchemaRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.DeleteSchemaRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.DeleteSchemaRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the schema to delete.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the schema to delete.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the schema to delete.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the schema to delete.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the schema to delete.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.DeleteSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.DeleteSchemaRequest) + private static final com.google.pubsub.v1.DeleteSchemaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.DeleteSchemaRequest(); + } + + public static com.google.pubsub.v1.DeleteSchemaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteSchemaRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.DeleteSchemaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequestOrBuilder.java new file mode 100644 index 000000000..5b4e5d304 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface DeleteSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.DeleteSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the schema to delete.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the schema to delete.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Encoding.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Encoding.java new file mode 100644 index 000000000..838fe7682 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Encoding.java @@ -0,0 +1,178 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Possible encoding types for messages.
+ * 
+ * + * Protobuf enum {@code google.pubsub.v1.Encoding} + */ +public enum Encoding implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified
+   * 
+ * + * ENCODING_UNSPECIFIED = 0; + */ + ENCODING_UNSPECIFIED(0), + /** + * + * + *
+   * JSON encoding
+   * 
+ * + * JSON = 1; + */ + JSON(1), + /** + * + * + *
+   * Binary encoding, as defined by the schema type. For some schema types,
+   * binary encoding may not be available.
+   * 
+ * + * BINARY = 2; + */ + BINARY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified
+   * 
+ * + * ENCODING_UNSPECIFIED = 0; + */ + public static final int ENCODING_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * JSON encoding
+   * 
+ * + * JSON = 1; + */ + public static final int JSON_VALUE = 1; + /** + * + * + *
+   * Binary encoding, as defined by the schema type. For some schema types,
+   * binary encoding may not be available.
+   * 
+ * + * BINARY = 2; + */ + public static final int BINARY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Encoding valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Encoding forNumber(int value) { + switch (value) { + case 0: + return ENCODING_UNSPECIFIED; + case 1: + return JSON; + case 2: + return BINARY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Encoding findValueByNumber(int number) { + return Encoding.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto.getDescriptor().getEnumTypes().get(1); + } + + private static final Encoding[] VALUES = values(); + + public static Encoding valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Encoding(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.pubsub.v1.Encoding) +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequest.java new file mode 100644 index 000000000..d8dd20048 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequest.java @@ -0,0 +1,815 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Request for the GetSchema method.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.GetSchemaRequest} + */ +public final class GetSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.GetSchemaRequest) + GetSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSchemaRequest.newBuilder() to construct. + private GetSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSchemaRequest() { + name_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSchemaRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetSchemaRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + view_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_GetSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_GetSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.GetSchemaRequest.class, + com.google.pubsub.v1.GetSchemaRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the schema to get.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the schema to get.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 2; + private int view_; + /** + * + * + *
+   * The set of fields to return in the response. If not set, returns a Schema
+   * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
+   * fields.
+   * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * The set of fields to return in the response. If not set, returns a Schema
+   * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
+   * fields.
+   * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaView getView() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.valueOf(view_); + return result == null ? com.google.pubsub.v1.SchemaView.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (view_ != com.google.pubsub.v1.SchemaView.SCHEMA_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (view_ != com.google.pubsub.v1.SchemaView.SCHEMA_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.GetSchemaRequest)) { + return super.equals(obj); + } + com.google.pubsub.v1.GetSchemaRequest other = (com.google.pubsub.v1.GetSchemaRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.GetSchemaRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.GetSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.GetSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the GetSchema method.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.GetSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.GetSchemaRequest) + com.google.pubsub.v1.GetSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_GetSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_GetSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.GetSchemaRequest.class, + com.google.pubsub.v1.GetSchemaRequest.Builder.class); + } + + // Construct using com.google.pubsub.v1.GetSchemaRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + view_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_GetSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.GetSchemaRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.GetSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.GetSchemaRequest build() { + com.google.pubsub.v1.GetSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.GetSchemaRequest buildPartial() { + com.google.pubsub.v1.GetSchemaRequest result = + new com.google.pubsub.v1.GetSchemaRequest(this); + result.name_ = name_; + result.view_ = view_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.GetSchemaRequest) { + return mergeFrom((com.google.pubsub.v1.GetSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.GetSchemaRequest other) { + if (other == com.google.pubsub.v1.GetSchemaRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.GetSchemaRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.GetSchemaRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the schema to get.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the schema to get.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the schema to get.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the schema to get.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the schema to get.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * The set of fields to return in the response. If not set, returns a Schema
+     * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
+     * fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * The set of fields to return in the response. If not set, returns a Schema
+     * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
+     * fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The set of fields to return in the response. If not set, returns a Schema
+     * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
+     * fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaView getView() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.valueOf(view_); + return result == null ? com.google.pubsub.v1.SchemaView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The set of fields to return in the response. If not set, returns a Schema
+     * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
+     * fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.pubsub.v1.SchemaView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The set of fields to return in the response. If not set, returns a Schema
+     * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
+     * fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return This builder for chaining. + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.GetSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.GetSchemaRequest) + private static final com.google.pubsub.v1.GetSchemaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.GetSchemaRequest(); + } + + public static com.google.pubsub.v1.GetSchemaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSchemaRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.GetSchemaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequestOrBuilder.java new file mode 100644 index 000000000..54c9481e2 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequestOrBuilder.java @@ -0,0 +1,85 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface GetSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.GetSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the schema to get.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the schema to get.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The set of fields to return in the response. If not set, returns a Schema
+   * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
+   * fields.
+   * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * The set of fields to return in the response. If not set, returns a Schema
+   * with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
+   * fields.
+   * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The view. + */ + com.google.pubsub.v1.SchemaView getView(); +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequest.java new file mode 100644 index 000000000..95cf9ecab --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequest.java @@ -0,0 +1,1099 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Request for the `ListSchemas` method.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.ListSchemasRequest} + */ +public final class ListSchemasRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListSchemasRequest) + ListSchemasRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSchemasRequest.newBuilder() to construct. + private ListSchemasRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSchemasRequest() { + parent_ = ""; + view_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSchemasRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSchemasRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + view_ = rawValue; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ListSchemasRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ListSchemasRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListSchemasRequest.class, + com.google.pubsub.v1.ListSchemasRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the project in which to list schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the project in which to list schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 2; + private int view_; + /** + * + * + *
+   * The set of Schema fields to return in the response. If not set, returns
+   * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+   * retrieve all fields.
+   * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * The set of Schema fields to return in the response. If not set, returns
+   * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+   * retrieve all fields.
+   * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaView getView() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.valueOf(view_); + return result == null ? com.google.pubsub.v1.SchemaView.UNRECOGNIZED : result; + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * Maximum number of schemas to return.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `ListSchemasResponse`; indicates that
+   * this is a continuation of a prior `ListSchemas` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `ListSchemasResponse`; indicates that
+   * this is a continuation of a prior `ListSchemas` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (view_ != com.google.pubsub.v1.SchemaView.SCHEMA_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (view_ != com.google.pubsub.v1.SchemaView.SCHEMA_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.ListSchemasRequest)) { + return super.equals(obj); + } + com.google.pubsub.v1.ListSchemasRequest other = (com.google.pubsub.v1.ListSchemasRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (view_ != other.view_) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.ListSchemasRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ListSchemasRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.ListSchemasRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListSchemas` method.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.ListSchemasRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListSchemasRequest) + com.google.pubsub.v1.ListSchemasRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ListSchemasRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ListSchemasRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListSchemasRequest.class, + com.google.pubsub.v1.ListSchemasRequest.Builder.class); + } + + // Construct using com.google.pubsub.v1.ListSchemasRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + view_ = 0; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ListSchemasRequest_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.ListSchemasRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.ListSchemasRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.ListSchemasRequest build() { + com.google.pubsub.v1.ListSchemasRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.ListSchemasRequest buildPartial() { + com.google.pubsub.v1.ListSchemasRequest result = + new com.google.pubsub.v1.ListSchemasRequest(this); + result.parent_ = parent_; + result.view_ = view_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ListSchemasRequest) { + return mergeFrom((com.google.pubsub.v1.ListSchemasRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ListSchemasRequest other) { + if (other == com.google.pubsub.v1.ListSchemasRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ListSchemasRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ListSchemasRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the project in which to list schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the project in which to list schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the project in which to list schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which to list schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which to list schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * The set of Schema fields to return in the response. If not set, returns
+     * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+     * retrieve all fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * The set of Schema fields to return in the response. If not set, returns
+     * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+     * retrieve all fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The set of Schema fields to return in the response. If not set, returns
+     * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+     * retrieve all fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaView getView() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.valueOf(view_); + return result == null ? com.google.pubsub.v1.SchemaView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The set of Schema fields to return in the response. If not set, returns
+     * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+     * retrieve all fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.pubsub.v1.SchemaView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The set of Schema fields to return in the response. If not set, returns
+     * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+     * retrieve all fields.
+     * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return This builder for chaining. + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of schemas to return.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of schemas to return.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of schemas to return.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `ListSchemasResponse`; indicates that
+     * this is a continuation of a prior `ListSchemas` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListSchemasResponse`; indicates that
+     * this is a continuation of a prior `ListSchemas` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListSchemasResponse`; indicates that
+     * this is a continuation of a prior `ListSchemas` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListSchemasResponse`; indicates that
+     * this is a continuation of a prior `ListSchemas` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListSchemasResponse`; indicates that
+     * this is a continuation of a prior `ListSchemas` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ListSchemasRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSchemasRequest) + private static final com.google.pubsub.v1.ListSchemasRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ListSchemasRequest(); + } + + public static com.google.pubsub.v1.ListSchemasRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSchemasRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSchemasRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.ListSchemasRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequestOrBuilder.java new file mode 100644 index 000000000..bd5787e76 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequestOrBuilder.java @@ -0,0 +1,127 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface ListSchemasRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListSchemasRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project in which to list schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the project in which to list schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The set of Schema fields to return in the response. If not set, returns
+   * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+   * retrieve all fields.
+   * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * The set of Schema fields to return in the response. If not set, returns
+   * Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
+   * retrieve all fields.
+   * 
+ * + * .google.pubsub.v1.SchemaView view = 2; + * + * @return The view. + */ + com.google.pubsub.v1.SchemaView getView(); + + /** + * + * + *
+   * Maximum number of schemas to return.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value returned by the last `ListSchemasResponse`; indicates that
+   * this is a continuation of a prior `ListSchemas` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `ListSchemasResponse`; indicates that
+   * this is a continuation of a prior `ListSchemas` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponse.java new file mode 100644 index 000000000..ea77ff15a --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponse.java @@ -0,0 +1,1125 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Response for the `ListSchemas` method.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.ListSchemasResponse} + */ +public final class ListSchemasResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListSchemasResponse) + ListSchemasResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSchemasResponse.newBuilder() to construct. + private ListSchemasResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSchemasResponse() { + schemas_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSchemasResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSchemasResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + schemas_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + schemas_.add( + input.readMessage(com.google.pubsub.v1.Schema.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + schemas_ = java.util.Collections.unmodifiableList(schemas_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ListSchemasResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ListSchemasResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListSchemasResponse.class, + com.google.pubsub.v1.ListSchemasResponse.Builder.class); + } + + public static final int SCHEMAS_FIELD_NUMBER = 1; + private java.util.List schemas_; + /** + * + * + *
+   * The resulting schemas.
+   * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + @java.lang.Override + public java.util.List getSchemasList() { + return schemas_; + } + /** + * + * + *
+   * The resulting schemas.
+   * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + @java.lang.Override + public java.util.List getSchemasOrBuilderList() { + return schemas_; + } + /** + * + * + *
+   * The resulting schemas.
+   * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + @java.lang.Override + public int getSchemasCount() { + return schemas_.size(); + } + /** + * + * + *
+   * The resulting schemas.
+   * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + @java.lang.Override + public com.google.pubsub.v1.Schema getSchemas(int index) { + return schemas_.get(index); + } + /** + * + * + *
+   * The resulting schemas.
+   * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaOrBuilder getSchemasOrBuilder(int index) { + return schemas_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If not empty, indicates that there may be more schemas that match the
+   * request; this value should be passed in a new `ListSchemasRequest`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If not empty, indicates that there may be more schemas that match the
+   * request; this value should be passed in a new `ListSchemasRequest`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < schemas_.size(); i++) { + output.writeMessage(1, schemas_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < schemas_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, schemas_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.ListSchemasResponse)) { + return super.equals(obj); + } + com.google.pubsub.v1.ListSchemasResponse other = (com.google.pubsub.v1.ListSchemasResponse) obj; + + if (!getSchemasList().equals(other.getSchemasList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSchemasCount() > 0) { + hash = (37 * hash) + SCHEMAS_FIELD_NUMBER; + hash = (53 * hash) + getSchemasList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.ListSchemasResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ListSchemasResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.ListSchemasResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListSchemas` method.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.ListSchemasResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListSchemasResponse) + com.google.pubsub.v1.ListSchemasResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ListSchemasResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ListSchemasResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ListSchemasResponse.class, + com.google.pubsub.v1.ListSchemasResponse.Builder.class); + } + + // Construct using com.google.pubsub.v1.ListSchemasResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSchemasFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (schemasBuilder_ == null) { + schemas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + schemasBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ListSchemasResponse_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.ListSchemasResponse getDefaultInstanceForType() { + return com.google.pubsub.v1.ListSchemasResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.ListSchemasResponse build() { + com.google.pubsub.v1.ListSchemasResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.ListSchemasResponse buildPartial() { + com.google.pubsub.v1.ListSchemasResponse result = + new com.google.pubsub.v1.ListSchemasResponse(this); + int from_bitField0_ = bitField0_; + if (schemasBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + schemas_ = java.util.Collections.unmodifiableList(schemas_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.schemas_ = schemas_; + } else { + result.schemas_ = schemasBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ListSchemasResponse) { + return mergeFrom((com.google.pubsub.v1.ListSchemasResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ListSchemasResponse other) { + if (other == com.google.pubsub.v1.ListSchemasResponse.getDefaultInstance()) return this; + if (schemasBuilder_ == null) { + if (!other.schemas_.isEmpty()) { + if (schemas_.isEmpty()) { + schemas_ = other.schemas_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSchemasIsMutable(); + schemas_.addAll(other.schemas_); + } + onChanged(); + } + } else { + if (!other.schemas_.isEmpty()) { + if (schemasBuilder_.isEmpty()) { + schemasBuilder_.dispose(); + schemasBuilder_ = null; + schemas_ = other.schemas_; + bitField0_ = (bitField0_ & ~0x00000001); + schemasBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSchemasFieldBuilder() + : null; + } else { + schemasBuilder_.addAllMessages(other.schemas_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ListSchemasResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ListSchemasResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List schemas_ = + java.util.Collections.emptyList(); + + private void ensureSchemasIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + schemas_ = new java.util.ArrayList(schemas_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder> + schemasBuilder_; + + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public java.util.List getSchemasList() { + if (schemasBuilder_ == null) { + return java.util.Collections.unmodifiableList(schemas_); + } else { + return schemasBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public int getSchemasCount() { + if (schemasBuilder_ == null) { + return schemas_.size(); + } else { + return schemasBuilder_.getCount(); + } + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public com.google.pubsub.v1.Schema getSchemas(int index) { + if (schemasBuilder_ == null) { + return schemas_.get(index); + } else { + return schemasBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public Builder setSchemas(int index, com.google.pubsub.v1.Schema value) { + if (schemasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchemasIsMutable(); + schemas_.set(index, value); + onChanged(); + } else { + schemasBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public Builder setSchemas(int index, com.google.pubsub.v1.Schema.Builder builderForValue) { + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + schemas_.set(index, builderForValue.build()); + onChanged(); + } else { + schemasBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public Builder addSchemas(com.google.pubsub.v1.Schema value) { + if (schemasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchemasIsMutable(); + schemas_.add(value); + onChanged(); + } else { + schemasBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public Builder addSchemas(int index, com.google.pubsub.v1.Schema value) { + if (schemasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchemasIsMutable(); + schemas_.add(index, value); + onChanged(); + } else { + schemasBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public Builder addSchemas(com.google.pubsub.v1.Schema.Builder builderForValue) { + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + schemas_.add(builderForValue.build()); + onChanged(); + } else { + schemasBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public Builder addSchemas(int index, com.google.pubsub.v1.Schema.Builder builderForValue) { + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + schemas_.add(index, builderForValue.build()); + onChanged(); + } else { + schemasBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public Builder addAllSchemas(java.lang.Iterable values) { + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, schemas_); + onChanged(); + } else { + schemasBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public Builder clearSchemas() { + if (schemasBuilder_ == null) { + schemas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + schemasBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public Builder removeSchemas(int index) { + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + schemas_.remove(index); + onChanged(); + } else { + schemasBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public com.google.pubsub.v1.Schema.Builder getSchemasBuilder(int index) { + return getSchemasFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public com.google.pubsub.v1.SchemaOrBuilder getSchemasOrBuilder(int index) { + if (schemasBuilder_ == null) { + return schemas_.get(index); + } else { + return schemasBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public java.util.List + getSchemasOrBuilderList() { + if (schemasBuilder_ != null) { + return schemasBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(schemas_); + } + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public com.google.pubsub.v1.Schema.Builder addSchemasBuilder() { + return getSchemasFieldBuilder().addBuilder(com.google.pubsub.v1.Schema.getDefaultInstance()); + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public com.google.pubsub.v1.Schema.Builder addSchemasBuilder(int index) { + return getSchemasFieldBuilder() + .addBuilder(index, com.google.pubsub.v1.Schema.getDefaultInstance()); + } + /** + * + * + *
+     * The resulting schemas.
+     * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + public java.util.List getSchemasBuilderList() { + return getSchemasFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder> + getSchemasFieldBuilder() { + if (schemasBuilder_ == null) { + schemasBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder>( + schemas_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + schemas_ = null; + } + return schemasBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If not empty, indicates that there may be more schemas that match the
+     * request; this value should be passed in a new `ListSchemasRequest`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If not empty, indicates that there may be more schemas that match the
+     * request; this value should be passed in a new `ListSchemasRequest`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If not empty, indicates that there may be more schemas that match the
+     * request; this value should be passed in a new `ListSchemasRequest`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If not empty, indicates that there may be more schemas that match the
+     * request; this value should be passed in a new `ListSchemasRequest`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If not empty, indicates that there may be more schemas that match the
+     * request; this value should be passed in a new `ListSchemasRequest`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ListSchemasResponse) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSchemasResponse) + private static final com.google.pubsub.v1.ListSchemasResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ListSchemasResponse(); + } + + public static com.google.pubsub.v1.ListSchemasResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSchemasResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSchemasResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.ListSchemasResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponseOrBuilder.java new file mode 100644 index 000000000..3ee2015b1 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponseOrBuilder.java @@ -0,0 +1,103 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface ListSchemasResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListSchemasResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resulting schemas.
+   * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + java.util.List getSchemasList(); + /** + * + * + *
+   * The resulting schemas.
+   * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + com.google.pubsub.v1.Schema getSchemas(int index); + /** + * + * + *
+   * The resulting schemas.
+   * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + int getSchemasCount(); + /** + * + * + *
+   * The resulting schemas.
+   * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + java.util.List getSchemasOrBuilderList(); + /** + * + * + *
+   * The resulting schemas.
+   * 
+ * + * repeated .google.pubsub.v1.Schema schemas = 1; + */ + com.google.pubsub.v1.SchemaOrBuilder getSchemasOrBuilder(int index); + + /** + * + * + *
+   * If not empty, indicates that there may be more schemas that match the
+   * request; this value should be passed in a new `ListSchemasRequest`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If not empty, indicates that there may be more schemas that match the
+   * request; this value should be passed in a new `ListSchemasRequest`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java index b772a830c..9ce64bc0c 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java @@ -31,6 +31,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_pubsub_v1_MessageStoragePolicy_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_pubsub_v1_MessageStoragePolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_SchemaSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_SchemaSettings_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_pubsub_v1_Topic_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -243,268 +247,273 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "roto\032\036google/protobuf/duration.proto\032\033go" + "ogle/protobuf/empty.proto\032 google/protob" + "uf/field_mask.proto\032\037google/protobuf/tim" - + "estamp.proto\";\n\024MessageStoragePolicy\022#\n\033" - + "allowed_persistence_regions\030\001 \003(\t\"\262\002\n\005To" - + "pic\022\021\n\004name\030\001 \001(\tB\003\340A\002\0223\n\006labels\030\002 \003(\0132#" - + ".google.pubsub.v1.Topic.LabelsEntry\022F\n\026m" - + "essage_storage_policy\030\003 \001(\0132&.google.pub" - + "sub.v1.MessageStoragePolicy\022\024\n\014kms_key_n" - + "ame\030\005 \001(\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n" - + "\005value\030\002 \001(\t:\0028\001:T\352AQ\n\033pubsub.googleapis" - + ".com/Topic\022!projects/{project}/topics/{t" - + "opic}\022\017_deleted-topic_\"\361\001\n\rPubsubMessage" - + "\022\014\n\004data\030\001 \001(\014\022C\n\nattributes\030\002 \003(\0132/.goo" - + "gle.pubsub.v1.PubsubMessage.AttributesEn" - + "try\022\022\n\nmessage_id\030\003 \001(\t\0220\n\014publish_time\030" - + "\004 \001(\0132\032.google.protobuf.Timestamp\022\024\n\014ord" - + "ering_key\030\005 \001(\t\0321\n\017AttributesEntry\022\013\n\003ke" - + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"E\n\017GetTopicRe" - + "quest\0222\n\005topic\030\001 \001(\tB#\340A\002\372A\035\n\033pubsub.goo" - + "gleapis.com/Topic\"w\n\022UpdateTopicRequest\022" - + "+\n\005topic\030\001 \001(\0132\027.google.pubsub.v1.TopicB" - + "\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.proto" - + "buf.FieldMaskB\003\340A\002\"|\n\016PublishRequest\0222\n\005" - + "topic\030\001 \001(\tB#\340A\002\372A\035\n\033pubsub.googleapis.c" - + "om/Topic\0226\n\010messages\030\002 \003(\0132\037.google.pubs" - + "ub.v1.PubsubMessageB\003\340A\002\"&\n\017PublishRespo" - + "nse\022\023\n\013message_ids\030\001 \003(\t\"\200\001\n\021ListTopicsR" - + "equest\022D\n\007project\030\001 \001(\tB3\340A\002\372A-\n+cloudre" - + "sourcemanager.googleapis.com/Project\022\021\n\t" - + "page_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"V\n\022L" - + "istTopicsResponse\022\'\n\006topics\030\001 \003(\0132\027.goog" - + "le.pubsub.v1.Topic\022\027\n\017next_page_token\030\002 " - + "\001(\t\"z\n\035ListTopicSubscriptionsRequest\0222\n\005" + + "estamp.proto\032\035google/pubsub/v1/schema.pr" + + "oto\";\n\024MessageStoragePolicy\022#\n\033allowed_p" + + "ersistence_regions\030\001 \003(\t\"t\n\016SchemaSettin" + + "gs\0224\n\006schema\030\001 \001(\tB$\340A\002\372A\036\n\034pubsub.googl" + + "eapis.com/Schema\022,\n\010encoding\030\002 \001(\0162\032.goo" + + "gle.pubsub.v1.Encoding\"\204\003\n\005Topic\022\021\n\004name" + + "\030\001 \001(\tB\003\340A\002\0223\n\006labels\030\002 \003(\0132#.google.pub" + + "sub.v1.Topic.LabelsEntry\022F\n\026message_stor" + + "age_policy\030\003 \001(\0132&.google.pubsub.v1.Mess" + + "ageStoragePolicy\022\024\n\014kms_key_name\030\005 \001(\t\0229" + + "\n\017schema_settings\030\006 \001(\0132 .google.pubsub." + + "v1.SchemaSettings\022\025\n\rsatisfies_pzs\030\007 \001(\010" + + "\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001:T\352AQ\n\033pubsub.googleapis.com/Topi" + + "c\022!projects/{project}/topics/{topic}\022\017_d" + + "eleted-topic_\"\361\001\n\rPubsubMessage\022\014\n\004data\030" + + "\001 \001(\014\022C\n\nattributes\030\002 \003(\0132/.google.pubsu" + + "b.v1.PubsubMessage.AttributesEntry\022\022\n\nme" + + "ssage_id\030\003 \001(\t\0220\n\014publish_time\030\004 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\022\024\n\014ordering_key" + + "\030\005 \001(\t\0321\n\017AttributesEntry\022\013\n\003key\030\001 \001(\t\022\r" + + "\n\005value\030\002 \001(\t:\0028\001\"E\n\017GetTopicRequest\0222\n\005" + "topic\030\001 \001(\tB#\340A\002\372A\035\n\033pubsub.googleapis.c" - + "om/Topic\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_toke" - + "n\030\003 \001(\t\"y\n\036ListTopicSubscriptionsRespons" - + "e\022>\n\rsubscriptions\030\001 \003(\tB\'\372A$\n\"pubsub.go" - + "ogleapis.com/Subscription\022\027\n\017next_page_t" - + "oken\030\002 \001(\t\"v\n\031ListTopicSnapshotsRequest\022" - + "2\n\005topic\030\001 \001(\tB#\340A\002\372A\035\n\033pubsub.googleapi" - + "s.com/Topic\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_t" - + "oken\030\003 \001(\t\"H\n\032ListTopicSnapshotsResponse" - + "\022\021\n\tsnapshots\030\001 \003(\t\022\027\n\017next_page_token\030\002" - + " \001(\t\"H\n\022DeleteTopicRequest\0222\n\005topic\030\001 \001(" - + "\tB#\340A\002\372A\035\n\033pubsub.googleapis.com/Topic\"]" - + "\n\031DetachSubscriptionRequest\022@\n\014subscript" - + "ion\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.com" - + "/Subscription\"\034\n\032DetachSubscriptionRespo" - + "nse\"\300\005\n\014Subscription\022\021\n\004name\030\001 \001(\tB\003\340A\002\022" - + "2\n\005topic\030\002 \001(\tB#\340A\002\372A\035\n\033pubsub.googleapi" - + "s.com/Topic\0221\n\013push_config\030\004 \001(\0132\034.googl" - + "e.pubsub.v1.PushConfig\022\034\n\024ack_deadline_s" - + "econds\030\005 \001(\005\022\035\n\025retain_acked_messages\030\007 " - + "\001(\010\022=\n\032message_retention_duration\030\010 \001(\0132" - + "\031.google.protobuf.Duration\022:\n\006labels\030\t \003" - + "(\0132*.google.pubsub.v1.Subscription.Label" - + "sEntry\022\037\n\027enable_message_ordering\030\n \001(\010\022" - + "=\n\021expiration_policy\030\013 \001(\0132\".google.pubs" - + "ub.v1.ExpirationPolicy\022\016\n\006filter\030\014 \001(\t\022>" - + "\n\022dead_letter_policy\030\r \001(\0132\".google.pubs" - + "ub.v1.DeadLetterPolicy\0223\n\014retry_policy\030\016" - + " \001(\0132\035.google.pubsub.v1.RetryPolicy\022\020\n\010d" - + "etached\030\017 \001(\010\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(" - + "\t\022\r\n\005value\030\002 \001(\t:\0028\001:X\352AU\n\"pubsub.google" - + "apis.com/Subscription\022/projects/{project" - + "}/subscriptions/{subscription}\"u\n\013RetryP" - + "olicy\0222\n\017minimum_backoff\030\001 \001(\0132\031.google." - + "protobuf.Duration\0222\n\017maximum_backoff\030\002 \001" - + "(\0132\031.google.protobuf.Duration\"L\n\020DeadLet" - + "terPolicy\022\031\n\021dead_letter_topic\030\001 \001(\t\022\035\n\025" - + "max_delivery_attempts\030\002 \001(\005\":\n\020Expiratio" - + "nPolicy\022&\n\003ttl\030\001 \001(\0132\031.google.protobuf.D" - + "uration\"\255\002\n\nPushConfig\022\025\n\rpush_endpoint\030" - + "\001 \001(\t\022@\n\nattributes\030\002 \003(\0132,.google.pubsu" - + "b.v1.PushConfig.AttributesEntry\022<\n\noidc_" - + "token\030\003 \001(\0132&.google.pubsub.v1.PushConfi" - + "g.OidcTokenH\000\032<\n\tOidcToken\022\035\n\025service_ac" - + "count_email\030\001 \001(\t\022\020\n\010audience\030\002 \001(\t\0321\n\017A" - + "ttributesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" - + "(\t:\0028\001B\027\n\025authentication_method\"m\n\017Recei" - + "vedMessage\022\016\n\006ack_id\030\001 \001(\t\0220\n\007message\030\002 " - + "\001(\0132\037.google.pubsub.v1.PubsubMessage\022\030\n\020" - + "delivery_attempt\030\003 \001(\005\"Z\n\026GetSubscriptio" - + "nRequest\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"" - + "pubsub.googleapis.com/Subscription\"\214\001\n\031U" - + "pdateSubscriptionRequest\0229\n\014subscription" - + "\030\001 \001(\0132\036.google.pubsub.v1.SubscriptionB\003" - + "\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.protob" - + "uf.FieldMaskB\003\340A\002\"\207\001\n\030ListSubscriptionsR" - + "equest\022D\n\007project\030\001 \001(\tB3\340A\002\372A-\n+cloudre" - + "sourcemanager.googleapis.com/Project\022\021\n\t" - + "page_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"k\n\031L" - + "istSubscriptionsResponse\0225\n\rsubscription" - + "s\030\001 \003(\0132\036.google.pubsub.v1.Subscription\022" - + "\027\n\017next_page_token\030\002 \001(\t\"]\n\031DeleteSubscr" - + "iptionRequest\022@\n\014subscription\030\001 \001(\tB*\340A\002" - + "\372A$\n\"pubsub.googleapis.com/Subscription\"" - + "\223\001\n\027ModifyPushConfigRequest\022@\n\014subscript" - + "ion\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.com" - + "/Subscription\0226\n\013push_config\030\002 \001(\0132\034.goo" - + "gle.pubsub.v1.PushConfigB\003\340A\002\"\215\001\n\013PullRe" - + "quest\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pub" - + "sub.googleapis.com/Subscription\022!\n\022retur" - + "n_immediately\030\002 \001(\010B\005\030\001\340A\001\022\031\n\014max_messag" - + "es\030\003 \001(\005B\003\340A\002\"L\n\014PullResponse\022<\n\021receive" + + "om/Topic\"w\n\022UpdateTopicRequest\022+\n\005topic\030" + + "\001 \001(\0132\027.google.pubsub.v1.TopicB\003\340A\002\0224\n\013u" + + "pdate_mask\030\002 \001(\0132\032.google.protobuf.Field" + + "MaskB\003\340A\002\"|\n\016PublishRequest\0222\n\005topic\030\001 \001" + + "(\tB#\340A\002\372A\035\n\033pubsub.googleapis.com/Topic\022" + + "6\n\010messages\030\002 \003(\0132\037.google.pubsub.v1.Pub" + + "subMessageB\003\340A\002\"&\n\017PublishResponse\022\023\n\013me" + + "ssage_ids\030\001 \003(\t\"\200\001\n\021ListTopicsRequest\022D\n" + + "\007project\030\001 \001(\tB3\340A\002\372A-\n+cloudresourceman" + + "ager.googleapis.com/Project\022\021\n\tpage_size" + + "\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"V\n\022ListTopics" + + "Response\022\'\n\006topics\030\001 \003(\0132\027.google.pubsub" + + ".v1.Topic\022\027\n\017next_page_token\030\002 \001(\t\"z\n\035Li" + + "stTopicSubscriptionsRequest\0222\n\005topic\030\001 \001" + + "(\tB#\340A\002\372A\035\n\033pubsub.googleapis.com/Topic\022" + + "\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"y" + + "\n\036ListTopicSubscriptionsResponse\022>\n\rsubs" + + "criptions\030\001 \003(\tB\'\372A$\n\"pubsub.googleapis." + + "com/Subscription\022\027\n\017next_page_token\030\002 \001(" + + "\t\"v\n\031ListTopicSnapshotsRequest\0222\n\005topic\030" + + "\001 \001(\tB#\340A\002\372A\035\n\033pubsub.googleapis.com/Top" + + "ic\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(" + + "\t\"H\n\032ListTopicSnapshotsResponse\022\021\n\tsnaps" + + "hots\030\001 \003(\t\022\027\n\017next_page_token\030\002 \001(\t\"H\n\022D" + + "eleteTopicRequest\0222\n\005topic\030\001 \001(\tB#\340A\002\372A\035" + + "\n\033pubsub.googleapis.com/Topic\"]\n\031DetachS" + + "ubscriptionRequest\022@\n\014subscription\030\001 \001(\t" + + "B*\340A\002\372A$\n\"pubsub.googleapis.com/Subscrip" + + "tion\"\034\n\032DetachSubscriptionResponse\"\300\005\n\014S" + + "ubscription\022\021\n\004name\030\001 \001(\tB\003\340A\002\0222\n\005topic\030" + + "\002 \001(\tB#\340A\002\372A\035\n\033pubsub.googleapis.com/Top" + + "ic\0221\n\013push_config\030\004 \001(\0132\034.google.pubsub." + + "v1.PushConfig\022\034\n\024ack_deadline_seconds\030\005 " + + "\001(\005\022\035\n\025retain_acked_messages\030\007 \001(\010\022=\n\032me" + + "ssage_retention_duration\030\010 \001(\0132\031.google." + + "protobuf.Duration\022:\n\006labels\030\t \003(\0132*.goog" + + "le.pubsub.v1.Subscription.LabelsEntry\022\037\n" + + "\027enable_message_ordering\030\n \001(\010\022=\n\021expira" + + "tion_policy\030\013 \001(\0132\".google.pubsub.v1.Exp" + + "irationPolicy\022\016\n\006filter\030\014 \001(\t\022>\n\022dead_le" + + "tter_policy\030\r \001(\0132\".google.pubsub.v1.Dea" + + "dLetterPolicy\0223\n\014retry_policy\030\016 \001(\0132\035.go" + + "ogle.pubsub.v1.RetryPolicy\022\020\n\010detached\030\017" + + " \001(\010\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + + "e\030\002 \001(\t:\0028\001:X\352AU\n\"pubsub.googleapis.com/" + + "Subscription\022/projects/{project}/subscri" + + "ptions/{subscription}\"u\n\013RetryPolicy\0222\n\017" + + "minimum_backoff\030\001 \001(\0132\031.google.protobuf." + + "Duration\0222\n\017maximum_backoff\030\002 \001(\0132\031.goog" + + "le.protobuf.Duration\"L\n\020DeadLetterPolicy" + + "\022\031\n\021dead_letter_topic\030\001 \001(\t\022\035\n\025max_deliv" + + "ery_attempts\030\002 \001(\005\":\n\020ExpirationPolicy\022&" + + "\n\003ttl\030\001 \001(\0132\031.google.protobuf.Duration\"\255" + + "\002\n\nPushConfig\022\025\n\rpush_endpoint\030\001 \001(\t\022@\n\n" + + "attributes\030\002 \003(\0132,.google.pubsub.v1.Push" + + "Config.AttributesEntry\022<\n\noidc_token\030\003 \001" + + "(\0132&.google.pubsub.v1.PushConfig.OidcTok" + + "enH\000\032<\n\tOidcToken\022\035\n\025service_account_ema" + + "il\030\001 \001(\t\022\020\n\010audience\030\002 \001(\t\0321\n\017Attributes" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\027\n" + + "\025authentication_method\"m\n\017ReceivedMessag" + + "e\022\016\n\006ack_id\030\001 \001(\t\0220\n\007message\030\002 \001(\0132\037.goo" + + "gle.pubsub.v1.PubsubMessage\022\030\n\020delivery_" + + "attempt\030\003 \001(\005\"Z\n\026GetSubscriptionRequest\022" + + "@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.go" + + "ogleapis.com/Subscription\"\214\001\n\031UpdateSubs" + + "criptionRequest\0229\n\014subscription\030\001 \001(\0132\036." + + "google.pubsub.v1.SubscriptionB\003\340A\002\0224\n\013up" + + "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" + + "askB\003\340A\002\"\207\001\n\030ListSubscriptionsRequest\022D\n" + + "\007project\030\001 \001(\tB3\340A\002\372A-\n+cloudresourceman" + + "ager.googleapis.com/Project\022\021\n\tpage_size" + + "\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"k\n\031ListSubscr" + + "iptionsResponse\0225\n\rsubscriptions\030\001 \003(\0132\036" + + ".google.pubsub.v1.Subscription\022\027\n\017next_p" + + "age_token\030\002 \001(\t\"]\n\031DeleteSubscriptionReq" + + "uest\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubs" + + "ub.googleapis.com/Subscription\"\223\001\n\027Modif" + + "yPushConfigRequest\022@\n\014subscription\030\001 \001(\t" + + "B*\340A\002\372A$\n\"pubsub.googleapis.com/Subscrip" + + "tion\0226\n\013push_config\030\002 \001(\0132\034.google.pubsu" + + "b.v1.PushConfigB\003\340A\002\"\215\001\n\013PullRequest\022@\n\014" + + "subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googl" + + "eapis.com/Subscription\022!\n\022return_immedia" + + "tely\030\002 \001(\010B\005\030\001\340A\001\022\031\n\014max_messages\030\003 \001(\005B" + + "\003\340A\002\"L\n\014PullResponse\022<\n\021received_message" + + "s\030\001 \003(\0132!.google.pubsub.v1.ReceivedMessa" + + "ge\"\225\001\n\030ModifyAckDeadlineRequest\022@\n\014subsc" + + "ription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis" + + ".com/Subscription\022\024\n\007ack_ids\030\004 \003(\tB\003\340A\002\022" + + "!\n\024ack_deadline_seconds\030\003 \001(\005B\003\340A\002\"l\n\022Ac" + + "knowledgeRequest\022@\n\014subscription\030\001 \001(\tB*" + + "\340A\002\372A$\n\"pubsub.googleapis.com/Subscripti" + + "on\022\024\n\007ack_ids\030\002 \003(\tB\003\340A\002\"\251\002\n\024StreamingPu" + + "llRequest\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n" + + "\"pubsub.googleapis.com/Subscription\022\017\n\007a" + + "ck_ids\030\002 \003(\t\022\037\n\027modify_deadline_seconds\030" + + "\003 \003(\005\022\037\n\027modify_deadline_ack_ids\030\004 \003(\t\022(" + + "\n\033stream_ack_deadline_seconds\030\005 \001(\005B\003\340A\002" + + "\022\021\n\tclient_id\030\006 \001(\t\022 \n\030max_outstanding_m" + + "essages\030\007 \001(\003\022\035\n\025max_outstanding_bytes\030\010" + + " \001(\003\"U\n\025StreamingPullResponse\022<\n\021receive" + "d_messages\030\001 \003(\0132!.google.pubsub.v1.Rece" - + "ivedMessage\"\225\001\n\030ModifyAckDeadlineRequest" + + "ivedMessage\"\203\002\n\025CreateSnapshotRequest\0224\n" + + "\004name\030\001 \001(\tB&\340A\002\372A \n\036pubsub.googleapis.c" + + "om/Snapshot\022@\n\014subscription\030\002 \001(\tB*\340A\002\372A" + + "$\n\"pubsub.googleapis.com/Subscription\022C\n" + + "\006labels\030\003 \003(\01323.google.pubsub.v1.CreateS" + + "napshotRequest.LabelsEntry\032-\n\013LabelsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\200\001\n\025Up" + + "dateSnapshotRequest\0221\n\010snapshot\030\001 \001(\0132\032." + + "google.pubsub.v1.SnapshotB\003\340A\002\0224\n\013update" + + "_mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB" + + "\003\340A\002\"\257\002\n\010Snapshot\022\014\n\004name\030\001 \001(\t\022/\n\005topic" + + "\030\002 \001(\tB \372A\035\n\033pubsub.googleapis.com/Topic" + + "\022/\n\013expire_time\030\003 \001(\0132\032.google.protobuf." + + "Timestamp\0226\n\006labels\030\004 \003(\0132&.google.pubsu" + + "b.v1.Snapshot.LabelsEntry\032-\n\013LabelsEntry" + + "\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:L\352AI\n\036p" + + "ubsub.googleapis.com/Snapshot\022\'projects/" + + "{project}/snapshots/{snapshot}\"N\n\022GetSna" + + "pshotRequest\0228\n\010snapshot\030\001 \001(\tB&\340A\002\372A \n\036" + + "pubsub.googleapis.com/Snapshot\"\203\001\n\024ListS" + + "napshotsRequest\022D\n\007project\030\001 \001(\tB3\340A\002\372A-" + + "\n+cloudresourcemanager.googleapis.com/Pr" + + "oject\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003" + + " \001(\t\"_\n\025ListSnapshotsResponse\022-\n\tsnapsho" + + "ts\030\001 \003(\0132\032.google.pubsub.v1.Snapshot\022\027\n\017" + + "next_page_token\030\002 \001(\t\"Q\n\025DeleteSnapshotR" + + "equest\0228\n\010snapshot\030\001 \001(\tB&\340A\002\372A \n\036pubsub" + + ".googleapis.com/Snapshot\"\276\001\n\013SeekRequest" + "\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.g" - + "oogleapis.com/Subscription\022\024\n\007ack_ids\030\004 " - + "\003(\tB\003\340A\002\022!\n\024ack_deadline_seconds\030\003 \001(\005B\003" - + "\340A\002\"l\n\022AcknowledgeRequest\022@\n\014subscriptio" - + "n\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.com/S" - + "ubscription\022\024\n\007ack_ids\030\002 \003(\tB\003\340A\002\"\251\002\n\024St" - + "reamingPullRequest\022@\n\014subscription\030\001 \001(\t" - + "B*\340A\002\372A$\n\"pubsub.googleapis.com/Subscrip" - + "tion\022\017\n\007ack_ids\030\002 \003(\t\022\037\n\027modify_deadline" - + "_seconds\030\003 \003(\005\022\037\n\027modify_deadline_ack_id" - + "s\030\004 \003(\t\022(\n\033stream_ack_deadline_seconds\030\005" - + " \001(\005B\003\340A\002\022\021\n\tclient_id\030\006 \001(\t\022 \n\030max_outs" - + "tanding_messages\030\007 \001(\003\022\035\n\025max_outstandin" - + "g_bytes\030\010 \001(\003\"U\n\025StreamingPullResponse\022<" - + "\n\021received_messages\030\001 \003(\0132!.google.pubsu" - + "b.v1.ReceivedMessage\"\203\002\n\025CreateSnapshotR" - + "equest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036pubsub.goo" - + "gleapis.com/Snapshot\022@\n\014subscription\030\002 \001" - + "(\tB*\340A\002\372A$\n\"pubsub.googleapis.com/Subscr" - + "iption\022C\n\006labels\030\003 \003(\01323.google.pubsub.v" - + "1.CreateSnapshotRequest.LabelsEntry\032-\n\013L" - + "abelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" - + "8\001\"\200\001\n\025UpdateSnapshotRequest\0221\n\010snapshot" - + "\030\001 \001(\0132\032.google.pubsub.v1.SnapshotB\003\340A\002\022" - + "4\n\013update_mask\030\002 \001(\0132\032.google.protobuf.F" - + "ieldMaskB\003\340A\002\"\257\002\n\010Snapshot\022\014\n\004name\030\001 \001(\t" - + "\022/\n\005topic\030\002 \001(\tB \372A\035\n\033pubsub.googleapis." - + "com/Topic\022/\n\013expire_time\030\003 \001(\0132\032.google." - + "protobuf.Timestamp\0226\n\006labels\030\004 \003(\0132&.goo" - + "gle.pubsub.v1.Snapshot.LabelsEntry\032-\n\013La" - + "belsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" - + "\001:L\352AI\n\036pubsub.googleapis.com/Snapshot\022\'" - + "projects/{project}/snapshots/{snapshot}\"" - + "N\n\022GetSnapshotRequest\0228\n\010snapshot\030\001 \001(\tB" - + "&\340A\002\372A \n\036pubsub.googleapis.com/Snapshot\"" - + "\203\001\n\024ListSnapshotsRequest\022D\n\007project\030\001 \001(" - + "\tB3\340A\002\372A-\n+cloudresourcemanager.googleap" - + "is.com/Project\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npag" - + "e_token\030\003 \001(\t\"_\n\025ListSnapshotsResponse\022-" - + "\n\tsnapshots\030\001 \003(\0132\032.google.pubsub.v1.Sna" - + "pshot\022\027\n\017next_page_token\030\002 \001(\t\"Q\n\025Delete" - + "SnapshotRequest\0228\n\010snapshot\030\001 \001(\tB&\340A\002\372A" - + " \n\036pubsub.googleapis.com/Snapshot\"\276\001\n\013Se" - + "ekRequest\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n" - + "\"pubsub.googleapis.com/Subscription\022*\n\004t" - + "ime\030\002 \001(\0132\032.google.protobuf.TimestampH\000\022" - + "7\n\010snapshot\030\003 \001(\tB#\372A \n\036pubsub.googleapi" - + "s.com/SnapshotH\000B\010\n\006target\"\016\n\014SeekRespon" - + "se2\243\013\n\tPublisher\022q\n\013CreateTopic\022\027.google" - + ".pubsub.v1.Topic\032\027.google.pubsub.v1.Topi" - + "c\"0\202\323\344\223\002#\032\036/v1/{name=projects/*/topics/*" - + "}:\001*\332A\004name\022}\n\013UpdateTopic\022$.google.pubs" - + "ub.v1.UpdateTopicRequest\032\027.google.pubsub" - + ".v1.Topic\"/\202\323\344\223\002)2$/v1/{topic.name=proje" - + "cts/*/topics/*}:\001*\022\223\001\n\007Publish\022 .google." - + "pubsub.v1.PublishRequest\032!.google.pubsub" - + ".v1.PublishResponse\"C\202\323\344\223\002,\"\'/v1/{topic=" - + "projects/*/topics/*}:publish:\001*\332A\016topic," - + "messages\022w\n\010GetTopic\022!.google.pubsub.v1." - + "GetTopicRequest\032\027.google.pubsub.v1.Topic" - + "\"/\202\323\344\223\002!\022\037/v1/{topic=projects/*/topics/*" - + "}\332A\005topic\022\212\001\n\nListTopics\022#.google.pubsub" - + ".v1.ListTopicsRequest\032$.google.pubsub.v1" - + ".ListTopicsResponse\"1\202\323\344\223\002!\022\037/v1/{projec" - + "t=projects/*}/topics\332A\007project\022\272\001\n\026ListT" - + "opicSubscriptions\022/.google.pubsub.v1.Lis" - + "tTopicSubscriptionsRequest\0320.google.pubs" - + "ub.v1.ListTopicSubscriptionsResponse\"=\202\323" - + "\344\223\002/\022-/v1/{topic=projects/*/topics/*}/su" - + "bscriptions\332A\005topic\022\252\001\n\022ListTopicSnapsho" - + "ts\022+.google.pubsub.v1.ListTopicSnapshots" - + "Request\032,.google.pubsub.v1.ListTopicSnap" - + "shotsResponse\"9\202\323\344\223\002+\022)/v1/{topic=projec" - + "ts/*/topics/*}/snapshots\332A\005topic\022|\n\013Dele" - + "teTopic\022$.google.pubsub.v1.DeleteTopicRe" - + "quest\032\026.google.protobuf.Empty\"/\202\323\344\223\002!*\037/" - + "v1/{topic=projects/*/topics/*}\332A\005topic\022\255" - + "\001\n\022DetachSubscription\022+.google.pubsub.v1" - + ".DetachSubscriptionRequest\032,.google.pubs" - + "ub.v1.DetachSubscriptionResponse\"<\202\323\344\223\0026" - + "\"4/v1/{subscription=projects/*/subscript" - + "ions/*}:detach\032p\312A\025pubsub.googleapis.com" - + "\322AUhttps://www.googleapis.com/auth/cloud" - + "-platform,https://www.googleapis.com/aut" - + "h/pubsub2\203\025\n\nSubscriber\022\264\001\n\022CreateSubscr" - + "iption\022\036.google.pubsub.v1.Subscription\032\036" - + ".google.pubsub.v1.Subscription\"^\202\323\344\223\002*\032%" - + "/v1/{name=projects/*/subscriptions/*}:\001*" - + "\332A+name,topic,push_config,ack_deadline_s" - + "econds\022\241\001\n\017GetSubscription\022(.google.pubs" - + "ub.v1.GetSubscriptionRequest\032\036.google.pu" - + "bsub.v1.Subscription\"D\202\323\344\223\002/\022-/v1/{subsc" - + "ription=projects/*/subscriptions/*}\332A\014su" - + "bscription\022\240\001\n\022UpdateSubscription\022+.goog" - + "le.pubsub.v1.UpdateSubscriptionRequest\032\036" - + ".google.pubsub.v1.Subscription\"=\202\323\344\223\002722" - + "/v1/{subscription.name=projects/*/subscr" - + "iptions/*}:\001*\022\246\001\n\021ListSubscriptions\022*.go" - + "ogle.pubsub.v1.ListSubscriptionsRequest\032" - + "+.google.pubsub.v1.ListSubscriptionsResp" - + "onse\"8\202\323\344\223\002(\022&/v1/{project=projects/*}/s" - + "ubscriptions\332A\007project\022\237\001\n\022DeleteSubscri" - + "ption\022+.google.pubsub.v1.DeleteSubscript" - + "ionRequest\032\026.google.protobuf.Empty\"D\202\323\344\223" - + "\002/*-/v1/{subscription=projects/*/subscri" - + "ptions/*}\332A\014subscription\022\317\001\n\021ModifyAckDe" - + "adline\022*.google.pubsub.v1.ModifyAckDeadl" - + "ineRequest\032\026.google.protobuf.Empty\"v\202\323\344\223" - + "\002D\"?/v1/{subscription=projects/*/subscri" - + "ptions/*}:modifyAckDeadline:\001*\332A)subscri" - + "ption,ack_ids,ack_deadline_seconds\022\250\001\n\013A" - + "cknowledge\022$.google.pubsub.v1.Acknowledg" - + "eRequest\032\026.google.protobuf.Empty\"[\202\323\344\223\002>" - + "\"9/v1/{subscription=projects/*/subscript" - + "ions/*}:acknowledge:\001*\332A\024subscription,ac" - + "k_ids\022\263\001\n\004Pull\022\035.google.pubsub.v1.PullRe" - + "quest\032\036.google.pubsub.v1.PullResponse\"l\202" - + "\323\344\223\0027\"2/v1/{subscription=projects/*/subs" - + "criptions/*}:pull:\001*\332A,subscription,retu" - + "rn_immediately,max_messages\022f\n\rStreaming" - + "Pull\022&.google.pubsub.v1.StreamingPullReq" - + "uest\032\'.google.pubsub.v1.StreamingPullRes" - + "ponse\"\000(\0010\001\022\273\001\n\020ModifyPushConfig\022).googl" - + "e.pubsub.v1.ModifyPushConfigRequest\032\026.go" - + "ogle.protobuf.Empty\"d\202\323\344\223\002C\">/v1/{subscr" - + "iption=projects/*/subscriptions/*}:modif" - + "yPushConfig:\001*\332A\030subscription,push_confi" - + "g\022\211\001\n\013GetSnapshot\022$.google.pubsub.v1.Get" - + "SnapshotRequest\032\032.google.pubsub.v1.Snaps" - + "hot\"8\202\323\344\223\002\'\022%/v1/{snapshot=projects/*/sn" - + "apshots/*}\332A\010snapshot\022\226\001\n\rListSnapshots\022" - + "&.google.pubsub.v1.ListSnapshotsRequest\032" - + "\'.google.pubsub.v1.ListSnapshotsResponse" - + "\"4\202\323\344\223\002$\022\"/v1/{project=projects/*}/snaps" - + "hots\332A\007project\022\227\001\n\016CreateSnapshot\022\'.goog" - + "le.pubsub.v1.CreateSnapshotRequest\032\032.goo" - + "gle.pubsub.v1.Snapshot\"@\202\323\344\223\002&\032!/v1/{nam" - + "e=projects/*/snapshots/*}:\001*\332A\021name,subs" - + "cription\022\214\001\n\016UpdateSnapshot\022\'.google.pub" - + "sub.v1.UpdateSnapshotRequest\032\032.google.pu" - + "bsub.v1.Snapshot\"5\202\323\344\223\002/2*/v1/{snapshot." - + "name=projects/*/snapshots/*}:\001*\022\213\001\n\016Dele" - + "teSnapshot\022\'.google.pubsub.v1.DeleteSnap" - + "shotRequest\032\026.google.protobuf.Empty\"8\202\323\344" - + "\223\002\'*%/v1/{snapshot=projects/*/snapshots/" - + "*}\332A\010snapshot\022\204\001\n\004Seek\022\035.google.pubsub.v" - + "1.SeekRequest\032\036.google.pubsub.v1.SeekRes" - + "ponse\"=\202\323\344\223\0027\"2/v1/{subscription=project" - + "s/*/subscriptions/*}:seek:\001*\032p\312A\025pubsub." - + "googleapis.com\322AUhttps://www.googleapis." - + "com/auth/cloud-platform,https://www.goog" - + "leapis.com/auth/pubsubB\256\001\n\024com.google.pu" - + "bsub.v1B\013PubsubProtoP\001Z6google.golang.or" - + "g/genproto/googleapis/pubsub/v1;pubsub\370\001" - + "\001\252\002\026Google.Cloud.PubSub.V1\312\002\026Google\\Clou" - + "d\\PubSub\\V1\352\002\031Google::Cloud::PubSub::V1b" - + "\006proto3" + + "oogleapis.com/Subscription\022*\n\004time\030\002 \001(\013" + + "2\032.google.protobuf.TimestampH\000\0227\n\010snapsh" + + "ot\030\003 \001(\tB#\372A \n\036pubsub.googleapis.com/Sna" + + "pshotH\000B\010\n\006target\"\016\n\014SeekResponse2\243\013\n\tPu" + + "blisher\022q\n\013CreateTopic\022\027.google.pubsub.v" + + "1.Topic\032\027.google.pubsub.v1.Topic\"0\202\323\344\223\002#" + + "\032\036/v1/{name=projects/*/topics/*}:\001*\332A\004na" + + "me\022}\n\013UpdateTopic\022$.google.pubsub.v1.Upd" + + "ateTopicRequest\032\027.google.pubsub.v1.Topic" + + "\"/\202\323\344\223\002)2$/v1/{topic.name=projects/*/top" + + "ics/*}:\001*\022\223\001\n\007Publish\022 .google.pubsub.v1" + + ".PublishRequest\032!.google.pubsub.v1.Publi" + + "shResponse\"C\202\323\344\223\002,\"\'/v1/{topic=projects/" + + "*/topics/*}:publish:\001*\332A\016topic,messages\022" + + "w\n\010GetTopic\022!.google.pubsub.v1.GetTopicR" + + "equest\032\027.google.pubsub.v1.Topic\"/\202\323\344\223\002!\022" + + "\037/v1/{topic=projects/*/topics/*}\332A\005topic" + + "\022\212\001\n\nListTopics\022#.google.pubsub.v1.ListT" + + "opicsRequest\032$.google.pubsub.v1.ListTopi" + + "csResponse\"1\202\323\344\223\002!\022\037/v1/{project=project" + + "s/*}/topics\332A\007project\022\272\001\n\026ListTopicSubsc" + + "riptions\022/.google.pubsub.v1.ListTopicSub" + + "scriptionsRequest\0320.google.pubsub.v1.Lis" + + "tTopicSubscriptionsResponse\"=\202\323\344\223\002/\022-/v1" + + "/{topic=projects/*/topics/*}/subscriptio" + + "ns\332A\005topic\022\252\001\n\022ListTopicSnapshots\022+.goog" + + "le.pubsub.v1.ListTopicSnapshotsRequest\032," + + ".google.pubsub.v1.ListTopicSnapshotsResp" + + "onse\"9\202\323\344\223\002+\022)/v1/{topic=projects/*/topi" + + "cs/*}/snapshots\332A\005topic\022|\n\013DeleteTopic\022$" + + ".google.pubsub.v1.DeleteTopicRequest\032\026.g" + + "oogle.protobuf.Empty\"/\202\323\344\223\002!*\037/v1/{topic" + + "=projects/*/topics/*}\332A\005topic\022\255\001\n\022Detach" + + "Subscription\022+.google.pubsub.v1.DetachSu" + + "bscriptionRequest\032,.google.pubsub.v1.Det" + + "achSubscriptionResponse\"<\202\323\344\223\0026\"4/v1/{su" + + "bscription=projects/*/subscriptions/*}:d" + + "etach\032p\312A\025pubsub.googleapis.com\322AUhttps:" + + "//www.googleapis.com/auth/cloud-platform" + + ",https://www.googleapis.com/auth/pubsub2" + + "\203\025\n\nSubscriber\022\264\001\n\022CreateSubscription\022\036." + + "google.pubsub.v1.Subscription\032\036.google.p" + + "ubsub.v1.Subscription\"^\202\323\344\223\002*\032%/v1/{name" + + "=projects/*/subscriptions/*}:\001*\332A+name,t" + + "opic,push_config,ack_deadline_seconds\022\241\001" + + "\n\017GetSubscription\022(.google.pubsub.v1.Get" + + "SubscriptionRequest\032\036.google.pubsub.v1.S" + + "ubscription\"D\202\323\344\223\002/\022-/v1/{subscription=p" + + "rojects/*/subscriptions/*}\332A\014subscriptio" + + "n\022\240\001\n\022UpdateSubscription\022+.google.pubsub" + + ".v1.UpdateSubscriptionRequest\032\036.google.p" + + "ubsub.v1.Subscription\"=\202\323\344\223\002722/v1/{subs" + + "cription.name=projects/*/subscriptions/*" + + "}:\001*\022\246\001\n\021ListSubscriptions\022*.google.pubs" + + "ub.v1.ListSubscriptionsRequest\032+.google." + + "pubsub.v1.ListSubscriptionsResponse\"8\202\323\344" + + "\223\002(\022&/v1/{project=projects/*}/subscripti" + + "ons\332A\007project\022\237\001\n\022DeleteSubscription\022+.g" + + "oogle.pubsub.v1.DeleteSubscriptionReques" + + "t\032\026.google.protobuf.Empty\"D\202\323\344\223\002/*-/v1/{" + + "subscription=projects/*/subscriptions/*}" + + "\332A\014subscription\022\317\001\n\021ModifyAckDeadline\022*." + + "google.pubsub.v1.ModifyAckDeadlineReques" + + "t\032\026.google.protobuf.Empty\"v\202\323\344\223\002D\"?/v1/{" + + "subscription=projects/*/subscriptions/*}" + + ":modifyAckDeadline:\001*\332A)subscription,ack" + + "_ids,ack_deadline_seconds\022\250\001\n\013Acknowledg" + + "e\022$.google.pubsub.v1.AcknowledgeRequest\032" + + "\026.google.protobuf.Empty\"[\202\323\344\223\002>\"9/v1/{su" + + "bscription=projects/*/subscriptions/*}:a" + + "cknowledge:\001*\332A\024subscription,ack_ids\022\263\001\n" + + "\004Pull\022\035.google.pubsub.v1.PullRequest\032\036.g" + + "oogle.pubsub.v1.PullResponse\"l\202\323\344\223\0027\"2/v" + + "1/{subscription=projects/*/subscriptions" + + "/*}:pull:\001*\332A,subscription,return_immedi" + + "ately,max_messages\022f\n\rStreamingPull\022&.go" + + "ogle.pubsub.v1.StreamingPullRequest\032\'.go" + + "ogle.pubsub.v1.StreamingPullResponse\"\000(\001" + + "0\001\022\273\001\n\020ModifyPushConfig\022).google.pubsub." + + "v1.ModifyPushConfigRequest\032\026.google.prot" + + "obuf.Empty\"d\202\323\344\223\002C\">/v1/{subscription=pr" + + "ojects/*/subscriptions/*}:modifyPushConf" + + "ig:\001*\332A\030subscription,push_config\022\211\001\n\013Get" + + "Snapshot\022$.google.pubsub.v1.GetSnapshotR" + + "equest\032\032.google.pubsub.v1.Snapshot\"8\202\323\344\223" + + "\002\'\022%/v1/{snapshot=projects/*/snapshots/*" + + "}\332A\010snapshot\022\226\001\n\rListSnapshots\022&.google." + + "pubsub.v1.ListSnapshotsRequest\032\'.google." + + "pubsub.v1.ListSnapshotsResponse\"4\202\323\344\223\002$\022" + + "\"/v1/{project=projects/*}/snapshots\332A\007pr" + + "oject\022\227\001\n\016CreateSnapshot\022\'.google.pubsub" + + ".v1.CreateSnapshotRequest\032\032.google.pubsu" + + "b.v1.Snapshot\"@\202\323\344\223\002&\032!/v1/{name=project" + + "s/*/snapshots/*}:\001*\332A\021name,subscription\022" + + "\214\001\n\016UpdateSnapshot\022\'.google.pubsub.v1.Up" + + "dateSnapshotRequest\032\032.google.pubsub.v1.S" + + "napshot\"5\202\323\344\223\002/2*/v1/{snapshot.name=proj" + + "ects/*/snapshots/*}:\001*\022\213\001\n\016DeleteSnapsho" + + "t\022\'.google.pubsub.v1.DeleteSnapshotReque" + + "st\032\026.google.protobuf.Empty\"8\202\323\344\223\002\'*%/v1/" + + "{snapshot=projects/*/snapshots/*}\332A\010snap" + + "shot\022\204\001\n\004Seek\022\035.google.pubsub.v1.SeekReq" + + "uest\032\036.google.pubsub.v1.SeekResponse\"=\202\323" + + "\344\223\0027\"2/v1/{subscription=projects/*/subsc" + + "riptions/*}:seek:\001*\032p\312A\025pubsub.googleapi" + + "s.com\322AUhttps://www.googleapis.com/auth/" + + "cloud-platform,https://www.googleapis.co" + + "m/auth/pubsubB\256\001\n\024com.google.pubsub.v1B\013" + + "PubsubProtoP\001Z6google.golang.org/genprot" + + "o/googleapis/pubsub/v1;pubsub\370\001\001\252\002\026Googl" + + "e.Cloud.PubSub.V1\312\002\026Google\\Cloud\\PubSub\\" + + "V1\352\002\031Google::Cloud::PubSub::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -518,6 +527,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), + com.google.pubsub.v1.SchemaProto.getDescriptor(), }); internal_static_google_pubsub_v1_MessageStoragePolicy_descriptor = getDescriptor().getMessageTypes().get(0); @@ -527,12 +537,25 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "AllowedPersistenceRegions", }); - internal_static_google_pubsub_v1_Topic_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_pubsub_v1_SchemaSettings_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_pubsub_v1_SchemaSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_SchemaSettings_descriptor, + new java.lang.String[] { + "Schema", "Encoding", + }); + internal_static_google_pubsub_v1_Topic_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_google_pubsub_v1_Topic_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_Topic_descriptor, new java.lang.String[] { - "Name", "Labels", "MessageStoragePolicy", "KmsKeyName", + "Name", + "Labels", + "MessageStoragePolicy", + "KmsKeyName", + "SchemaSettings", + "SatisfiesPzs", }); internal_static_google_pubsub_v1_Topic_LabelsEntry_descriptor = internal_static_google_pubsub_v1_Topic_descriptor.getNestedTypes().get(0); @@ -543,7 +566,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_pubsub_v1_PubsubMessage_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(3); internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_PubsubMessage_descriptor, @@ -559,7 +582,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_pubsub_v1_GetTopicRequest_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(4); internal_static_google_pubsub_v1_GetTopicRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_GetTopicRequest_descriptor, @@ -567,7 +590,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Topic", }); internal_static_google_pubsub_v1_UpdateTopicRequest_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_google_pubsub_v1_UpdateTopicRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_UpdateTopicRequest_descriptor, @@ -575,7 +598,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Topic", "UpdateMask", }); internal_static_google_pubsub_v1_PublishRequest_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_google_pubsub_v1_PublishRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_PublishRequest_descriptor, @@ -583,7 +606,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Topic", "Messages", }); internal_static_google_pubsub_v1_PublishResponse_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_google_pubsub_v1_PublishResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_PublishResponse_descriptor, @@ -591,7 +614,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "MessageIds", }); internal_static_google_pubsub_v1_ListTopicsRequest_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(8); internal_static_google_pubsub_v1_ListTopicsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ListTopicsRequest_descriptor, @@ -599,7 +622,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Project", "PageSize", "PageToken", }); internal_static_google_pubsub_v1_ListTopicsResponse_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(9); internal_static_google_pubsub_v1_ListTopicsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ListTopicsResponse_descriptor, @@ -607,7 +630,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Topics", "NextPageToken", }); internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(10); internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor, @@ -615,7 +638,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Topic", "PageSize", "PageToken", }); internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor, @@ -623,7 +646,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscriptions", "NextPageToken", }); internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_descriptor, @@ -631,7 +654,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Topic", "PageSize", "PageToken", }); internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_descriptor, @@ -639,7 +662,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Snapshots", "NextPageToken", }); internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_google_pubsub_v1_DeleteTopicRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor, @@ -647,7 +670,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Topic", }); internal_static_google_pubsub_v1_DetachSubscriptionRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_google_pubsub_v1_DetachSubscriptionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_DetachSubscriptionRequest_descriptor, @@ -655,13 +678,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscription", }); internal_static_google_pubsub_v1_DetachSubscriptionResponse_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(16); internal_static_google_pubsub_v1_DetachSubscriptionResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_DetachSubscriptionResponse_descriptor, new java.lang.String[] {}); internal_static_google_pubsub_v1_Subscription_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(17); internal_static_google_pubsub_v1_Subscription_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_Subscription_descriptor, @@ -689,7 +712,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_pubsub_v1_RetryPolicy_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(18); internal_static_google_pubsub_v1_RetryPolicy_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_RetryPolicy_descriptor, @@ -697,7 +720,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "MinimumBackoff", "MaximumBackoff", }); internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(19); internal_static_google_pubsub_v1_DeadLetterPolicy_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor, @@ -705,7 +728,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DeadLetterTopic", "MaxDeliveryAttempts", }); internal_static_google_pubsub_v1_ExpirationPolicy_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(20); internal_static_google_pubsub_v1_ExpirationPolicy_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ExpirationPolicy_descriptor, @@ -713,7 +736,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Ttl", }); internal_static_google_pubsub_v1_PushConfig_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(21); internal_static_google_pubsub_v1_PushConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_PushConfig_descriptor, @@ -737,7 +760,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_pubsub_v1_ReceivedMessage_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(22); internal_static_google_pubsub_v1_ReceivedMessage_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ReceivedMessage_descriptor, @@ -745,7 +768,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "AckId", "Message", "DeliveryAttempt", }); internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(23); internal_static_google_pubsub_v1_GetSubscriptionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor, @@ -753,7 +776,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscription", }); internal_static_google_pubsub_v1_UpdateSubscriptionRequest_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(24); internal_static_google_pubsub_v1_UpdateSubscriptionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_UpdateSubscriptionRequest_descriptor, @@ -761,7 +784,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscription", "UpdateMask", }); internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(25); internal_static_google_pubsub_v1_ListSubscriptionsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor, @@ -769,7 +792,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Project", "PageSize", "PageToken", }); internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(26); internal_static_google_pubsub_v1_ListSubscriptionsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor, @@ -777,7 +800,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscriptions", "NextPageToken", }); internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(27); internal_static_google_pubsub_v1_DeleteSubscriptionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor, @@ -785,7 +808,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscription", }); internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(28); internal_static_google_pubsub_v1_ModifyPushConfigRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor, @@ -793,7 +816,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscription", "PushConfig", }); internal_static_google_pubsub_v1_PullRequest_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(29); internal_static_google_pubsub_v1_PullRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_PullRequest_descriptor, @@ -801,7 +824,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscription", "ReturnImmediately", "MaxMessages", }); internal_static_google_pubsub_v1_PullResponse_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_google_pubsub_v1_PullResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_PullResponse_descriptor, @@ -809,7 +832,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ReceivedMessages", }); internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor, @@ -817,7 +840,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscription", "AckIds", "AckDeadlineSeconds", }); internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(32); internal_static_google_pubsub_v1_AcknowledgeRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor, @@ -825,7 +848,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscription", "AckIds", }); internal_static_google_pubsub_v1_StreamingPullRequest_descriptor = - getDescriptor().getMessageTypes().get(32); + getDescriptor().getMessageTypes().get(33); internal_static_google_pubsub_v1_StreamingPullRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_StreamingPullRequest_descriptor, @@ -840,7 +863,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "MaxOutstandingBytes", }); internal_static_google_pubsub_v1_StreamingPullResponse_descriptor = - getDescriptor().getMessageTypes().get(33); + getDescriptor().getMessageTypes().get(34); internal_static_google_pubsub_v1_StreamingPullResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_StreamingPullResponse_descriptor, @@ -848,7 +871,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ReceivedMessages", }); internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor = - getDescriptor().getMessageTypes().get(34); + getDescriptor().getMessageTypes().get(35); internal_static_google_pubsub_v1_CreateSnapshotRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor, @@ -864,7 +887,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_pubsub_v1_UpdateSnapshotRequest_descriptor = - getDescriptor().getMessageTypes().get(35); + getDescriptor().getMessageTypes().get(36); internal_static_google_pubsub_v1_UpdateSnapshotRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_UpdateSnapshotRequest_descriptor, @@ -872,7 +895,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Snapshot", "UpdateMask", }); internal_static_google_pubsub_v1_Snapshot_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(37); internal_static_google_pubsub_v1_Snapshot_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_Snapshot_descriptor, @@ -888,7 +911,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_pubsub_v1_GetSnapshotRequest_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(38); internal_static_google_pubsub_v1_GetSnapshotRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_GetSnapshotRequest_descriptor, @@ -896,7 +919,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Snapshot", }); internal_static_google_pubsub_v1_ListSnapshotsRequest_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(39); internal_static_google_pubsub_v1_ListSnapshotsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ListSnapshotsRequest_descriptor, @@ -904,7 +927,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Project", "PageSize", "PageToken", }); internal_static_google_pubsub_v1_ListSnapshotsResponse_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(40); internal_static_google_pubsub_v1_ListSnapshotsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_ListSnapshotsResponse_descriptor, @@ -912,7 +935,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Snapshots", "NextPageToken", }); internal_static_google_pubsub_v1_DeleteSnapshotRequest_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(41); internal_static_google_pubsub_v1_DeleteSnapshotRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_DeleteSnapshotRequest_descriptor, @@ -920,7 +943,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Snapshot", }); internal_static_google_pubsub_v1_SeekRequest_descriptor = - getDescriptor().getMessageTypes().get(41); + getDescriptor().getMessageTypes().get(42); internal_static_google_pubsub_v1_SeekRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_SeekRequest_descriptor, @@ -928,7 +951,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Subscription", "Time", "Snapshot", "Target", }); internal_static_google_pubsub_v1_SeekResponse_descriptor = - getDescriptor().getMessageTypes().get(42); + getDescriptor().getMessageTypes().get(43); internal_static_google_pubsub_v1_SeekResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_pubsub_v1_SeekResponse_descriptor, new java.lang.String[] {}); @@ -951,6 +974,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); + com.google.pubsub.v1.SchemaProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Schema.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Schema.java new file mode 100644 index 000000000..cd8adc77b --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Schema.java @@ -0,0 +1,1131 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * A schema resource.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.Schema} + */ +public final class Schema extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.Schema) + SchemaOrBuilder { + private static final long serialVersionUID = 0L; + // Use Schema.newBuilder() to construct. + private Schema(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Schema() { + name_ = ""; + type_ = 0; + definition_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Schema(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Schema( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + definition_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto.internal_static_google_pubsub_v1_Schema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_Schema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.Schema.class, com.google.pubsub.v1.Schema.Builder.class); + } + + /** + * + * + *
+   * Possible schema definition types.
+   * 
+ * + * Protobuf enum {@code google.pubsub.v1.Schema.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * A Protocol Buffer schema definition.
+     * 
+ * + * PROTOCOL_BUFFER = 1; + */ + PROTOCOL_BUFFER(1), + /** + * + * + *
+     * An Avro schema definition.
+     * 
+ * + * AVRO = 2; + */ + AVRO(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * A Protocol Buffer schema definition.
+     * 
+ * + * PROTOCOL_BUFFER = 1; + */ + public static final int PROTOCOL_BUFFER_VALUE = 1; + /** + * + * + *
+     * An Avro schema definition.
+     * 
+ * + * AVRO = 2; + */ + public static final int AVRO_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return PROTOCOL_BUFFER; + case 2: + return AVRO; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.pubsub.v1.Schema.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.pubsub.v1.Schema.Type) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the schema.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the schema.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private int type_; + /** + * + * + *
+   * The type of the schema definition.
+   * 
+ * + * .google.pubsub.v1.Schema.Type type = 2; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * The type of the schema definition.
+   * 
+ * + * .google.pubsub.v1.Schema.Type type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.pubsub.v1.Schema.Type getType() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.Schema.Type result = com.google.pubsub.v1.Schema.Type.valueOf(type_); + return result == null ? com.google.pubsub.v1.Schema.Type.UNRECOGNIZED : result; + } + + public static final int DEFINITION_FIELD_NUMBER = 3; + private volatile java.lang.Object definition_; + /** + * + * + *
+   * The definition of the schema. This should contain a string representing
+   * the full definition of the schema that is a valid schema definition of
+   * the type specified in `type`.
+   * 
+ * + * string definition = 3; + * + * @return The definition. + */ + @java.lang.Override + public java.lang.String getDefinition() { + java.lang.Object ref = definition_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + definition_ = s; + return s; + } + } + /** + * + * + *
+   * The definition of the schema. This should contain a string representing
+   * the full definition of the schema that is a valid schema definition of
+   * the type specified in `type`.
+   * 
+ * + * string definition = 3; + * + * @return The bytes for definition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDefinitionBytes() { + java.lang.Object ref = definition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + definition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (type_ != com.google.pubsub.v1.Schema.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, type_); + } + if (!getDefinitionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, definition_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (type_ != com.google.pubsub.v1.Schema.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); + } + if (!getDefinitionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, definition_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.Schema)) { + return super.equals(obj); + } + com.google.pubsub.v1.Schema other = (com.google.pubsub.v1.Schema) obj; + + if (!getName().equals(other.getName())) return false; + if (type_ != other.type_) return false; + if (!getDefinition().equals(other.getDefinition())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DEFINITION_FIELD_NUMBER; + hash = (53 * hash) + getDefinition().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.Schema parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.Schema parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.Schema parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.Schema parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.Schema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.Schema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.Schema parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.Schema parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.Schema parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.Schema parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.Schema parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.Schema parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.Schema prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A schema resource.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.Schema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.Schema) + com.google.pubsub.v1.SchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto.internal_static_google_pubsub_v1_Schema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_Schema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.Schema.class, com.google.pubsub.v1.Schema.Builder.class); + } + + // Construct using com.google.pubsub.v1.Schema.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + type_ = 0; + + definition_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto.internal_static_google_pubsub_v1_Schema_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.Schema getDefaultInstanceForType() { + return com.google.pubsub.v1.Schema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.Schema build() { + com.google.pubsub.v1.Schema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.Schema buildPartial() { + com.google.pubsub.v1.Schema result = new com.google.pubsub.v1.Schema(this); + result.name_ = name_; + result.type_ = type_; + result.definition_ = definition_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.Schema) { + return mergeFrom((com.google.pubsub.v1.Schema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.Schema other) { + if (other == com.google.pubsub.v1.Schema.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDefinition().isEmpty()) { + definition_ = other.definition_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.Schema parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.Schema) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the schema.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the schema.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the schema.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the schema.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the schema.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * The type of the schema definition.
+     * 
+ * + * .google.pubsub.v1.Schema.Type type = 2; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * The type of the schema definition.
+     * 
+ * + * .google.pubsub.v1.Schema.Type type = 2; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the schema definition.
+     * 
+ * + * .google.pubsub.v1.Schema.Type type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.pubsub.v1.Schema.Type getType() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.Schema.Type result = com.google.pubsub.v1.Schema.Type.valueOf(type_); + return result == null ? com.google.pubsub.v1.Schema.Type.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The type of the schema definition.
+     * 
+ * + * .google.pubsub.v1.Schema.Type type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.pubsub.v1.Schema.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the schema definition.
+     * 
+ * + * .google.pubsub.v1.Schema.Type type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object definition_ = ""; + /** + * + * + *
+     * The definition of the schema. This should contain a string representing
+     * the full definition of the schema that is a valid schema definition of
+     * the type specified in `type`.
+     * 
+ * + * string definition = 3; + * + * @return The definition. + */ + public java.lang.String getDefinition() { + java.lang.Object ref = definition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + definition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The definition of the schema. This should contain a string representing
+     * the full definition of the schema that is a valid schema definition of
+     * the type specified in `type`.
+     * 
+ * + * string definition = 3; + * + * @return The bytes for definition. + */ + public com.google.protobuf.ByteString getDefinitionBytes() { + java.lang.Object ref = definition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + definition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The definition of the schema. This should contain a string representing
+     * the full definition of the schema that is a valid schema definition of
+     * the type specified in `type`.
+     * 
+ * + * string definition = 3; + * + * @param value The definition to set. + * @return This builder for chaining. + */ + public Builder setDefinition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + definition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The definition of the schema. This should contain a string representing
+     * the full definition of the schema that is a valid schema definition of
+     * the type specified in `type`.
+     * 
+ * + * string definition = 3; + * + * @return This builder for chaining. + */ + public Builder clearDefinition() { + + definition_ = getDefaultInstance().getDefinition(); + onChanged(); + return this; + } + /** + * + * + *
+     * The definition of the schema. This should contain a string representing
+     * the full definition of the schema that is a valid schema definition of
+     * the type specified in `type`.
+     * 
+ * + * string definition = 3; + * + * @param value The bytes for definition to set. + * @return This builder for chaining. + */ + public Builder setDefinitionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + definition_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.Schema) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.Schema) + private static final com.google.pubsub.v1.Schema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.Schema(); + } + + public static com.google.pubsub.v1.Schema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Schema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Schema(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.Schema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaName.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaName.java new file mode 100644 index 000000000..658f517c0 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaName.java @@ -0,0 +1,182 @@ +/* + * 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.pubsub.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class SchemaName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/schemas/{schema}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String schema; + + public String getProject() { + return project; + } + + public String getSchema() { + return schema; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private SchemaName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + schema = Preconditions.checkNotNull(builder.getSchema()); + } + + public static SchemaName of(String project, String schema) { + return newBuilder().setProject(project).setSchema(schema).build(); + } + + public static String format(String project, String schema) { + return newBuilder().setProject(project).setSchema(schema).build().toString(); + } + + public static SchemaName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "SchemaName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("schema")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (SchemaName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("schema", schema); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "schema", schema); + } + + /** Builder for SchemaName. */ + public static class Builder { + + private String project; + private String schema; + + public String getProject() { + return project; + } + + public String getSchema() { + return schema; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setSchema(String schema) { + this.schema = schema; + return this; + } + + private Builder() {} + + private Builder(SchemaName schemaName) { + project = schemaName.project; + schema = schemaName.schema; + } + + public SchemaName build() { + return new SchemaName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SchemaName) { + SchemaName that = (SchemaName) o; + return (this.project.equals(that.project)) && (this.schema.equals(that.schema)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= schema.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaOrBuilder.java new file mode 100644 index 000000000..30c88d8aa --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaOrBuilder.java @@ -0,0 +1,106 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface SchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.Schema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the schema.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the schema.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The type of the schema definition.
+   * 
+ * + * .google.pubsub.v1.Schema.Type type = 2; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * The type of the schema definition.
+   * 
+ * + * .google.pubsub.v1.Schema.Type type = 2; + * + * @return The type. + */ + com.google.pubsub.v1.Schema.Type getType(); + + /** + * + * + *
+   * The definition of the schema. This should contain a string representing
+   * the full definition of the schema that is a valid schema definition of
+   * the type specified in `type`.
+   * 
+ * + * string definition = 3; + * + * @return The definition. + */ + java.lang.String getDefinition(); + /** + * + * + *
+   * The definition of the schema. This should contain a string representing
+   * the full definition of the schema that is a valid schema definition of
+   * the type specified in `type`.
+   * 
+ * + * string definition = 3; + * + * @return The bytes for definition. + */ + com.google.protobuf.ByteString getDefinitionBytes(); +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaProto.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaProto.java new file mode 100644 index 000000000..f692cb891 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaProto.java @@ -0,0 +1,255 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public final class SchemaProto { + private SchemaProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_Schema_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_Schema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_CreateSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_CreateSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_GetSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_GetSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ListSchemasRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_ListSchemasRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ListSchemasResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_ListSchemasResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_DeleteSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_DeleteSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ValidateSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_ValidateSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ValidateSchemaResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_ValidateSchemaResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ValidateMessageRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_ValidateMessageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_pubsub_v1_ValidateMessageResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_pubsub_v1_ValidateMessageResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\035google/pubsub/v1/schema.proto\022\020google." + + "pubsub.v1\032\034google/api/annotations.proto\032" + + "\027google/api/client.proto\032\037google/api/fie" + + "ld_behavior.proto\032\031google/api/resource.p" + + "roto\032\033google/protobuf/empty.proto\"\341\001\n\006Sc" + + "hema\022\021\n\004name\030\001 \001(\tB\003\340A\002\022+\n\004type\030\002 \001(\0162\035." + + "google.pubsub.v1.Schema.Type\022\022\n\ndefiniti" + + "on\030\003 \001(\t\";\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\023" + + "\n\017PROTOCOL_BUFFER\020\001\022\010\n\004AVRO\020\002:F\352AC\n\034pubs" + + "ub.googleapis.com/Schema\022#projects/{proj" + + "ect}/schemas/{schema}\"\215\001\n\023CreateSchemaRe" + + "quest\0224\n\006parent\030\001 \001(\tB$\340A\002\372A\036\022\034pubsub.go" + + "ogleapis.com/Schema\022-\n\006schema\030\002 \001(\0132\030.go" + + "ogle.pubsub.v1.SchemaB\003\340A\002\022\021\n\tschema_id\030" + + "\003 \001(\t\"r\n\020GetSchemaRequest\0222\n\004name\030\001 \001(\tB" + + "$\340A\002\372A\036\n\034pubsub.googleapis.com/Schema\022*\n" + + "\004view\030\002 \001(\0162\034.google.pubsub.v1.SchemaVie" + + "w\"\254\001\n\022ListSchemasRequest\022C\n\006parent\030\001 \001(\t" + + "B3\340A\002\372A-\n+cloudresourcemanager.googleapi" + + "s.com/Project\022*\n\004view\030\002 \001(\0162\034.google.pub" + + "sub.v1.SchemaView\022\021\n\tpage_size\030\003 \001(\005\022\022\n\n" + + "page_token\030\004 \001(\t\"Y\n\023ListSchemasResponse\022" + + ")\n\007schemas\030\001 \003(\0132\030.google.pubsub.v1.Sche" + + "ma\022\027\n\017next_page_token\030\002 \001(\t\"I\n\023DeleteSch" + + "emaRequest\0222\n\004name\030\001 \001(\tB$\340A\002\372A\036\n\034pubsub" + + ".googleapis.com/Schema\"\213\001\n\025ValidateSchem" + + "aRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudr" + + "esourcemanager.googleapis.com/Project\022-\n" + + "\006schema\030\002 \001(\0132\030.google.pubsub.v1.SchemaB" + + "\003\340A\002\"\030\n\026ValidateSchemaResponse\"\212\002\n\026Valid" + + "ateMessageRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A" + + "-\n+cloudresourcemanager.googleapis.com/P" + + "roject\0221\n\004name\030\002 \001(\tB!\372A\036\n\034pubsub.google" + + "apis.com/SchemaH\000\022*\n\006schema\030\003 \001(\0132\030.goog" + + "le.pubsub.v1.SchemaH\000\022\017\n\007message\030\004 \001(\014\022," + + "\n\010encoding\030\005 \001(\0162\032.google.pubsub.v1.Enco" + + "dingB\r\n\013schema_spec\"\031\n\027ValidateMessageRe" + + "sponse*>\n\nSchemaView\022\033\n\027SCHEMA_VIEW_UNSP" + + "ECIFIED\020\000\022\t\n\005BASIC\020\001\022\010\n\004FULL\020\002*:\n\010Encodi" + + "ng\022\030\n\024ENCODING_UNSPECIFIED\020\000\022\010\n\004JSON\020\001\022\n" + + "\n\006BINARY\020\0022\367\007\n\rSchemaService\022\232\001\n\014CreateS" + + "chema\022%.google.pubsub.v1.CreateSchemaReq" + + "uest\032\030.google.pubsub.v1.Schema\"I\202\323\344\223\002)\"\037" + + "/v1/{parent=projects/*}/schemas:\006schema\332" + + "A\027parent,schema,schema_id\022y\n\tGetSchema\022\"" + + ".google.pubsub.v1.GetSchemaRequest\032\030.goo" + + "gle.pubsub.v1.Schema\".\202\323\344\223\002!\022\037/v1/{name=" + + "projects/*/schemas/*}\332A\004name\022\214\001\n\013ListSch" + + "emas\022$.google.pubsub.v1.ListSchemasReque" + + "st\032%.google.pubsub.v1.ListSchemasRespons" + + "e\"0\202\323\344\223\002!\022\037/v1/{parent=projects/*}/schem" + + "as\332A\006parent\022}\n\014DeleteSchema\022%.google.pub" + + "sub.v1.DeleteSchemaRequest\032\026.google.prot" + + "obuf.Empty\".\202\323\344\223\002!*\037/v1/{name=projects/*" + + "/schemas/*}\332A\004name\022\250\001\n\016ValidateSchema\022\'." + + "google.pubsub.v1.ValidateSchemaRequest\032(" + + ".google.pubsub.v1.ValidateSchemaResponse" + + "\"C\202\323\344\223\002-\"(/v1/{parent=projects/*}/schema" + + "s:validate:\001*\332A\rparent,schema\022\242\001\n\017Valida" + + "teMessage\022(.google.pubsub.v1.ValidateMes" + + "sageRequest\032).google.pubsub.v1.ValidateM" + + "essageResponse\":\202\323\344\223\0024\"//v1/{parent=proj" + + "ects/*}/schemas:validateMessage:\001*\032p\312A\025p" + + "ubsub.googleapis.com\322AUhttps://www.googl" + + "eapis.com/auth/cloud-platform,https://ww" + + "w.googleapis.com/auth/pubsubB\256\001\n\024com.goo" + + "gle.pubsub.v1B\013SchemaProtoP\001Z6google.gol" + + "ang.org/genproto/googleapis/pubsub/v1;pu" + + "bsub\370\001\001\252\002\026Google.Cloud.PubSub.V1\312\002\026Googl" + + "e\\Cloud\\PubSub\\V1\352\002\031Google::Cloud::PubSu" + + "b::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_google_pubsub_v1_Schema_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_pubsub_v1_Schema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_Schema_descriptor, + new java.lang.String[] { + "Name", "Type", "Definition", + }); + internal_static_google_pubsub_v1_CreateSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_pubsub_v1_CreateSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_CreateSchemaRequest_descriptor, + new java.lang.String[] { + "Parent", "Schema", "SchemaId", + }); + internal_static_google_pubsub_v1_GetSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_pubsub_v1_GetSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_GetSchemaRequest_descriptor, + new java.lang.String[] { + "Name", "View", + }); + internal_static_google_pubsub_v1_ListSchemasRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_pubsub_v1_ListSchemasRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_ListSchemasRequest_descriptor, + new java.lang.String[] { + "Parent", "View", "PageSize", "PageToken", + }); + internal_static_google_pubsub_v1_ListSchemasResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_pubsub_v1_ListSchemasResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_ListSchemasResponse_descriptor, + new java.lang.String[] { + "Schemas", "NextPageToken", + }); + internal_static_google_pubsub_v1_DeleteSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_pubsub_v1_DeleteSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_DeleteSchemaRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_pubsub_v1_ValidateSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_pubsub_v1_ValidateSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_ValidateSchemaRequest_descriptor, + new java.lang.String[] { + "Parent", "Schema", + }); + internal_static_google_pubsub_v1_ValidateSchemaResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_pubsub_v1_ValidateSchemaResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_ValidateSchemaResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_pubsub_v1_ValidateMessageRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_pubsub_v1_ValidateMessageRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_ValidateMessageRequest_descriptor, + new java.lang.String[] { + "Parent", "Name", "Schema", "Message", "Encoding", "SchemaSpec", + }); + internal_static_google_pubsub_v1_ValidateMessageResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_pubsub_v1_ValidateMessageResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_pubsub_v1_ValidateMessageResponse_descriptor, + new java.lang.String[] {}); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettings.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettings.java new file mode 100644 index 000000000..bca71d432 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettings.java @@ -0,0 +1,814 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Settings for validating messages published against a schema.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.SchemaSettings} + */ +public final class SchemaSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.SchemaSettings) + SchemaSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use SchemaSettings.newBuilder() to construct. + private SchemaSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SchemaSettings() { + schema_ = ""; + encoding_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SchemaSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SchemaSettings( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + schema_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + encoding_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.PubsubProto + .internal_static_google_pubsub_v1_SchemaSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto + .internal_static_google_pubsub_v1_SchemaSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.SchemaSettings.class, + com.google.pubsub.v1.SchemaSettings.Builder.class); + } + + public static final int SCHEMA_FIELD_NUMBER = 1; + private volatile java.lang.Object schema_; + /** + * + * + *
+   * Required. The name of the schema that messages published should be
+   * validated against. Format is `projects/{project}/schemas/{schema}`. The
+   * value of this field will be `_deleted-schema_` if the schema has been
+   * deleted.
+   * 
+ * + * + * string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The schema. + */ + @java.lang.Override + public java.lang.String getSchema() { + java.lang.Object ref = schema_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schema_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the schema that messages published should be
+   * validated against. Format is `projects/{project}/schemas/{schema}`. The
+   * value of this field will be `_deleted-schema_` if the schema has been
+   * deleted.
+   * 
+ * + * + * string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for schema. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaBytes() { + java.lang.Object ref = schema_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schema_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENCODING_FIELD_NUMBER = 2; + private int encoding_; + /** + * + * + *
+   * The encoding of messages validated against `schema`.
+   * 
+ * + * .google.pubsub.v1.Encoding encoding = 2; + * + * @return The enum numeric value on the wire for encoding. + */ + @java.lang.Override + public int getEncodingValue() { + return encoding_; + } + /** + * + * + *
+   * The encoding of messages validated against `schema`.
+   * 
+ * + * .google.pubsub.v1.Encoding encoding = 2; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.pubsub.v1.Encoding getEncoding() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.Encoding result = com.google.pubsub.v1.Encoding.valueOf(encoding_); + return result == null ? com.google.pubsub.v1.Encoding.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getSchemaBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, schema_); + } + if (encoding_ != com.google.pubsub.v1.Encoding.ENCODING_UNSPECIFIED.getNumber()) { + output.writeEnum(2, encoding_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSchemaBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, schema_); + } + if (encoding_ != com.google.pubsub.v1.Encoding.ENCODING_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, encoding_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.SchemaSettings)) { + return super.equals(obj); + } + com.google.pubsub.v1.SchemaSettings other = (com.google.pubsub.v1.SchemaSettings) obj; + + if (!getSchema().equals(other.getSchema())) return false; + if (encoding_ != other.encoding_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema().hashCode(); + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + encoding_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.SchemaSettings parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.SchemaSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.SchemaSettings parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.SchemaSettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.SchemaSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.SchemaSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.SchemaSettings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.SchemaSettings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.SchemaSettings parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.SchemaSettings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.SchemaSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.SchemaSettings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.SchemaSettings prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Settings for validating messages published against a schema.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.SchemaSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.SchemaSettings) + com.google.pubsub.v1.SchemaSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.PubsubProto + .internal_static_google_pubsub_v1_SchemaSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto + .internal_static_google_pubsub_v1_SchemaSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.SchemaSettings.class, + com.google.pubsub.v1.SchemaSettings.Builder.class); + } + + // Construct using com.google.pubsub.v1.SchemaSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + schema_ = ""; + + encoding_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto + .internal_static_google_pubsub_v1_SchemaSettings_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.SchemaSettings getDefaultInstanceForType() { + return com.google.pubsub.v1.SchemaSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.SchemaSettings build() { + com.google.pubsub.v1.SchemaSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.SchemaSettings buildPartial() { + com.google.pubsub.v1.SchemaSettings result = new com.google.pubsub.v1.SchemaSettings(this); + result.schema_ = schema_; + result.encoding_ = encoding_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.SchemaSettings) { + return mergeFrom((com.google.pubsub.v1.SchemaSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.SchemaSettings other) { + if (other == com.google.pubsub.v1.SchemaSettings.getDefaultInstance()) return this; + if (!other.getSchema().isEmpty()) { + schema_ = other.schema_; + onChanged(); + } + if (other.encoding_ != 0) { + setEncodingValue(other.getEncodingValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.SchemaSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.SchemaSettings) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object schema_ = ""; + /** + * + * + *
+     * Required. The name of the schema that messages published should be
+     * validated against. Format is `projects/{project}/schemas/{schema}`. The
+     * value of this field will be `_deleted-schema_` if the schema has been
+     * deleted.
+     * 
+ * + * + * string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The schema. + */ + public java.lang.String getSchema() { + java.lang.Object ref = schema_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schema_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the schema that messages published should be
+     * validated against. Format is `projects/{project}/schemas/{schema}`. The
+     * value of this field will be `_deleted-schema_` if the schema has been
+     * deleted.
+     * 
+ * + * + * string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for schema. + */ + public com.google.protobuf.ByteString getSchemaBytes() { + java.lang.Object ref = schema_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schema_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the schema that messages published should be
+     * validated against. Format is `projects/{project}/schemas/{schema}`. The
+     * value of this field will be `_deleted-schema_` if the schema has been
+     * deleted.
+     * 
+ * + * + * string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The schema to set. + * @return This builder for chaining. + */ + public Builder setSchema(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + schema_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the schema that messages published should be
+     * validated against. Format is `projects/{project}/schemas/{schema}`. The
+     * value of this field will be `_deleted-schema_` if the schema has been
+     * deleted.
+     * 
+ * + * + * string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSchema() { + + schema_ = getDefaultInstance().getSchema(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the schema that messages published should be
+     * validated against. Format is `projects/{project}/schemas/{schema}`. The
+     * value of this field will be `_deleted-schema_` if the schema has been
+     * deleted.
+     * 
+ * + * + * string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for schema to set. + * @return This builder for chaining. + */ + public Builder setSchemaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + schema_ = value; + onChanged(); + return this; + } + + private int encoding_ = 0; + /** + * + * + *
+     * The encoding of messages validated against `schema`.
+     * 
+ * + * .google.pubsub.v1.Encoding encoding = 2; + * + * @return The enum numeric value on the wire for encoding. + */ + @java.lang.Override + public int getEncodingValue() { + return encoding_; + } + /** + * + * + *
+     * The encoding of messages validated against `schema`.
+     * 
+ * + * .google.pubsub.v1.Encoding encoding = 2; + * + * @param value The enum numeric value on the wire for encoding to set. + * @return This builder for chaining. + */ + public Builder setEncodingValue(int value) { + + encoding_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The encoding of messages validated against `schema`.
+     * 
+ * + * .google.pubsub.v1.Encoding encoding = 2; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.pubsub.v1.Encoding getEncoding() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.Encoding result = com.google.pubsub.v1.Encoding.valueOf(encoding_); + return result == null ? com.google.pubsub.v1.Encoding.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The encoding of messages validated against `schema`.
+     * 
+ * + * .google.pubsub.v1.Encoding encoding = 2; + * + * @param value The encoding to set. + * @return This builder for chaining. + */ + public Builder setEncoding(com.google.pubsub.v1.Encoding value) { + if (value == null) { + throw new NullPointerException(); + } + + encoding_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The encoding of messages validated against `schema`.
+     * 
+ * + * .google.pubsub.v1.Encoding encoding = 2; + * + * @return This builder for chaining. + */ + public Builder clearEncoding() { + + encoding_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.SchemaSettings) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.SchemaSettings) + private static final com.google.pubsub.v1.SchemaSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.SchemaSettings(); + } + + public static com.google.pubsub.v1.SchemaSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SchemaSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SchemaSettings(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.SchemaSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettingsOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettingsOrBuilder.java new file mode 100644 index 000000000..f44178d47 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettingsOrBuilder.java @@ -0,0 +1,85 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface SchemaSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.SchemaSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the schema that messages published should be
+   * validated against. Format is `projects/{project}/schemas/{schema}`. The
+   * value of this field will be `_deleted-schema_` if the schema has been
+   * deleted.
+   * 
+ * + * + * string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The schema. + */ + java.lang.String getSchema(); + /** + * + * + *
+   * Required. The name of the schema that messages published should be
+   * validated against. Format is `projects/{project}/schemas/{schema}`. The
+   * value of this field will be `_deleted-schema_` if the schema has been
+   * deleted.
+   * 
+ * + * + * string schema = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for schema. + */ + com.google.protobuf.ByteString getSchemaBytes(); + + /** + * + * + *
+   * The encoding of messages validated against `schema`.
+   * 
+ * + * .google.pubsub.v1.Encoding encoding = 2; + * + * @return The enum numeric value on the wire for encoding. + */ + int getEncodingValue(); + /** + * + * + *
+   * The encoding of messages validated against `schema`.
+   * 
+ * + * .google.pubsub.v1.Encoding encoding = 2; + * + * @return The encoding. + */ + com.google.pubsub.v1.Encoding getEncoding(); +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaView.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaView.java new file mode 100644 index 000000000..2d9433fd1 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaView.java @@ -0,0 +1,178 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * View of Schema object fields to be returned by GetSchema and ListSchemas.
+ * 
+ * + * Protobuf enum {@code google.pubsub.v1.SchemaView} + */ +public enum SchemaView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The default / unset value.
+   * The API will default to the BASIC view.
+   * 
+ * + * SCHEMA_VIEW_UNSPECIFIED = 0; + */ + SCHEMA_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * Include the name and type of the schema, but not the definition.
+   * 
+ * + * BASIC = 1; + */ + BASIC(1), + /** + * + * + *
+   * Include all Schema object fields.
+   * 
+ * + * FULL = 2; + */ + FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The default / unset value.
+   * The API will default to the BASIC view.
+   * 
+ * + * SCHEMA_VIEW_UNSPECIFIED = 0; + */ + public static final int SCHEMA_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Include the name and type of the schema, but not the definition.
+   * 
+ * + * BASIC = 1; + */ + public static final int BASIC_VALUE = 1; + /** + * + * + *
+   * Include all Schema object fields.
+   * 
+ * + * FULL = 2; + */ + public static final int FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SchemaView valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SchemaView forNumber(int value) { + switch (value) { + case 0: + return SCHEMA_VIEW_UNSPECIFIED; + case 1: + return BASIC; + case 2: + return FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SchemaView findValueByNumber(int number) { + return SchemaView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto.getDescriptor().getEnumTypes().get(0); + } + + private static final SchemaView[] VALUES = values(); + + public static SchemaView valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SchemaView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.pubsub.v1.SchemaView) +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Topic.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Topic.java index 18db5a187..6a7449962 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Topic.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Topic.java @@ -115,6 +115,27 @@ private Topic( kmsKeyName_ = s; break; } + case 50: + { + com.google.pubsub.v1.SchemaSettings.Builder subBuilder = null; + if (schemaSettings_ != null) { + subBuilder = schemaSettings_.toBuilder(); + } + schemaSettings_ = + input.readMessage( + com.google.pubsub.v1.SchemaSettings.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(schemaSettings_); + schemaSettings_ = subBuilder.buildPartial(); + } + + break; + } + case 56: + { + satisfiesPzs_ = input.readBool(); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -426,6 +447,76 @@ public com.google.protobuf.ByteString getKmsKeyNameBytes() { } } + public static final int SCHEMA_SETTINGS_FIELD_NUMBER = 6; + private com.google.pubsub.v1.SchemaSettings schemaSettings_; + /** + * + * + *
+   * Settings for validating messages published against a schema.
+   * EXPERIMENTAL: Schema support is in development and may not work yet.
+   * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + * + * @return Whether the schemaSettings field is set. + */ + @java.lang.Override + public boolean hasSchemaSettings() { + return schemaSettings_ != null; + } + /** + * + * + *
+   * Settings for validating messages published against a schema.
+   * EXPERIMENTAL: Schema support is in development and may not work yet.
+   * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + * + * @return The schemaSettings. + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaSettings getSchemaSettings() { + return schemaSettings_ == null + ? com.google.pubsub.v1.SchemaSettings.getDefaultInstance() + : schemaSettings_; + } + /** + * + * + *
+   * Settings for validating messages published against a schema.
+   * EXPERIMENTAL: Schema support is in development and may not work yet.
+   * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaSettingsOrBuilder getSchemaSettingsOrBuilder() { + return getSchemaSettings(); + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 7; + private boolean satisfiesPzs_; + /** + * + * + *
+   * Reserved for future use. This field is set only in responses from the
+   * server; it is ignored if it is set in any requests.
+   * 
+ * + * bool satisfies_pzs = 7; + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public boolean getSatisfiesPzs() { + return satisfiesPzs_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -451,6 +542,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getKmsKeyNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, kmsKeyName_); } + if (schemaSettings_ != null) { + output.writeMessage(6, getSchemaSettings()); + } + if (satisfiesPzs_ != false) { + output.writeBool(7, satisfiesPzs_); + } unknownFields.writeTo(output); } @@ -480,6 +577,12 @@ public int getSerializedSize() { if (!getKmsKeyNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, kmsKeyName_); } + if (schemaSettings_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getSchemaSettings()); + } + if (satisfiesPzs_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, satisfiesPzs_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -502,6 +605,11 @@ public boolean equals(final java.lang.Object obj) { if (!getMessageStoragePolicy().equals(other.getMessageStoragePolicy())) return false; } if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (hasSchemaSettings() != other.hasSchemaSettings()) return false; + if (hasSchemaSettings()) { + if (!getSchemaSettings().equals(other.getSchemaSettings())) return false; + } + if (getSatisfiesPzs() != other.getSatisfiesPzs()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -525,6 +633,12 @@ public int hashCode() { } hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; hash = (53 * hash) + getKmsKeyName().hashCode(); + if (hasSchemaSettings()) { + hash = (37 * hash) + SCHEMA_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getSchemaSettings().hashCode(); + } + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSatisfiesPzs()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -698,6 +812,14 @@ public Builder clear() { } kmsKeyName_ = ""; + if (schemaSettingsBuilder_ == null) { + schemaSettings_ = null; + } else { + schemaSettings_ = null; + schemaSettingsBuilder_ = null; + } + satisfiesPzs_ = false; + return this; } @@ -733,6 +855,12 @@ public com.google.pubsub.v1.Topic buildPartial() { result.messageStoragePolicy_ = messageStoragePolicyBuilder_.build(); } result.kmsKeyName_ = kmsKeyName_; + if (schemaSettingsBuilder_ == null) { + result.schemaSettings_ = schemaSettings_; + } else { + result.schemaSettings_ = schemaSettingsBuilder_.build(); + } + result.satisfiesPzs_ = satisfiesPzs_; onBuilt(); return result; } @@ -794,6 +922,12 @@ public Builder mergeFrom(com.google.pubsub.v1.Topic other) { kmsKeyName_ = other.kmsKeyName_; onChanged(); } + if (other.hasSchemaSettings()) { + mergeSchemaSettings(other.getSchemaSettings()); + } + if (other.getSatisfiesPzs() != false) { + setSatisfiesPzs(other.getSatisfiesPzs()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1440,6 +1574,255 @@ public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.pubsub.v1.SchemaSettings schemaSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.SchemaSettings, + com.google.pubsub.v1.SchemaSettings.Builder, + com.google.pubsub.v1.SchemaSettingsOrBuilder> + schemaSettingsBuilder_; + /** + * + * + *
+     * Settings for validating messages published against a schema.
+     * EXPERIMENTAL: Schema support is in development and may not work yet.
+     * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + * + * @return Whether the schemaSettings field is set. + */ + public boolean hasSchemaSettings() { + return schemaSettingsBuilder_ != null || schemaSettings_ != null; + } + /** + * + * + *
+     * Settings for validating messages published against a schema.
+     * EXPERIMENTAL: Schema support is in development and may not work yet.
+     * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + * + * @return The schemaSettings. + */ + public com.google.pubsub.v1.SchemaSettings getSchemaSettings() { + if (schemaSettingsBuilder_ == null) { + return schemaSettings_ == null + ? com.google.pubsub.v1.SchemaSettings.getDefaultInstance() + : schemaSettings_; + } else { + return schemaSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Settings for validating messages published against a schema.
+     * EXPERIMENTAL: Schema support is in development and may not work yet.
+     * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + */ + public Builder setSchemaSettings(com.google.pubsub.v1.SchemaSettings value) { + if (schemaSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schemaSettings_ = value; + onChanged(); + } else { + schemaSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Settings for validating messages published against a schema.
+     * EXPERIMENTAL: Schema support is in development and may not work yet.
+     * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + */ + public Builder setSchemaSettings(com.google.pubsub.v1.SchemaSettings.Builder builderForValue) { + if (schemaSettingsBuilder_ == null) { + schemaSettings_ = builderForValue.build(); + onChanged(); + } else { + schemaSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Settings for validating messages published against a schema.
+     * EXPERIMENTAL: Schema support is in development and may not work yet.
+     * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + */ + public Builder mergeSchemaSettings(com.google.pubsub.v1.SchemaSettings value) { + if (schemaSettingsBuilder_ == null) { + if (schemaSettings_ != null) { + schemaSettings_ = + com.google.pubsub.v1.SchemaSettings.newBuilder(schemaSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + schemaSettings_ = value; + } + onChanged(); + } else { + schemaSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Settings for validating messages published against a schema.
+     * EXPERIMENTAL: Schema support is in development and may not work yet.
+     * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + */ + public Builder clearSchemaSettings() { + if (schemaSettingsBuilder_ == null) { + schemaSettings_ = null; + onChanged(); + } else { + schemaSettings_ = null; + schemaSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Settings for validating messages published against a schema.
+     * EXPERIMENTAL: Schema support is in development and may not work yet.
+     * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + */ + public com.google.pubsub.v1.SchemaSettings.Builder getSchemaSettingsBuilder() { + + onChanged(); + return getSchemaSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Settings for validating messages published against a schema.
+     * EXPERIMENTAL: Schema support is in development and may not work yet.
+     * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + */ + public com.google.pubsub.v1.SchemaSettingsOrBuilder getSchemaSettingsOrBuilder() { + if (schemaSettingsBuilder_ != null) { + return schemaSettingsBuilder_.getMessageOrBuilder(); + } else { + return schemaSettings_ == null + ? com.google.pubsub.v1.SchemaSettings.getDefaultInstance() + : schemaSettings_; + } + } + /** + * + * + *
+     * Settings for validating messages published against a schema.
+     * EXPERIMENTAL: Schema support is in development and may not work yet.
+     * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.SchemaSettings, + com.google.pubsub.v1.SchemaSettings.Builder, + com.google.pubsub.v1.SchemaSettingsOrBuilder> + getSchemaSettingsFieldBuilder() { + if (schemaSettingsBuilder_ == null) { + schemaSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.SchemaSettings, + com.google.pubsub.v1.SchemaSettings.Builder, + com.google.pubsub.v1.SchemaSettingsOrBuilder>( + getSchemaSettings(), getParentForChildren(), isClean()); + schemaSettings_ = null; + } + return schemaSettingsBuilder_; + } + + private boolean satisfiesPzs_; + /** + * + * + *
+     * Reserved for future use. This field is set only in responses from the
+     * server; it is ignored if it is set in any requests.
+     * 
+ * + * bool satisfies_pzs = 7; + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public boolean getSatisfiesPzs() { + return satisfiesPzs_; + } + /** + * + * + *
+     * Reserved for future use. This field is set only in responses from the
+     * server; it is ignored if it is set in any requests.
+     * 
+ * + * bool satisfies_pzs = 7; + * + * @param value The satisfiesPzs to set. + * @return This builder for chaining. + */ + public Builder setSatisfiesPzs(boolean value) { + + satisfiesPzs_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Reserved for future use. This field is set only in responses from the
+     * server; it is ignored if it is set in any requests.
+     * 
+ * + * bool satisfies_pzs = 7; + * + * @return This builder for chaining. + */ + public Builder clearSatisfiesPzs() { + + satisfiesPzs_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicOrBuilder.java index a11846480..d7606f288 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicOrBuilder.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicOrBuilder.java @@ -186,4 +186,56 @@ public interface TopicOrBuilder * @return The bytes for kmsKeyName. */ com.google.protobuf.ByteString getKmsKeyNameBytes(); + + /** + * + * + *
+   * Settings for validating messages published against a schema.
+   * EXPERIMENTAL: Schema support is in development and may not work yet.
+   * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + * + * @return Whether the schemaSettings field is set. + */ + boolean hasSchemaSettings(); + /** + * + * + *
+   * Settings for validating messages published against a schema.
+   * EXPERIMENTAL: Schema support is in development and may not work yet.
+   * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + * + * @return The schemaSettings. + */ + com.google.pubsub.v1.SchemaSettings getSchemaSettings(); + /** + * + * + *
+   * Settings for validating messages published against a schema.
+   * EXPERIMENTAL: Schema support is in development and may not work yet.
+   * 
+ * + * .google.pubsub.v1.SchemaSettings schema_settings = 6; + */ + com.google.pubsub.v1.SchemaSettingsOrBuilder getSchemaSettingsOrBuilder(); + + /** + * + * + *
+   * Reserved for future use. This field is set only in responses from the
+   * server; it is ignored if it is set in any requests.
+   * 
+ * + * bool satisfies_pzs = 7; + * + * @return The satisfiesPzs. + */ + boolean getSatisfiesPzs(); } diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequest.java new file mode 100644 index 000000000..215bef410 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequest.java @@ -0,0 +1,1486 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Request for the `ValidateMessage` method.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.ValidateMessageRequest} + */ +public final class ValidateMessageRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ValidateMessageRequest) + ValidateMessageRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ValidateMessageRequest.newBuilder() to construct. + private ValidateMessageRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ValidateMessageRequest() { + parent_ = ""; + message_ = com.google.protobuf.ByteString.EMPTY; + encoding_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ValidateMessageRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ValidateMessageRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + schemaSpecCase_ = 2; + schemaSpec_ = s; + break; + } + case 26: + { + com.google.pubsub.v1.Schema.Builder subBuilder = null; + if (schemaSpecCase_ == 3) { + subBuilder = ((com.google.pubsub.v1.Schema) schemaSpec_).toBuilder(); + } + schemaSpec_ = + input.readMessage(com.google.pubsub.v1.Schema.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.pubsub.v1.Schema) schemaSpec_); + schemaSpec_ = subBuilder.buildPartial(); + } + schemaSpecCase_ = 3; + break; + } + case 34: + { + message_ = input.readBytes(); + break; + } + case 40: + { + int rawValue = input.readEnum(); + + encoding_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateMessageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateMessageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ValidateMessageRequest.class, + com.google.pubsub.v1.ValidateMessageRequest.Builder.class); + } + + private int schemaSpecCase_ = 0; + private java.lang.Object schemaSpec_; + + public enum SchemaSpecCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + NAME(2), + SCHEMA(3), + SCHEMASPEC_NOT_SET(0); + private final int value; + + private SchemaSpecCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SchemaSpecCase valueOf(int value) { + return forNumber(value); + } + + public static SchemaSpecCase forNumber(int value) { + switch (value) { + case 2: + return NAME; + case 3: + return SCHEMA; + case 0: + return SCHEMASPEC_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SchemaSpecCase getSchemaSpecCase() { + return SchemaSpecCase.forNumber(schemaSpecCase_); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the project in which to validate schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the project in which to validate schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + /** + * + * + *
+   * Name of the schema against which to validate.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = ""; + if (schemaSpecCase_ == 2) { + ref = schemaSpec_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (schemaSpecCase_ == 2) { + schemaSpec_ = s; + } + return s; + } + } + /** + * + * + *
+   * Name of the schema against which to validate.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = ""; + if (schemaSpecCase_ == 2) { + ref = schemaSpec_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (schemaSpecCase_ == 2) { + schemaSpec_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCHEMA_FIELD_NUMBER = 3; + /** + * + * + *
+   * Ad-hoc schema against which to validate
+   * 
+ * + * .google.pubsub.v1.Schema schema = 3; + * + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return schemaSpecCase_ == 3; + } + /** + * + * + *
+   * Ad-hoc schema against which to validate
+   * 
+ * + * .google.pubsub.v1.Schema schema = 3; + * + * @return The schema. + */ + @java.lang.Override + public com.google.pubsub.v1.Schema getSchema() { + if (schemaSpecCase_ == 3) { + return (com.google.pubsub.v1.Schema) schemaSpec_; + } + return com.google.pubsub.v1.Schema.getDefaultInstance(); + } + /** + * + * + *
+   * Ad-hoc schema against which to validate
+   * 
+ * + * .google.pubsub.v1.Schema schema = 3; + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaOrBuilder getSchemaOrBuilder() { + if (schemaSpecCase_ == 3) { + return (com.google.pubsub.v1.Schema) schemaSpec_; + } + return com.google.pubsub.v1.Schema.getDefaultInstance(); + } + + public static final int MESSAGE_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString message_; + /** + * + * + *
+   * Message to validate against the provided `schema_spec`.
+   * 
+ * + * bytes message = 4; + * + * @return The message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessage() { + return message_; + } + + public static final int ENCODING_FIELD_NUMBER = 5; + private int encoding_; + /** + * + * + *
+   * The encoding expected for messages
+   * 
+ * + * .google.pubsub.v1.Encoding encoding = 5; + * + * @return The enum numeric value on the wire for encoding. + */ + @java.lang.Override + public int getEncodingValue() { + return encoding_; + } + /** + * + * + *
+   * The encoding expected for messages
+   * 
+ * + * .google.pubsub.v1.Encoding encoding = 5; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.pubsub.v1.Encoding getEncoding() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.Encoding result = com.google.pubsub.v1.Encoding.valueOf(encoding_); + return result == null ? com.google.pubsub.v1.Encoding.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (schemaSpecCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, schemaSpec_); + } + if (schemaSpecCase_ == 3) { + output.writeMessage(3, (com.google.pubsub.v1.Schema) schemaSpec_); + } + if (!message_.isEmpty()) { + output.writeBytes(4, message_); + } + if (encoding_ != com.google.pubsub.v1.Encoding.ENCODING_UNSPECIFIED.getNumber()) { + output.writeEnum(5, encoding_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (schemaSpecCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, schemaSpec_); + } + if (schemaSpecCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.pubsub.v1.Schema) schemaSpec_); + } + if (!message_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, message_); + } + if (encoding_ != com.google.pubsub.v1.Encoding.ENCODING_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, encoding_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.ValidateMessageRequest)) { + return super.equals(obj); + } + com.google.pubsub.v1.ValidateMessageRequest other = + (com.google.pubsub.v1.ValidateMessageRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (encoding_ != other.encoding_) return false; + if (!getSchemaSpecCase().equals(other.getSchemaSpecCase())) return false; + switch (schemaSpecCase_) { + case 2: + if (!getName().equals(other.getName())) return false; + break; + case 3: + if (!getSchema().equals(other.getSchema())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + encoding_; + switch (schemaSpecCase_) { + case 2: + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + break; + case 3: + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateMessageRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.ValidateMessageRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ValidateMessage` method.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.ValidateMessageRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ValidateMessageRequest) + com.google.pubsub.v1.ValidateMessageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateMessageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateMessageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ValidateMessageRequest.class, + com.google.pubsub.v1.ValidateMessageRequest.Builder.class); + } + + // Construct using com.google.pubsub.v1.ValidateMessageRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + message_ = com.google.protobuf.ByteString.EMPTY; + + encoding_ = 0; + + schemaSpecCase_ = 0; + schemaSpec_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateMessageRequest_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateMessageRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.ValidateMessageRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateMessageRequest build() { + com.google.pubsub.v1.ValidateMessageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateMessageRequest buildPartial() { + com.google.pubsub.v1.ValidateMessageRequest result = + new com.google.pubsub.v1.ValidateMessageRequest(this); + result.parent_ = parent_; + if (schemaSpecCase_ == 2) { + result.schemaSpec_ = schemaSpec_; + } + if (schemaSpecCase_ == 3) { + if (schemaBuilder_ == null) { + result.schemaSpec_ = schemaSpec_; + } else { + result.schemaSpec_ = schemaBuilder_.build(); + } + } + result.message_ = message_; + result.encoding_ = encoding_; + result.schemaSpecCase_ = schemaSpecCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ValidateMessageRequest) { + return mergeFrom((com.google.pubsub.v1.ValidateMessageRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ValidateMessageRequest other) { + if (other == com.google.pubsub.v1.ValidateMessageRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getMessage() != com.google.protobuf.ByteString.EMPTY) { + setMessage(other.getMessage()); + } + if (other.encoding_ != 0) { + setEncodingValue(other.getEncodingValue()); + } + switch (other.getSchemaSpecCase()) { + case NAME: + { + schemaSpecCase_ = 2; + schemaSpec_ = other.schemaSpec_; + onChanged(); + break; + } + case SCHEMA: + { + mergeSchema(other.getSchema()); + break; + } + case SCHEMASPEC_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ValidateMessageRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ValidateMessageRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int schemaSpecCase_ = 0; + private java.lang.Object schemaSpec_; + + public SchemaSpecCase getSchemaSpecCase() { + return SchemaSpecCase.forNumber(schemaSpecCase_); + } + + public Builder clearSchemaSpec() { + schemaSpecCase_ = 0; + schemaSpec_ = null; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the project in which to validate schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the project in which to validate schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the project in which to validate schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which to validate schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which to validate schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Name of the schema against which to validate.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = ""; + if (schemaSpecCase_ == 2) { + ref = schemaSpec_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (schemaSpecCase_ == 2) { + schemaSpec_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the schema against which to validate.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = ""; + if (schemaSpecCase_ == 2) { + ref = schemaSpec_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (schemaSpecCase_ == 2) { + schemaSpec_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the schema against which to validate.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + schemaSpecCase_ = 2; + schemaSpec_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the schema against which to validate.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + if (schemaSpecCase_ == 2) { + schemaSpecCase_ = 0; + schemaSpec_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Name of the schema against which to validate.
+     * Format is `projects/{project}/schemas/{schema}`.
+     * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + schemaSpecCase_ = 2; + schemaSpec_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder> + schemaBuilder_; + /** + * + * + *
+     * Ad-hoc schema against which to validate
+     * 
+ * + * .google.pubsub.v1.Schema schema = 3; + * + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return schemaSpecCase_ == 3; + } + /** + * + * + *
+     * Ad-hoc schema against which to validate
+     * 
+ * + * .google.pubsub.v1.Schema schema = 3; + * + * @return The schema. + */ + @java.lang.Override + public com.google.pubsub.v1.Schema getSchema() { + if (schemaBuilder_ == null) { + if (schemaSpecCase_ == 3) { + return (com.google.pubsub.v1.Schema) schemaSpec_; + } + return com.google.pubsub.v1.Schema.getDefaultInstance(); + } else { + if (schemaSpecCase_ == 3) { + return schemaBuilder_.getMessage(); + } + return com.google.pubsub.v1.Schema.getDefaultInstance(); + } + } + /** + * + * + *
+     * Ad-hoc schema against which to validate
+     * 
+ * + * .google.pubsub.v1.Schema schema = 3; + */ + public Builder setSchema(com.google.pubsub.v1.Schema value) { + if (schemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schemaSpec_ = value; + onChanged(); + } else { + schemaBuilder_.setMessage(value); + } + schemaSpecCase_ = 3; + return this; + } + /** + * + * + *
+     * Ad-hoc schema against which to validate
+     * 
+ * + * .google.pubsub.v1.Schema schema = 3; + */ + public Builder setSchema(com.google.pubsub.v1.Schema.Builder builderForValue) { + if (schemaBuilder_ == null) { + schemaSpec_ = builderForValue.build(); + onChanged(); + } else { + schemaBuilder_.setMessage(builderForValue.build()); + } + schemaSpecCase_ = 3; + return this; + } + /** + * + * + *
+     * Ad-hoc schema against which to validate
+     * 
+ * + * .google.pubsub.v1.Schema schema = 3; + */ + public Builder mergeSchema(com.google.pubsub.v1.Schema value) { + if (schemaBuilder_ == null) { + if (schemaSpecCase_ == 3 + && schemaSpec_ != com.google.pubsub.v1.Schema.getDefaultInstance()) { + schemaSpec_ = + com.google.pubsub.v1.Schema.newBuilder((com.google.pubsub.v1.Schema) schemaSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + schemaSpec_ = value; + } + onChanged(); + } else { + if (schemaSpecCase_ == 3) { + schemaBuilder_.mergeFrom(value); + } + schemaBuilder_.setMessage(value); + } + schemaSpecCase_ = 3; + return this; + } + /** + * + * + *
+     * Ad-hoc schema against which to validate
+     * 
+ * + * .google.pubsub.v1.Schema schema = 3; + */ + public Builder clearSchema() { + if (schemaBuilder_ == null) { + if (schemaSpecCase_ == 3) { + schemaSpecCase_ = 0; + schemaSpec_ = null; + onChanged(); + } + } else { + if (schemaSpecCase_ == 3) { + schemaSpecCase_ = 0; + schemaSpec_ = null; + } + schemaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Ad-hoc schema against which to validate
+     * 
+ * + * .google.pubsub.v1.Schema schema = 3; + */ + public com.google.pubsub.v1.Schema.Builder getSchemaBuilder() { + return getSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Ad-hoc schema against which to validate
+     * 
+ * + * .google.pubsub.v1.Schema schema = 3; + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaOrBuilder getSchemaOrBuilder() { + if ((schemaSpecCase_ == 3) && (schemaBuilder_ != null)) { + return schemaBuilder_.getMessageOrBuilder(); + } else { + if (schemaSpecCase_ == 3) { + return (com.google.pubsub.v1.Schema) schemaSpec_; + } + return com.google.pubsub.v1.Schema.getDefaultInstance(); + } + } + /** + * + * + *
+     * Ad-hoc schema against which to validate
+     * 
+ * + * .google.pubsub.v1.Schema schema = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder> + getSchemaFieldBuilder() { + if (schemaBuilder_ == null) { + if (!(schemaSpecCase_ == 3)) { + schemaSpec_ = com.google.pubsub.v1.Schema.getDefaultInstance(); + } + schemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder>( + (com.google.pubsub.v1.Schema) schemaSpec_, getParentForChildren(), isClean()); + schemaSpec_ = null; + } + schemaSpecCase_ = 3; + onChanged(); + ; + return schemaBuilder_; + } + + private com.google.protobuf.ByteString message_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Message to validate against the provided `schema_spec`.
+     * 
+ * + * bytes message = 4; + * + * @return The message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessage() { + return message_; + } + /** + * + * + *
+     * Message to validate against the provided `schema_spec`.
+     * 
+ * + * bytes message = 4; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Message to validate against the provided `schema_spec`.
+     * 
+ * + * bytes message = 4; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + + private int encoding_ = 0; + /** + * + * + *
+     * The encoding expected for messages
+     * 
+ * + * .google.pubsub.v1.Encoding encoding = 5; + * + * @return The enum numeric value on the wire for encoding. + */ + @java.lang.Override + public int getEncodingValue() { + return encoding_; + } + /** + * + * + *
+     * The encoding expected for messages
+     * 
+ * + * .google.pubsub.v1.Encoding encoding = 5; + * + * @param value The enum numeric value on the wire for encoding to set. + * @return This builder for chaining. + */ + public Builder setEncodingValue(int value) { + + encoding_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The encoding expected for messages
+     * 
+ * + * .google.pubsub.v1.Encoding encoding = 5; + * + * @return The encoding. + */ + @java.lang.Override + public com.google.pubsub.v1.Encoding getEncoding() { + @SuppressWarnings("deprecation") + com.google.pubsub.v1.Encoding result = com.google.pubsub.v1.Encoding.valueOf(encoding_); + return result == null ? com.google.pubsub.v1.Encoding.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The encoding expected for messages
+     * 
+ * + * .google.pubsub.v1.Encoding encoding = 5; + * + * @param value The encoding to set. + * @return This builder for chaining. + */ + public Builder setEncoding(com.google.pubsub.v1.Encoding value) { + if (value == null) { + throw new NullPointerException(); + } + + encoding_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The encoding expected for messages
+     * 
+ * + * .google.pubsub.v1.Encoding encoding = 5; + * + * @return This builder for chaining. + */ + public Builder clearEncoding() { + + encoding_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ValidateMessageRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ValidateMessageRequest) + private static final com.google.pubsub.v1.ValidateMessageRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ValidateMessageRequest(); + } + + public static com.google.pubsub.v1.ValidateMessageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ValidateMessageRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ValidateMessageRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateMessageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequestOrBuilder.java new file mode 100644 index 000000000..7a33b7752 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequestOrBuilder.java @@ -0,0 +1,158 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface ValidateMessageRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ValidateMessageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project in which to validate schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the project in which to validate schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Name of the schema against which to validate.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the schema against which to validate.
+   * Format is `projects/{project}/schemas/{schema}`.
+   * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Ad-hoc schema against which to validate
+   * 
+ * + * .google.pubsub.v1.Schema schema = 3; + * + * @return Whether the schema field is set. + */ + boolean hasSchema(); + /** + * + * + *
+   * Ad-hoc schema against which to validate
+   * 
+ * + * .google.pubsub.v1.Schema schema = 3; + * + * @return The schema. + */ + com.google.pubsub.v1.Schema getSchema(); + /** + * + * + *
+   * Ad-hoc schema against which to validate
+   * 
+ * + * .google.pubsub.v1.Schema schema = 3; + */ + com.google.pubsub.v1.SchemaOrBuilder getSchemaOrBuilder(); + + /** + * + * + *
+   * Message to validate against the provided `schema_spec`.
+   * 
+ * + * bytes message = 4; + * + * @return The message. + */ + com.google.protobuf.ByteString getMessage(); + + /** + * + * + *
+   * The encoding expected for messages
+   * 
+ * + * .google.pubsub.v1.Encoding encoding = 5; + * + * @return The enum numeric value on the wire for encoding. + */ + int getEncodingValue(); + /** + * + * + *
+   * The encoding expected for messages
+   * 
+ * + * .google.pubsub.v1.Encoding encoding = 5; + * + * @return The encoding. + */ + com.google.pubsub.v1.Encoding getEncoding(); + + public com.google.pubsub.v1.ValidateMessageRequest.SchemaSpecCase getSchemaSpecCase(); +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageResponse.java new file mode 100644 index 000000000..1b5fd13b0 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageResponse.java @@ -0,0 +1,454 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Response for the `ValidateMessage` method.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.ValidateMessageResponse} + */ +public final class ValidateMessageResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ValidateMessageResponse) + ValidateMessageResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ValidateMessageResponse.newBuilder() to construct. + private ValidateMessageResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ValidateMessageResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ValidateMessageResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ValidateMessageResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateMessageResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateMessageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ValidateMessageResponse.class, + com.google.pubsub.v1.ValidateMessageResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.ValidateMessageResponse)) { + return super.equals(obj); + } + com.google.pubsub.v1.ValidateMessageResponse other = + (com.google.pubsub.v1.ValidateMessageResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateMessageResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.ValidateMessageResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ValidateMessage` method.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.ValidateMessageResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ValidateMessageResponse) + com.google.pubsub.v1.ValidateMessageResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateMessageResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateMessageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ValidateMessageResponse.class, + com.google.pubsub.v1.ValidateMessageResponse.Builder.class); + } + + // Construct using com.google.pubsub.v1.ValidateMessageResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateMessageResponse_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateMessageResponse getDefaultInstanceForType() { + return com.google.pubsub.v1.ValidateMessageResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateMessageResponse build() { + com.google.pubsub.v1.ValidateMessageResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateMessageResponse buildPartial() { + com.google.pubsub.v1.ValidateMessageResponse result = + new com.google.pubsub.v1.ValidateMessageResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ValidateMessageResponse) { + return mergeFrom((com.google.pubsub.v1.ValidateMessageResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ValidateMessageResponse other) { + if (other == com.google.pubsub.v1.ValidateMessageResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ValidateMessageResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ValidateMessageResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ValidateMessageResponse) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ValidateMessageResponse) + private static final com.google.pubsub.v1.ValidateMessageResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ValidateMessageResponse(); + } + + public static com.google.pubsub.v1.ValidateMessageResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ValidateMessageResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ValidateMessageResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateMessageResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageResponseOrBuilder.java new file mode 100644 index 000000000..e8be64dc7 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface ValidateMessageResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ValidateMessageResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequest.java new file mode 100644 index 000000000..631fca4ef --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequest.java @@ -0,0 +1,921 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Request for the `ValidateSchema` method.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.ValidateSchemaRequest} + */ +public final class ValidateSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ValidateSchemaRequest) + ValidateSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ValidateSchemaRequest.newBuilder() to construct. + private ValidateSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ValidateSchemaRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ValidateSchemaRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ValidateSchemaRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.pubsub.v1.Schema.Builder subBuilder = null; + if (schema_ != null) { + subBuilder = schema_.toBuilder(); + } + schema_ = input.readMessage(com.google.pubsub.v1.Schema.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(schema_); + schema_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ValidateSchemaRequest.class, + com.google.pubsub.v1.ValidateSchemaRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the project in which to validate schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the project in which to validate schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCHEMA_FIELD_NUMBER = 2; + private com.google.pubsub.v1.Schema schema_; + /** + * + * + *
+   * Required. The schema object to validate.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return schema_ != null; + } + /** + * + * + *
+   * Required. The schema object to validate.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schema. + */ + @java.lang.Override + public com.google.pubsub.v1.Schema getSchema() { + return schema_ == null ? com.google.pubsub.v1.Schema.getDefaultInstance() : schema_; + } + /** + * + * + *
+   * Required. The schema object to validate.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.pubsub.v1.SchemaOrBuilder getSchemaOrBuilder() { + return getSchema(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (schema_ != null) { + output.writeMessage(2, getSchema()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (schema_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSchema()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.ValidateSchemaRequest)) { + return super.equals(obj); + } + com.google.pubsub.v1.ValidateSchemaRequest other = + (com.google.pubsub.v1.ValidateSchemaRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasSchema() != other.hasSchema()) return false; + if (hasSchema()) { + if (!getSchema().equals(other.getSchema())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSchema()) { + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.ValidateSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ValidateSchema` method.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.ValidateSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ValidateSchemaRequest) + com.google.pubsub.v1.ValidateSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ValidateSchemaRequest.class, + com.google.pubsub.v1.ValidateSchemaRequest.Builder.class); + } + + // Construct using com.google.pubsub.v1.ValidateSchemaRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (schemaBuilder_ == null) { + schema_ = null; + } else { + schema_ = null; + schemaBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateSchemaRequest getDefaultInstanceForType() { + return com.google.pubsub.v1.ValidateSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateSchemaRequest build() { + com.google.pubsub.v1.ValidateSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateSchemaRequest buildPartial() { + com.google.pubsub.v1.ValidateSchemaRequest result = + new com.google.pubsub.v1.ValidateSchemaRequest(this); + result.parent_ = parent_; + if (schemaBuilder_ == null) { + result.schema_ = schema_; + } else { + result.schema_ = schemaBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ValidateSchemaRequest) { + return mergeFrom((com.google.pubsub.v1.ValidateSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ValidateSchemaRequest other) { + if (other == com.google.pubsub.v1.ValidateSchemaRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasSchema()) { + mergeSchema(other.getSchema()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ValidateSchemaRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ValidateSchemaRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the project in which to validate schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the project in which to validate schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the project in which to validate schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which to validate schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which to validate schemas.
+     * Format is `projects/{project-id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.pubsub.v1.Schema schema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder> + schemaBuilder_; + /** + * + * + *
+     * Required. The schema object to validate.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the schema field is set. + */ + public boolean hasSchema() { + return schemaBuilder_ != null || schema_ != null; + } + /** + * + * + *
+     * Required. The schema object to validate.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schema. + */ + public com.google.pubsub.v1.Schema getSchema() { + if (schemaBuilder_ == null) { + return schema_ == null ? com.google.pubsub.v1.Schema.getDefaultInstance() : schema_; + } else { + return schemaBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The schema object to validate.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSchema(com.google.pubsub.v1.Schema value) { + if (schemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schema_ = value; + onChanged(); + } else { + schemaBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The schema object to validate.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSchema(com.google.pubsub.v1.Schema.Builder builderForValue) { + if (schemaBuilder_ == null) { + schema_ = builderForValue.build(); + onChanged(); + } else { + schemaBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The schema object to validate.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeSchema(com.google.pubsub.v1.Schema value) { + if (schemaBuilder_ == null) { + if (schema_ != null) { + schema_ = com.google.pubsub.v1.Schema.newBuilder(schema_).mergeFrom(value).buildPartial(); + } else { + schema_ = value; + } + onChanged(); + } else { + schemaBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The schema object to validate.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearSchema() { + if (schemaBuilder_ == null) { + schema_ = null; + onChanged(); + } else { + schema_ = null; + schemaBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The schema object to validate.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.pubsub.v1.Schema.Builder getSchemaBuilder() { + + onChanged(); + return getSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The schema object to validate.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.pubsub.v1.SchemaOrBuilder getSchemaOrBuilder() { + if (schemaBuilder_ != null) { + return schemaBuilder_.getMessageOrBuilder(); + } else { + return schema_ == null ? com.google.pubsub.v1.Schema.getDefaultInstance() : schema_; + } + } + /** + * + * + *
+     * Required. The schema object to validate.
+     * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder> + getSchemaFieldBuilder() { + if (schemaBuilder_ == null) { + schemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.Schema, + com.google.pubsub.v1.Schema.Builder, + com.google.pubsub.v1.SchemaOrBuilder>( + getSchema(), getParentForChildren(), isClean()); + schema_ = null; + } + return schemaBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ValidateSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ValidateSchemaRequest) + private static final com.google.pubsub.v1.ValidateSchemaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ValidateSchemaRequest(); + } + + public static com.google.pubsub.v1.ValidateSchemaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ValidateSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ValidateSchemaRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateSchemaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequestOrBuilder.java new file mode 100644 index 000000000..2c972155f --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequestOrBuilder.java @@ -0,0 +1,91 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface ValidateSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ValidateSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project in which to validate schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the project in which to validate schemas.
+   * Format is `projects/{project-id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The schema object to validate.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the schema field is set. + */ + boolean hasSchema(); + /** + * + * + *
+   * Required. The schema object to validate.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schema. + */ + com.google.pubsub.v1.Schema getSchema(); + /** + * + * + *
+   * Required. The schema object to validate.
+   * 
+ * + * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.pubsub.v1.SchemaOrBuilder getSchemaOrBuilder(); +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaResponse.java new file mode 100644 index 000000000..2f8a70f0d --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaResponse.java @@ -0,0 +1,454 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +/** + * + * + *
+ * Response for the `ValidateSchema` method.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.ValidateSchemaResponse} + */ +public final class ValidateSchemaResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.ValidateSchemaResponse) + ValidateSchemaResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ValidateSchemaResponse.newBuilder() to construct. + private ValidateSchemaResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ValidateSchemaResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ValidateSchemaResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ValidateSchemaResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateSchemaResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateSchemaResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ValidateSchemaResponse.class, + com.google.pubsub.v1.ValidateSchemaResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.ValidateSchemaResponse)) { + return super.equals(obj); + } + com.google.pubsub.v1.ValidateSchemaResponse other = + (com.google.pubsub.v1.ValidateSchemaResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.ValidateSchemaResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ValidateSchema` method.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.ValidateSchemaResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ValidateSchemaResponse) + com.google.pubsub.v1.ValidateSchemaResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateSchemaResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateSchemaResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.ValidateSchemaResponse.class, + com.google.pubsub.v1.ValidateSchemaResponse.Builder.class); + } + + // Construct using com.google.pubsub.v1.ValidateSchemaResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.SchemaProto + .internal_static_google_pubsub_v1_ValidateSchemaResponse_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateSchemaResponse getDefaultInstanceForType() { + return com.google.pubsub.v1.ValidateSchemaResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateSchemaResponse build() { + com.google.pubsub.v1.ValidateSchemaResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateSchemaResponse buildPartial() { + com.google.pubsub.v1.ValidateSchemaResponse result = + new com.google.pubsub.v1.ValidateSchemaResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.ValidateSchemaResponse) { + return mergeFrom((com.google.pubsub.v1.ValidateSchemaResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.ValidateSchemaResponse other) { + if (other == com.google.pubsub.v1.ValidateSchemaResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.ValidateSchemaResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.ValidateSchemaResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.ValidateSchemaResponse) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.ValidateSchemaResponse) + private static final com.google.pubsub.v1.ValidateSchemaResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.ValidateSchemaResponse(); + } + + public static com.google.pubsub.v1.ValidateSchemaResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ValidateSchemaResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ValidateSchemaResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.ValidateSchemaResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaResponseOrBuilder.java new file mode 100644 index 000000000..9e8467fc1 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/schema.proto + +package com.google.pubsub.v1; + +public interface ValidateSchemaResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ValidateSchemaResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto b/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto index 909863eb9..9bc678e3a 100644 --- a/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto +++ b/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto @@ -24,6 +24,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; +import "google/pubsub/v1/schema.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.PubSub.V1"; @@ -42,8 +43,8 @@ service Publisher { "https://www.googleapis.com/auth/cloud-platform," "https://www.googleapis.com/auth/pubsub"; - // 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). rpc CreateTopic(Topic) returns (Topic) { option (google.api.http) = { put: "/v1/{name=projects/*/topics/*}" @@ -143,6 +144,21 @@ message MessageStoragePolicy { repeated string allowed_persistence_regions = 1; } +// Settings for validating messages published against a schema. +message SchemaSettings { + // Required. The name of the schema that messages published should be + // validated against. Format is `projects/{project}/schemas/{schema}`. The + // value of this field will be `_deleted-schema_` if the schema has been + // deleted. + string schema = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // The encoding of messages validated against `schema`. + Encoding encoding = 2; +} + // A topic resource. message Topic { option (google.api.resource) = { @@ -173,6 +189,15 @@ message Topic { // // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. string kms_key_name = 5; + + // Settings for validating messages published against a schema. + // + // EXPERIMENTAL: Schema support is in development and may not work yet. + SchemaSettings schema_settings = 6; + + // Reserved for future use. This field is set only in responses from the + // server; it is ignored if it is set in any requests. + bool satisfies_pzs = 7; } // A message that is published by publishers and consumed by subscribers. The @@ -587,8 +612,8 @@ service Subscriber { } // 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 + // 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 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 diff --git a/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/schema.proto b/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/schema.proto new file mode 100644 index 000000000..ae402ac4d --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/schema.proto @@ -0,0 +1,289 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.pubsub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.PubSub.V1"; +option go_package = "google.golang.org/genproto/googleapis/pubsub/v1;pubsub"; +option java_multiple_files = true; +option java_outer_classname = "SchemaProto"; +option java_package = "com.google.pubsub.v1"; +option php_namespace = "Google\\Cloud\\PubSub\\V1"; +option ruby_package = "Google::Cloud::PubSub::V1"; + +// Service for doing schema-related operations. +// +// EXPERIMENTAL: The Schema service is in development and may not work yet. + +service SchemaService { + option (google.api.default_host) = "pubsub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/pubsub"; + + // Creates a schema. + rpc CreateSchema(CreateSchemaRequest) returns (Schema) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/schemas" + body: "schema" + }; + option (google.api.method_signature) = "parent,schema,schema_id"; + } + + // Gets a schema. + rpc GetSchema(GetSchemaRequest) returns (Schema) { + option (google.api.http) = { + get: "/v1/{name=projects/*/schemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists schemas in a project. + rpc ListSchemas(ListSchemasRequest) returns (ListSchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/schemas" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a schema. + rpc DeleteSchema(DeleteSchemaRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/schemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Validates a schema. + rpc ValidateSchema(ValidateSchemaRequest) returns (ValidateSchemaResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/schemas:validate" + body: "*" + }; + option (google.api.method_signature) = "parent,schema"; + } + + // Validates a message against a schema. + rpc ValidateMessage(ValidateMessageRequest) + returns (ValidateMessageResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/schemas:validateMessage" + body: "*" + }; + } +} + +// A schema resource. +message Schema { + option (google.api.resource) = { + type: "pubsub.googleapis.com/Schema" + pattern: "projects/{project}/schemas/{schema}" + }; + + // Possible schema definition types. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // A Protocol Buffer schema definition. + PROTOCOL_BUFFER = 1; + + // An Avro schema definition. + AVRO = 2; + } + + // Required. Name of the schema. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The type of the schema definition. + Type type = 2; + + // The definition of the schema. This should contain a string representing + // the full definition of the schema that is a valid schema definition of + // the type specified in `type`. + string definition = 3; +} + +// Request for the CreateSchema method. +message CreateSchemaRequest { + // Required. The name of the project in which to create the schema. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "pubsub.googleapis.com/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`. + Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string schema_id = 3; +} + +// View of Schema object fields to be returned by GetSchema and ListSchemas. +enum SchemaView { + // The default / unset value. + // The API will default to the BASIC view. + SCHEMA_VIEW_UNSPECIFIED = 0; + + // Include the name and type of the schema, but not the definition. + BASIC = 1; + + // Include all Schema object fields. + FULL = 2; +} + +// Request for the GetSchema method. +message GetSchemaRequest { + // Required. The name of the schema to get. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // The set of fields to return in the response. If not set, returns a Schema + // with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all + // fields. + SchemaView view = 2; +} + +// Request for the `ListSchemas` method. +message ListSchemasRequest { + // Required. The name of the project in which to list schemas. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The set of Schema fields to return in the response. If not set, returns + // Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + // retrieve all fields. + SchemaView view = 2; + + // Maximum number of schemas to return. + int32 page_size = 3; + + // The value returned by the last `ListSchemasResponse`; indicates that + // this is a continuation of a prior `ListSchemas` call, and that the + // system should return the next page of data. + string page_token = 4; +} + +// Response for the `ListSchemas` method. +message ListSchemasResponse { + // The resulting schemas. + repeated Schema schemas = 1; + + // If not empty, indicates that there may be more schemas that match the + // request; this value should be passed in a new `ListSchemasRequest`. + string next_page_token = 2; +} + +// Request for the `DeleteSchema` method. +message DeleteSchemaRequest { + // Required. Name of the schema to delete. + // Format is `projects/{project}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; +} + +// Request for the `ValidateSchema` method. +message ValidateSchemaRequest { + // Required. The name of the project in which to validate schemas. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The schema object to validate. + Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the `ValidateSchema` method. +message ValidateSchemaResponse {} + +// Request for the `ValidateMessage` method. +message ValidateMessageRequest { + // Required. The name of the project in which to validate schemas. + // Format is `projects/{project-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + oneof schema_spec { + // Name of the schema against which to validate. + // + // Format is `projects/{project}/schemas/{schema}`. + string name = 2 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } + ]; + + // Ad-hoc schema against which to validate + Schema schema = 3; + } + + // Message to validate against the provided `schema_spec`. + bytes message = 4; + + // The encoding expected for messages + Encoding encoding = 5; +} + +// Response for the `ValidateMessage` method. +message ValidateMessageResponse {} + +// Possible encoding types for messages. +enum Encoding { + // Unspecified + ENCODING_UNSPECIFIED = 0; + + // JSON encoding + JSON = 1; + + // Binary encoding, as defined by the schema type. For some schema types, + // binary encoding may not be available. + BINARY = 2; +} diff --git a/synth.metadata b/synth.metadata index aeb41e663..e4bde75cb 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-pubsub.git", - "sha": "d30c26c008a1f642d89985b5cc42377547a782a9" + "sha": "4123f26f493638aa7b29667658e38556adcd491e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "706053bbfb3f16ef752e513c2898a1f26cdd8e41", - "internalRef": "323803770" + "sha": "41d8fbfec9d4bc4a8859f78185713950913b4bf3", + "internalRef": "348038736" } }, { @@ -100,6 +100,8 @@ "CONTRIBUTING.md", "LICENSE", "codecov.yaml", + "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceClient.java", + "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java", @@ -107,31 +109,43 @@ "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/package-info.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java", + "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java", + "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStub.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java", + "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java", + "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStub.java", "google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java", "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockIAMPolicy.java", "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java", "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisher.java", "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisherImpl.java", + "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSchemaService.java", + "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java", "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriber.java", "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriberImpl.java", + "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java", "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java", "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java", "google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminSmokeTest.java", "grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java", + "grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java", "grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java", "java.header", "license-checks.xml", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequestOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequest.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequest.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicy.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicyOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequest.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequest.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java", @@ -142,14 +156,21 @@ "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionResponse.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionResponseOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Encoding.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ExpirationPolicy.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ExpirationPolicyOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequest.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequest.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequest.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequestOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequest.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequestOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponse.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponseOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequest.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsResponse.java", @@ -196,6 +217,13 @@ "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicy.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicyOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Schema.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaName.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaProto.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettings.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettingsOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaView.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequest.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekResponse.java", @@ -217,7 +245,16 @@ "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSubscriptionRequestOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequest.java", "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequestOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequest.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequestOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageResponse.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageResponseOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequest.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequestOrBuilder.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaResponse.java", + "proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaResponseOrBuilder.java", "proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto", + "proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/schema.proto", "renovate.json", "samples/install-without-bom/pom.xml", "samples/pom.xml",