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 deleted file mode 100644 index ddc98a2f0..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceClient.java +++ /dev/null @@ -1,2046 +0,0 @@ -/* - * Copyright 2023 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.ApiFuture; -import com.google.api.core.ApiFutures; -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.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.CommitSchemaRequest; -import com.google.pubsub.v1.CreateSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRevisionRequest; -import com.google.pubsub.v1.GetSchemaRequest; -import com.google.pubsub.v1.ListSchemaRevisionsRequest; -import com.google.pubsub.v1.ListSchemaRevisionsResponse; -import com.google.pubsub.v1.ListSchemasRequest; -import com.google.pubsub.v1.ListSchemasResponse; -import com.google.pubsub.v1.ProjectName; -import com.google.pubsub.v1.RollbackSchemaRequest; -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 CLASS. -/** - * Service Description: Service for doing schema-related operations. - * - *

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

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
- *   ProjectName parent = ProjectName.of("[PROJECT]");
- *   Schema schema = Schema.newBuilder().build();
- *   String schemaId = "schemaId-697673060";
- *   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(). - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Methods
MethodDescriptionMethod Variants
CreateSchema

Creates a schema.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • createSchema(CreateSchemaRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • createSchema(ProjectName parent, Schema schema, String schemaId) - *
  • createSchema(String parent, Schema schema, String schemaId) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • createSchemaCallable() - *
- *
GetSchema

Gets a schema.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • getSchema(GetSchemaRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • getSchema(SchemaName name) - *
  • getSchema(String name) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • getSchemaCallable() - *
- *
ListSchemas

Lists schemas in a project.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • listSchemas(ListSchemasRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • listSchemas(ProjectName parent) - *
  • listSchemas(String parent) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • listSchemasPagedCallable() - *
  • listSchemasCallable() - *
- *
ListSchemaRevisions

Lists all schema revisions for the named schema.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • listSchemaRevisions(ListSchemaRevisionsRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • listSchemaRevisions(SchemaName name) - *
  • listSchemaRevisions(String name) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • listSchemaRevisionsPagedCallable() - *
  • listSchemaRevisionsCallable() - *
- *
CommitSchema

Commits a new schema revision to an existing schema.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • commitSchema(CommitSchemaRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • commitSchema(SchemaName name, Schema schema) - *
  • commitSchema(String name, Schema schema) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • commitSchemaCallable() - *
- *
RollbackSchema

Creates a new schema revision that is a copy of the provided revision_id.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • rollbackSchema(RollbackSchemaRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • rollbackSchema(SchemaName name, String revisionId) - *
  • rollbackSchema(String name, String revisionId) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • rollbackSchemaCallable() - *
- *
DeleteSchemaRevision

Deletes a specific schema revision.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • deleteSchemaRevision(DeleteSchemaRevisionRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • deleteSchemaRevision(SchemaName name, String revisionId) - *
  • deleteSchemaRevision(String name, String revisionId) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • deleteSchemaRevisionCallable() - *
- *
DeleteSchema

Deletes a schema.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • deleteSchema(DeleteSchemaRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • deleteSchema(SchemaName name) - *
  • deleteSchema(String name) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • deleteSchemaCallable() - *
- *
ValidateSchema

Validates a schema.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • validateSchema(ValidateSchemaRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • validateSchema(ProjectName parent, Schema schema) - *
  • validateSchema(String parent, Schema schema) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • validateSchemaCallable() - *
- *
ValidateMessage

Validates a message against a schema.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • validateMessage(ValidateMessageRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • validateMessageCallable() - *
- *
SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy. - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • setIamPolicy(SetIamPolicyRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • setIamPolicyCallable() - *
- *
GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • getIamPolicy(GetIamPolicyRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • getIamPolicyCallable() - *
- *
TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. - *

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • testIamPermissions(TestIamPermissionsRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • testIamPermissionsCallable() - *
- *
- * - *

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

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SchemaServiceSettings schemaServiceSettings =
- *     SchemaServiceSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SchemaServiceSettings schemaServiceSettings =
- *     SchemaServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings);
- * }
- * - *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SchemaServiceSettings schemaServiceSettings =
- *     SchemaServiceSettings.newHttpJsonBuilder().build();
- * SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@Generated("by gapic-generator-java") -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 using create(SchemaServiceSettings). - */ - 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(); - } - - protected SchemaServiceClient(SchemaServiceStub stub) { - this.settings = null; - this.stub = stub; - } - - public final SchemaServiceSettings getSettings() { - return settings; - } - - public SchemaServiceStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
-   *   Schema schema = Schema.newBuilder().build();
-   *   String schemaId = "schemaId-697673060";
-   *   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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   String parent = ProjectName.of("[PROJECT]").toString();
-   *   Schema schema = Schema.newBuilder().build();
-   *   String schemaId = "schemaId-697673060";
-   *   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(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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   CreateSchemaRequest request =
-   *       CreateSchemaRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setSchema(Schema.newBuilder().build())
-   *           .setSchemaId("schemaId-697673060")
-   *           .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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   CreateSchemaRequest request =
-   *       CreateSchemaRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setSchema(Schema.newBuilder().build())
-   *           .setSchemaId("schemaId-697673060")
-   *           .build();
-   *   ApiFuture 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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
-   *   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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
-   *   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(String name) { - GetSchemaRequest request = GetSchemaRequest.newBuilder().setName(name).build(); - return getSchema(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets a schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   GetSchemaRequest request =
-   *       GetSchemaRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setView(SchemaView.forNumber(0))
-   *           .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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   GetSchemaRequest request =
-   *       GetSchemaRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setView(SchemaView.forNumber(0))
-   *           .build();
-   *   ApiFuture 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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   String parent = ProjectName.of("[PROJECT]").toString();
-   *   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(String parent) { - ListSchemasRequest request = ListSchemasRequest.newBuilder().setParent(parent).build(); - return listSchemas(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists schemas in a project. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ListSchemasRequest request =
-   *       ListSchemasRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setView(SchemaView.forNumber(0))
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ListSchemasRequest request =
-   *       ListSchemasRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setView(SchemaView.forNumber(0))
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture 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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ListSchemasRequest request =
-   *       ListSchemasRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setView(SchemaView.forNumber(0))
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .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. - /** - * Lists all schema revisions for the named schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
-   *   for (Schema element : schemaServiceClient.listSchemaRevisions(name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param name Required. The name of the schema to list revisions for. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListSchemaRevisionsPagedResponse listSchemaRevisions(SchemaName name) { - ListSchemaRevisionsRequest request = - ListSchemaRevisionsRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return listSchemaRevisions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all schema revisions for the named schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
-   *   for (Schema element : schemaServiceClient.listSchemaRevisions(name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param name Required. The name of the schema to list revisions for. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListSchemaRevisionsPagedResponse listSchemaRevisions(String name) { - ListSchemaRevisionsRequest request = - ListSchemaRevisionsRequest.newBuilder().setName(name).build(); - return listSchemaRevisions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all schema revisions for the named schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ListSchemaRevisionsRequest request =
-   *       ListSchemaRevisionsRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setView(SchemaView.forNumber(0))
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Schema element : schemaServiceClient.listSchemaRevisions(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 ListSchemaRevisionsPagedResponse listSchemaRevisions( - ListSchemaRevisionsRequest request) { - return listSchemaRevisionsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all schema revisions for the named schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ListSchemaRevisionsRequest request =
-   *       ListSchemaRevisionsRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setView(SchemaView.forNumber(0))
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       schemaServiceClient.listSchemaRevisionsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Schema element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listSchemaRevisionsPagedCallable() { - return stub.listSchemaRevisionsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all schema revisions for the named schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ListSchemaRevisionsRequest request =
-   *       ListSchemaRevisionsRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setView(SchemaView.forNumber(0))
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListSchemaRevisionsResponse response =
-   *         schemaServiceClient.listSchemaRevisionsCallable().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 - listSchemaRevisionsCallable() { - return stub.listSchemaRevisionsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Commits a new schema revision to an existing schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
-   *   Schema schema = Schema.newBuilder().build();
-   *   Schema response = schemaServiceClient.commitSchema(name, schema);
-   * }
-   * }
- * - * @param name Required. The name of the schema we are revising. Format is - * `projects/{project}/schemas/{schema}`. - * @param schema Required. The schema revision to commit. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Schema commitSchema(SchemaName name, Schema schema) { - CommitSchemaRequest request = - CommitSchemaRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setSchema(schema) - .build(); - return commitSchema(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Commits a new schema revision to an existing schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
-   *   Schema schema = Schema.newBuilder().build();
-   *   Schema response = schemaServiceClient.commitSchema(name, schema);
-   * }
-   * }
- * - * @param name Required. The name of the schema we are revising. Format is - * `projects/{project}/schemas/{schema}`. - * @param schema Required. The schema revision to commit. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Schema commitSchema(String name, Schema schema) { - CommitSchemaRequest request = - CommitSchemaRequest.newBuilder().setName(name).setSchema(schema).build(); - return commitSchema(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Commits a new schema revision to an existing schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   CommitSchemaRequest request =
-   *       CommitSchemaRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setSchema(Schema.newBuilder().build())
-   *           .build();
-   *   Schema response = schemaServiceClient.commitSchema(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 commitSchema(CommitSchemaRequest request) { - return commitSchemaCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Commits a new schema revision to an existing schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   CommitSchemaRequest request =
-   *       CommitSchemaRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setSchema(Schema.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = schemaServiceClient.commitSchemaCallable().futureCall(request);
-   *   // Do something.
-   *   Schema response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable commitSchemaCallable() { - return stub.commitSchemaCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new schema revision that is a copy of the provided revision_id. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
-   *   String revisionId = "revisionId-1507445162";
-   *   Schema response = schemaServiceClient.rollbackSchema(name, revisionId);
-   * }
-   * }
- * - * @param name Required. The schema being rolled back with revision id. - * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same - * schema. - *

Example: c7cfa2a8 - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Schema rollbackSchema(SchemaName name, String revisionId) { - RollbackSchemaRequest request = - RollbackSchemaRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setRevisionId(revisionId) - .build(); - return rollbackSchema(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new schema revision that is a copy of the provided revision_id. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
-   *   String revisionId = "revisionId-1507445162";
-   *   Schema response = schemaServiceClient.rollbackSchema(name, revisionId);
-   * }
-   * }
- * - * @param name Required. The schema being rolled back with revision id. - * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same - * schema. - *

Example: c7cfa2a8 - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Schema rollbackSchema(String name, String revisionId) { - RollbackSchemaRequest request = - RollbackSchemaRequest.newBuilder().setName(name).setRevisionId(revisionId).build(); - return rollbackSchema(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new schema revision that is a copy of the provided revision_id. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   RollbackSchemaRequest request =
-   *       RollbackSchemaRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setRevisionId("revisionId-1507445162")
-   *           .build();
-   *   Schema response = schemaServiceClient.rollbackSchema(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Schema rollbackSchema(RollbackSchemaRequest request) { - return rollbackSchemaCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new schema revision that is a copy of the provided revision_id. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   RollbackSchemaRequest request =
-   *       RollbackSchemaRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setRevisionId("revisionId-1507445162")
-   *           .build();
-   *   ApiFuture future = schemaServiceClient.rollbackSchemaCallable().futureCall(request);
-   *   // Do something.
-   *   Schema response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable rollbackSchemaCallable() { - return stub.rollbackSchemaCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a specific schema revision. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
-   *   String revisionId = "revisionId-1507445162";
-   *   Schema response = schemaServiceClient.deleteSchemaRevision(name, revisionId);
-   * }
-   * }
- * - * @param name Required. The name of the schema revision to be deleted, with a revision ID - * explicitly included. - *

Example: `projects/123/schemas/my-schema{@literal @}c7cfa2a8` - * @param revisionId Optional. This field is deprecated and should not be used for specifying the - * revision ID. The revision ID should be specified via the `name` parameter. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Schema deleteSchemaRevision(SchemaName name, String revisionId) { - DeleteSchemaRevisionRequest request = - DeleteSchemaRevisionRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setRevisionId(revisionId) - .build(); - return deleteSchemaRevision(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a specific schema revision. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
-   *   String revisionId = "revisionId-1507445162";
-   *   Schema response = schemaServiceClient.deleteSchemaRevision(name, revisionId);
-   * }
-   * }
- * - * @param name Required. The name of the schema revision to be deleted, with a revision ID - * explicitly included. - *

Example: `projects/123/schemas/my-schema{@literal @}c7cfa2a8` - * @param revisionId Optional. This field is deprecated and should not be used for specifying the - * revision ID. The revision ID should be specified via the `name` parameter. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Schema deleteSchemaRevision(String name, String revisionId) { - DeleteSchemaRevisionRequest request = - DeleteSchemaRevisionRequest.newBuilder().setName(name).setRevisionId(revisionId).build(); - return deleteSchemaRevision(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a specific schema revision. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   DeleteSchemaRevisionRequest request =
-   *       DeleteSchemaRevisionRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setRevisionId("revisionId-1507445162")
-   *           .build();
-   *   Schema response = schemaServiceClient.deleteSchemaRevision(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Schema deleteSchemaRevision(DeleteSchemaRevisionRequest request) { - return deleteSchemaRevisionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a specific schema revision. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   DeleteSchemaRevisionRequest request =
-   *       DeleteSchemaRevisionRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setRevisionId("revisionId-1507445162")
-   *           .build();
-   *   ApiFuture future =
-   *       schemaServiceClient.deleteSchemaRevisionCallable().futureCall(request);
-   *   // Do something.
-   *   Schema response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteSchemaRevisionCallable() { - return stub.deleteSchemaRevisionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
-   *   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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
-   *   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(String name) { - DeleteSchemaRequest request = DeleteSchemaRequest.newBuilder().setName(name).build(); - deleteSchema(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a schema. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   DeleteSchemaRequest request =
-   *       DeleteSchemaRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   DeleteSchemaRequest request =
-   *       DeleteSchemaRequest.newBuilder()
-   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .build();
-   *   ApiFuture 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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   String parent = ProjectName.of("[PROJECT]").toString();
-   *   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(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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ValidateSchemaRequest request =
-   *       ValidateSchemaRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setSchema(Schema.newBuilder().build())
-   *           .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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ValidateSchemaRequest request =
-   *       ValidateSchemaRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setSchema(Schema.newBuilder().build())
-   *           .build();
-   *   ApiFuture 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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ValidateMessageRequest request =
-   *       ValidateMessageRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setMessage(ByteString.EMPTY)
-   *           .setEncoding(Encoding.forNumber(0))
-   *           .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: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   ValidateMessageRequest request =
-   *       ValidateMessageRequest.newBuilder()
-   *           .setParent(ProjectName.of("[PROJECT]").toString())
-   *           .setMessage(ByteString.EMPTY)
-   *           .setEncoding(Encoding.forNumber(0))
-   *           .build();
-   *   ApiFuture future =
-   *       schemaServiceClient.validateMessageCallable().futureCall(request);
-   *   // Do something.
-   *   ValidateMessageResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - validateMessageCallable() { - return stub.validateMessageCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Sets the access control policy on the specified resource. Replacesany existing policy. - * - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Policy response = schemaServiceClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) { - return setIamPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Sets the access control policy on the specified resource. Replacesany existing policy. - * - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = schemaServiceClient.setIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable setIamPolicyCallable() { - return stub.setIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the access control policy for a resource. Returns an empty policyif the resource exists - * and does not have a policy set. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   Policy response = schemaServiceClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) { - return getIamPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the access control policy for a resource. Returns an empty policyif the resource exists - * and does not have a policy set. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = schemaServiceClient.getIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getIamPolicyCallable() { - return stub.getIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns permissions that a caller has on the specified resource. If theresource does not exist, - * this will return an empty set ofpermissions, not a `NOT_FOUND` error. - * - *

Note: This operation is designed to be used for buildingpermission-aware UIs and - * command-line tools, not for authorizationchecking. This operation may "fail open" without - * warning. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   TestIamPermissionsResponse response = schemaServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { - return testIamPermissionsCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns permissions that a caller has on the specified resource. If theresource does not exist, - * this will return an empty set ofpermissions, not a `NOT_FOUND` error. - * - *

Note: This operation is designed to be used for buildingpermission-aware UIs and - * command-line tools, not for authorizationchecking. This operation may "fail open" without - * warning. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   ApiFuture future =
-   *       schemaServiceClient.testIamPermissionsCallable().futureCall(request);
-   *   // Do something.
-   *   TestIamPermissionsResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - testIamPermissionsCallable() { - return stub.testIamPermissionsCallable(); - } - - @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, input -> 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); - } - } - - public static class ListSchemaRevisionsPagedResponse - extends AbstractPagedListResponse< - ListSchemaRevisionsRequest, - ListSchemaRevisionsResponse, - Schema, - ListSchemaRevisionsPage, - ListSchemaRevisionsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListSchemaRevisionsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListSchemaRevisionsPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListSchemaRevisionsPagedResponse(ListSchemaRevisionsPage page) { - super(page, ListSchemaRevisionsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListSchemaRevisionsPage - extends AbstractPage< - ListSchemaRevisionsRequest, - ListSchemaRevisionsResponse, - Schema, - ListSchemaRevisionsPage> { - - private ListSchemaRevisionsPage( - PageContext context, - ListSchemaRevisionsResponse response) { - super(context, response); - } - - private static ListSchemaRevisionsPage createEmptyPage() { - return new ListSchemaRevisionsPage(null, null); - } - - @Override - protected ListSchemaRevisionsPage createPage( - PageContext context, - ListSchemaRevisionsResponse response) { - return new ListSchemaRevisionsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListSchemaRevisionsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListSchemaRevisionsRequest, - ListSchemaRevisionsResponse, - Schema, - ListSchemaRevisionsPage, - ListSchemaRevisionsFixedSizeCollection> { - - private ListSchemaRevisionsFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListSchemaRevisionsFixedSizeCollection createEmptyCollection() { - return new ListSchemaRevisionsFixedSizeCollection(null, 0); - } - - @Override - protected ListSchemaRevisionsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListSchemaRevisionsFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java deleted file mode 100644 index 67d08bb63..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright 2023 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.ListSchemaRevisionsPagedResponse; -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.httpjson.InstantiatingHttpJsonChannelProvider; -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.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.CommitSchemaRequest; -import com.google.pubsub.v1.CreateSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRevisionRequest; -import com.google.pubsub.v1.GetSchemaRequest; -import com.google.pubsub.v1.ListSchemaRevisionsRequest; -import com.google.pubsub.v1.ListSchemaRevisionsResponse; -import com.google.pubsub.v1.ListSchemasRequest; -import com.google.pubsub.v1.ListSchemasResponse; -import com.google.pubsub.v1.RollbackSchemaRequest; -import com.google.pubsub.v1.Schema; -import com.google.pubsub.v1.ValidateMessageRequest; -import com.google.pubsub.v1.ValidateMessageResponse; -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: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * 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-java") -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 listSchemaRevisions. */ - public PagedCallSettings< - ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> - listSchemaRevisionsSettings() { - return ((SchemaServiceStubSettings) getStubSettings()).listSchemaRevisionsSettings(); - } - - /** Returns the object with the settings used for calls to commitSchema. */ - public UnaryCallSettings commitSchemaSettings() { - return ((SchemaServiceStubSettings) getStubSettings()).commitSchemaSettings(); - } - - /** Returns the object with the settings used for calls to rollbackSchema. */ - public UnaryCallSettings rollbackSchemaSettings() { - return ((SchemaServiceStubSettings) getStubSettings()).rollbackSchemaSettings(); - } - - /** Returns the object with the settings used for calls to deleteSchemaRevision. */ - public UnaryCallSettings deleteSchemaRevisionSettings() { - return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaRevisionSettings(); - } - - /** Returns the object with the settings used for calls to deleteSchema. */ - public UnaryCallSettings deleteSchemaSettings() { - return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaSettings(); - } - - /** 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(); - } - - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return ((SchemaServiceStubSettings) getStubSettings()).setIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return ((SchemaServiceStubSettings) getStubSettings()).getIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return ((SchemaServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); - } - - 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 gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return SchemaServiceStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return SchemaServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - 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 gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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)); - } - - protected Builder(SchemaServiceSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(SchemaServiceStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(SchemaServiceStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(SchemaServiceStubSettings.newHttpJsonBuilder()); - } - - public SchemaServiceStubSettings.Builder getStubSettingsBuilder() { - return ((SchemaServiceStubSettings.Builder) getStubSettings()); - } - - /** - * 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) { - 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 listSchemaRevisions. */ - public PagedCallSettings.Builder< - ListSchemaRevisionsRequest, - ListSchemaRevisionsResponse, - ListSchemaRevisionsPagedResponse> - listSchemaRevisionsSettings() { - return getStubSettingsBuilder().listSchemaRevisionsSettings(); - } - - /** Returns the builder for the settings used for calls to commitSchema. */ - public UnaryCallSettings.Builder commitSchemaSettings() { - return getStubSettingsBuilder().commitSchemaSettings(); - } - - /** Returns the builder for the settings used for calls to rollbackSchema. */ - public UnaryCallSettings.Builder rollbackSchemaSettings() { - return getStubSettingsBuilder().rollbackSchemaSettings(); - } - - /** Returns the builder for the settings used for calls to deleteSchemaRevision. */ - public UnaryCallSettings.Builder - deleteSchemaRevisionSettings() { - return getStubSettingsBuilder().deleteSchemaRevisionSettings(); - } - - /** Returns the builder for the settings used for calls to deleteSchema. */ - public UnaryCallSettings.Builder deleteSchemaSettings() { - return getStubSettingsBuilder().deleteSchemaSettings(); - } - - /** 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(); - } - - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return getStubSettingsBuilder().setIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getStubSettingsBuilder().getIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return getStubSettingsBuilder().testIamPermissionsSettings(); - } - - @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 deleted file mode 100644 index e7617298c..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java +++ /dev/null @@ -1,4184 +0,0 @@ -/* - * Copyright 2023 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.ApiFuture; -import com.google.api.core.ApiFutures; -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.BidiStreamingCallable; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.pubsub.v1.stub.SubscriberStub; -import com.google.cloud.pubsub.v1.stub.SubscriberStubSettings; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.pubsub.v1.AcknowledgeRequest; -import com.google.pubsub.v1.CreateSnapshotRequest; -import com.google.pubsub.v1.DeleteSnapshotRequest; -import com.google.pubsub.v1.DeleteSubscriptionRequest; -import com.google.pubsub.v1.GetSnapshotRequest; -import com.google.pubsub.v1.GetSubscriptionRequest; -import com.google.pubsub.v1.ListSnapshotsRequest; -import com.google.pubsub.v1.ListSnapshotsResponse; -import com.google.pubsub.v1.ListSubscriptionsRequest; -import com.google.pubsub.v1.ListSubscriptionsResponse; -import com.google.pubsub.v1.ModifyAckDeadlineRequest; -import com.google.pubsub.v1.ModifyPushConfigRequest; -import com.google.pubsub.v1.ProjectName; -import com.google.pubsub.v1.ProjectSnapshotName; -import com.google.pubsub.v1.ProjectSubscriptionName; -import com.google.pubsub.v1.ProjectTopicName; -import com.google.pubsub.v1.PullRequest; -import com.google.pubsub.v1.PullResponse; -import com.google.pubsub.v1.PushConfig; -import com.google.pubsub.v1.SeekRequest; -import com.google.pubsub.v1.SeekResponse; -import com.google.pubsub.v1.Snapshot; -import com.google.pubsub.v1.SnapshotName; -import com.google.pubsub.v1.StreamingPullRequest; -import com.google.pubsub.v1.StreamingPullResponse; -import com.google.pubsub.v1.Subscription; -import com.google.pubsub.v1.SubscriptionName; -import com.google.pubsub.v1.TopicName; -import com.google.pubsub.v1.UpdateSnapshotRequest; -import com.google.pubsub.v1.UpdateSubscriptionRequest; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: The service that an application uses to manipulate subscriptions and to - * consume messages from a subscription via the `Pull` method or by establishing a bi-directional - * stream using the `StreamingPull` method. - * - *

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

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- *   SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
- *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
- *   PushConfig pushConfig = PushConfig.newBuilder().build();
- *   int ackDeadlineSeconds = 2135351438;
- *   Subscription response =
- *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
- * }
- * }
- * - *

Note: close() needs to be called on the SubscriptionAdminClient object to clean up resources - * such as threads. In the example above, try-with-resources is used, which automatically calls - * close(). - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Methods
MethodDescriptionMethod Variants
CreateSubscription

Creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. - *

If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • createSubscription(Subscription request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • createSubscription(SubscriptionName name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds) - *
  • createSubscription(SubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) - *
  • createSubscription(String name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds) - *
  • createSubscription(String name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • createSubscriptionCallable() - *
- *
GetSubscription

Gets the configuration details of a subscription.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • getSubscription(GetSubscriptionRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • getSubscription(SubscriptionName subscription) - *
  • getSubscription(String subscription) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • getSubscriptionCallable() - *
- *
UpdateSubscription

Updates an existing subscription. Note that certain properties of a subscription, such as its topic, are not modifiable.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • updateSubscription(UpdateSubscriptionRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • updateSubscription(Subscription subscription, FieldMask updateMask) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • updateSubscriptionCallable() - *
- *
ListSubscriptions

Lists matching subscriptions.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • listSubscriptions(ListSubscriptionsRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • listSubscriptions(ProjectName project) - *
  • listSubscriptions(String project) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • listSubscriptionsPagedCallable() - *
  • listSubscriptionsCallable() - *
- *
DeleteSubscription

Deletes an existing subscription. All messages retained in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription or its topic unless the same topic is specified.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • deleteSubscription(DeleteSubscriptionRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • deleteSubscription(SubscriptionName subscription) - *
  • deleteSubscription(String subscription) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • deleteSubscriptionCallable() - *
- *
ModifyAckDeadline

Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted. Note that this does not modify the subscription-level `ackDeadlineSeconds` used for subsequent messages.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • modifyAckDeadline(ModifyAckDeadlineRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • modifyAckDeadline(SubscriptionName subscription, List<String> ackIds, int ackDeadlineSeconds) - *
  • modifyAckDeadline(String subscription, List<String> ackIds, int ackDeadlineSeconds) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • modifyAckDeadlineCallable() - *
- *
Acknowledge

Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from the subscription. - *

Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • acknowledge(AcknowledgeRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • acknowledge(SubscriptionName subscription, List<String> ackIds) - *
  • acknowledge(String subscription, List<String> ackIds) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • acknowledgeCallable() - *
- *
Pull

Pulls messages from the server.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • pull(PullRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • pull(SubscriptionName subscription, int maxMessages) - *
  • pull(String subscription, int maxMessages) - *
  • pull(SubscriptionName subscription, boolean returnImmediately, int maxMessages) - *
  • pull(String subscription, boolean returnImmediately, int maxMessages) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • pullCallable() - *
- *
StreamingPull

Establishes a stream with the server, which sends messages down to the client. The client streams acknowledgements and ack deadline modifications back to the server. The server will close the stream and return the status on any error. The server may close the stream with status `UNAVAILABLE` to reassign server-side resources, in which case, the client should re-establish the stream. Flow control can be achieved by configuring the underlying RPC channel.

- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • streamingPullCallable() - *
- *
ModifyPushConfig

Modifies the `PushConfig` for a specified subscription. - *

This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • modifyPushConfig(ModifyPushConfigRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • modifyPushConfig(SubscriptionName subscription, PushConfig pushConfig) - *
  • modifyPushConfig(String subscription, PushConfig pushConfig) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • modifyPushConfigCallable() - *
- *
GetSnapshot

Gets the configuration details of a snapshot. 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.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • getSnapshot(GetSnapshotRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • getSnapshot(SnapshotName snapshot) - *
  • getSnapshot(String snapshot) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • getSnapshotCallable() - *
- *
ListSnapshots

Lists the existing snapshots. 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.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • listSnapshots(ListSnapshotsRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • listSnapshots(ProjectName project) - *
  • listSnapshots(String project) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • listSnapshotsPagedCallable() - *
  • listSnapshotsCallable() - *
- *
CreateSnapshot

Creates a snapshot from the requested subscription. 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. If the snapshot already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the `Snapshot.expire_time` field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • createSnapshot(CreateSnapshotRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • createSnapshot(SnapshotName name, SubscriptionName subscription) - *
  • createSnapshot(SnapshotName name, String subscription) - *
  • createSnapshot(String name, SubscriptionName subscription) - *
  • createSnapshot(String name, String subscription) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • createSnapshotCallable() - *
- *
UpdateSnapshot

Updates an existing snapshot. 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.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • updateSnapshot(UpdateSnapshotRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • updateSnapshot(Snapshot snapshot, FieldMask updateMask) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • updateSnapshotCallable() - *
- *
DeleteSnapshot

Removes an existing snapshot. 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. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • deleteSnapshot(DeleteSnapshotRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • deleteSnapshot(SnapshotName snapshot) - *
  • deleteSnapshot(String snapshot) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • deleteSnapshotCallable() - *
- *
Seek

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 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.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • seek(SeekRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • seekCallable() - *
- *
SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy. - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • setIamPolicy(SetIamPolicyRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • setIamPolicyCallable() - *
- *
GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • getIamPolicy(GetIamPolicyRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • getIamPolicyCallable() - *
- *
TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. - *

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • testIamPermissions(TestIamPermissionsRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • testIamPermissionsCallable() - *
- *
- * - *

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 SubscriptionAdminSettings to - * create(). For example: - * - *

To customize credentials: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SubscriptionAdminSettings subscriptionAdminSettings =
- *     SubscriptionAdminSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * SubscriptionAdminClient subscriptionAdminClient =
- *     SubscriptionAdminClient.create(subscriptionAdminSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SubscriptionAdminSettings subscriptionAdminSettings =
- *     SubscriptionAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
- * SubscriptionAdminClient subscriptionAdminClient =
- *     SubscriptionAdminClient.create(subscriptionAdminSettings);
- * }
- * - *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SubscriptionAdminSettings subscriptionAdminSettings =
- *     SubscriptionAdminSettings.newHttpJsonBuilder().build();
- * SubscriptionAdminClient subscriptionAdminClient =
- *     SubscriptionAdminClient.create(subscriptionAdminSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@Generated("by gapic-generator-java") -public class SubscriptionAdminClient implements BackgroundResource { - private final SubscriptionAdminSettings settings; - private final SubscriberStub stub; - - /** Constructs an instance of SubscriptionAdminClient with default settings. */ - public static final SubscriptionAdminClient create() throws IOException { - return create(SubscriptionAdminSettings.newBuilder().build()); - } - - /** - * Constructs an instance of SubscriptionAdminClient, 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 SubscriptionAdminClient create(SubscriptionAdminSettings settings) - throws IOException { - return new SubscriptionAdminClient(settings); - } - - /** - * Constructs an instance of SubscriptionAdminClient, using the given stub for making calls. This - * is for advanced usage - prefer using create(SubscriptionAdminSettings). - */ - public static final SubscriptionAdminClient create(SubscriberStub stub) { - return new SubscriptionAdminClient(stub); - } - - /** - * Constructs an instance of SubscriptionAdminClient, 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 SubscriptionAdminClient(SubscriptionAdminSettings settings) throws IOException { - this.settings = settings; - this.stub = ((SubscriberStubSettings) settings.getStubSettings()).createStub(); - } - - protected SubscriptionAdminClient(SubscriberStub stub) { - this.settings = null; - this.stub = stub; - } - - public final SubscriptionAdminSettings getSettings() { - return settings; - } - - public SubscriberStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a subscription to a given topic. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). If the subscription - * already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns - * `NOT_FOUND`. - * - *

If the name is not provided in the request, the server will assign a random name for this - * subscription on the same project as the topic, conforming to the [resource name format] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is - * populated in the returned Subscription object. Note that for REST API requests, you must - * specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
-   *   PushConfig pushConfig = PushConfig.newBuilder().build();
-   *   int ackDeadlineSeconds = 2135351438;
-   *   Subscription response =
-   *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
-   * }
-   * }
- * - * @param name Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a - * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores - * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 - * and 255 characters in length, and it must not start with `"goog"`. - * @param topic Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be - * `_deleted-topic_` if the topic has been deleted. - * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. - * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits - * for the subscriber to acknowledge receipt before resending the message. In the interval - * after the message is delivered and before it is acknowledged, it is considered to be - * _outstanding_. During that time period, the message will not be redelivered (on a - * best-effort basis). - *

For pull subscriptions, this value is used as the initial value for the ack deadline. To - * override this value for a given message, call `ModifyAckDeadline` with the corresponding - * `ack_id` if using non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline - * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds - * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. - *

For push delivery, this value is also used to set the request timeout for the call to - * the push endpoint. - *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually - * redeliver the message. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Subscription createSubscription( - SubscriptionName name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds) { - Subscription request = - Subscription.newBuilder() - .setName(name == null ? null : name.toString()) - .setTopic(topic == null ? null : topic.toString()) - .setPushConfig(pushConfig) - .setAckDeadlineSeconds(ackDeadlineSeconds) - .build(); - return createSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a subscription to a given topic. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). If the subscription - * already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns - * `NOT_FOUND`. - * - *

If the name is not provided in the request, the server will assign a random name for this - * subscription on the same project as the topic, conforming to the [resource name format] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is - * populated in the returned Subscription object. Note that for REST API requests, you must - * specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
-   *   PushConfig pushConfig = PushConfig.newBuilder().build();
-   *   int ackDeadlineSeconds = 2135351438;
-   *   Subscription response =
-   *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
-   * }
-   * }
- * - * @param name Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a - * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores - * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 - * and 255 characters in length, and it must not start with `"goog"`. - * @param topic Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be - * `_deleted-topic_` if the topic has been deleted. - * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. - * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits - * for the subscriber to acknowledge receipt before resending the message. In the interval - * after the message is delivered and before it is acknowledged, it is considered to be - * _outstanding_. During that time period, the message will not be redelivered (on a - * best-effort basis). - *

For pull subscriptions, this value is used as the initial value for the ack deadline. To - * override this value for a given message, call `ModifyAckDeadline` with the corresponding - * `ack_id` if using non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline - * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds - * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. - *

For push delivery, this value is also used to set the request timeout for the call to - * the push endpoint. - *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually - * redeliver the message. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Subscription createSubscription( - SubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) { - Subscription request = - Subscription.newBuilder() - .setName(name == null ? null : name.toString()) - .setTopic(topic) - .setPushConfig(pushConfig) - .setAckDeadlineSeconds(ackDeadlineSeconds) - .build(); - return createSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a subscription to a given topic. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). If the subscription - * already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns - * `NOT_FOUND`. - * - *

If the name is not provided in the request, the server will assign a random name for this - * subscription on the same project as the topic, conforming to the [resource name format] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is - * populated in the returned Subscription object. Note that for REST API requests, you must - * specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
-   *   PushConfig pushConfig = PushConfig.newBuilder().build();
-   *   int ackDeadlineSeconds = 2135351438;
-   *   Subscription response =
-   *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
-   * }
-   * }
- * - * @param name Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a - * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores - * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 - * and 255 characters in length, and it must not start with `"goog"`. - * @param topic Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be - * `_deleted-topic_` if the topic has been deleted. - * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. - * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits - * for the subscriber to acknowledge receipt before resending the message. In the interval - * after the message is delivered and before it is acknowledged, it is considered to be - * _outstanding_. During that time period, the message will not be redelivered (on a - * best-effort basis). - *

For pull subscriptions, this value is used as the initial value for the ack deadline. To - * override this value for a given message, call `ModifyAckDeadline` with the corresponding - * `ack_id` if using non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline - * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds - * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. - *

For push delivery, this value is also used to set the request timeout for the call to - * the push endpoint. - *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually - * redeliver the message. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Subscription createSubscription( - String name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds) { - Subscription request = - Subscription.newBuilder() - .setName(name) - .setTopic(topic == null ? null : topic.toString()) - .setPushConfig(pushConfig) - .setAckDeadlineSeconds(ackDeadlineSeconds) - .build(); - return createSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a subscription to a given topic. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). If the subscription - * already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns - * `NOT_FOUND`. - * - *

If the name is not provided in the request, the server will assign a random name for this - * subscription on the same project as the topic, conforming to the [resource name format] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is - * populated in the returned Subscription object. Note that for REST API requests, you must - * specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
-   *   PushConfig pushConfig = PushConfig.newBuilder().build();
-   *   int ackDeadlineSeconds = 2135351438;
-   *   Subscription response =
-   *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
-   * }
-   * }
- * - * @param name Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a - * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores - * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 - * and 255 characters in length, and it must not start with `"goog"`. - * @param topic Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be - * `_deleted-topic_` if the topic has been deleted. - * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. - * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits - * for the subscriber to acknowledge receipt before resending the message. In the interval - * after the message is delivered and before it is acknowledged, it is considered to be - * _outstanding_. During that time period, the message will not be redelivered (on a - * best-effort basis). - *

For pull subscriptions, this value is used as the initial value for the ack deadline. To - * override this value for a given message, call `ModifyAckDeadline` with the corresponding - * `ack_id` if using non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline - * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds - * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. - *

For push delivery, this value is also used to set the request timeout for the call to - * the push endpoint. - *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually - * redeliver the message. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Subscription createSubscription( - String name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) { - Subscription request = - Subscription.newBuilder() - .setName(name) - .setTopic(topic) - .setPushConfig(pushConfig) - .setAckDeadlineSeconds(ackDeadlineSeconds) - .build(); - return createSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a subscription to a given topic. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). If the subscription - * already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns - * `NOT_FOUND`. - * - *

If the name is not provided in the request, the server will assign a random name for this - * subscription on the same project as the topic, conforming to the [resource name format] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is - * populated in the returned Subscription object. Note that for REST API requests, you must - * specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   Subscription request =
-   *       Subscription.newBuilder()
-   *           .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .setPushConfig(PushConfig.newBuilder().build())
-   *           .setBigqueryConfig(BigQueryConfig.newBuilder().build())
-   *           .setCloudStorageConfig(CloudStorageConfig.newBuilder().build())
-   *           .setAckDeadlineSeconds(2135351438)
-   *           .setRetainAckedMessages(true)
-   *           .setMessageRetentionDuration(Duration.newBuilder().build())
-   *           .putAllLabels(new HashMap())
-   *           .setEnableMessageOrdering(true)
-   *           .setExpirationPolicy(ExpirationPolicy.newBuilder().build())
-   *           .setFilter("filter-1274492040")
-   *           .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build())
-   *           .setRetryPolicy(RetryPolicy.newBuilder().build())
-   *           .setDetached(true)
-   *           .setEnableExactlyOnceDelivery(true)
-   *           .setTopicMessageRetentionDuration(Duration.newBuilder().build())
-   *           .build();
-   *   Subscription response = subscriptionAdminClient.createSubscription(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 Subscription createSubscription(Subscription request) { - return createSubscriptionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Creates a subscription to a given topic. See the <a - * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name - * rules</a>. If the subscription already exists, returns `ALREADY_EXISTS`. If the - * corresponding topic doesn't exist, returns `NOT_FOUND`. - * - *

If the name is not provided in the request, the server will assign a random name for this - * subscription on the same project as the topic, conforming to the [resource name - * format](https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is - * populated in the returned Subscription object. Note that for REST API requests, you must - * specify a name in the request. - * - *

Sample code: - * - *


-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
-   *   PushConfig pushConfig = PushConfig.newBuilder().build();
-   *   int ackDeadlineSeconds = 0;
-   *   Subscription response = subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
-   * }
-   * 
- * - * @param name Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a - * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores - * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 - * and 255 characters in length, and it must not start with `"goog"`. - * @param topic Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be - * `_deleted-topic_` if the topic has been deleted. - * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack - * messages using API methods. - * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits - * for the subscriber to acknowledge receipt before resending the message. In the interval - * after the message is delivered and before it is acknowledged, it is considered to be - * <i>outstanding</i>. During that time period, the message will not be - * redelivered (on a best-effort basis). - *

For pull subscriptions, this value is used as the initial value for the ack deadline. To - * override this value for a given message, call `ModifyAckDeadline` with the corresponding - * `ack_id` if using non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline - * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds - * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. - *

For push delivery, this value is also used to set the request timeout for the call to - * the push endpoint. - *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually - * redeliver the message. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)} - * instead. - */ - @Deprecated - public final Subscription createSubscription( - ProjectSubscriptionName name, - ProjectTopicName topic, - PushConfig pushConfig, - int ackDeadlineSeconds) { - Subscription request = - Subscription.newBuilder() - .setName(name == null ? null : name.toString()) - .setTopic(topic == null ? null : topic.toString()) - .setPushConfig(pushConfig) - .setAckDeadlineSeconds(ackDeadlineSeconds) - .build(); - return createSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a subscription to a given topic. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already - * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns - * `NOT_FOUND`. - * - *

If the name is not provided in the request, the server will assign a random name for this - * subscription on the same project as the topic, conforming to the [resource name format] - * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in - * the returned Subscription object. Note that for REST API requests, you must specify a name in - * the request. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
-   *   PushConfig pushConfig = PushConfig.newBuilder().build();
-   *   int ackDeadlineSeconds = 2135351438;
-   *   Subscription response =
-   *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
-   * }
-   * }
- * - * @param name Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a - * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores - * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 - * and 255 characters in length, and it must not start with `"goog"`. - * @param topic Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be - * `_deleted-topic_` if the topic has been deleted. - * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack - * messages using API methods. - * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits - * for the subscriber to acknowledge receipt before resending the message. In the interval - * after the message is delivered and before it is acknowledged, it is considered to be - * <i>outstanding</i>. During that time period, the message will not be - * redelivered (on a best-effort basis). - *

For pull subscriptions, this value is used as the initial value for the ack deadline. To - * override this value for a given message, call `ModifyAckDeadline` with the corresponding - * `ack_id` if using non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline - * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds - * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. - *

For push delivery, this value is also used to set the request timeout for the call to - * the push endpoint. - *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually - * redeliver the message. - * @deprecated Use {@link #createSubscription(SubscriptionName, String, PushConfig, int)} instead. - */ - @Deprecated - public final Subscription createSubscription( - ProjectSubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) { - Subscription request = - Subscription.newBuilder() - .setName(name == null ? null : name.toString()) - .setTopic(topic) - .setPushConfig(pushConfig) - .setAckDeadlineSeconds(ackDeadlineSeconds) - .build(); - return createSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a subscription to a given topic. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already - * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns - * `NOT_FOUND`. - * - *

If the name is not provided in the request, the server will assign a random name for this - * subscription on the same project as the topic, conforming to the [resource name format] - * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in - * the returned Subscription object. Note that for REST API requests, you must specify a name in - * the request. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
-   *   PushConfig pushConfig = PushConfig.newBuilder().build();
-   *   int ackDeadlineSeconds = 2135351438;
-   *   Subscription response =
-   *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
-   * }
-   * }
- * - * @param name Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a - * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores - * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 - * and 255 characters in length, and it must not start with `"goog"`. - * @param topic Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be - * `_deleted-topic_` if the topic has been deleted. - * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack - * messages using API methods. - * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits - * for the subscriber to acknowledge receipt before resending the message. In the interval - * after the message is delivered and before it is acknowledged, it is considered to be - * <i>outstanding</i>. During that time period, the message will not be - * redelivered (on a best-effort basis). - *

For pull subscriptions, this value is used as the initial value for the ack deadline. To - * override this value for a given message, call `ModifyAckDeadline` with the corresponding - * `ack_id` if using non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline - * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds - * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. - *

For push delivery, this value is also used to set the request timeout for the call to - * the push endpoint. - *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually - * redeliver the message. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)} - * instead. - */ - @Deprecated - public final Subscription createSubscription( - ProjectSubscriptionName name, - TopicName topic, - PushConfig pushConfig, - int ackDeadlineSeconds) { - Subscription request = - Subscription.newBuilder() - .setName(name == null ? null : name.toString()) - .setTopic(topic == null ? null : topic.toString()) - .setPushConfig(pushConfig) - .setAckDeadlineSeconds(ackDeadlineSeconds) - .build(); - return createSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a subscription to a given topic. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). If the subscription - * already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns - * `NOT_FOUND`. - * - *

If the name is not provided in the request, the server will assign a random name for this - * subscription on the same project as the topic, conforming to the [resource name format] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is - * populated in the returned Subscription object. Note that for REST API requests, you must - * specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   Subscription request =
-   *       Subscription.newBuilder()
-   *           .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .setPushConfig(PushConfig.newBuilder().build())
-   *           .setBigqueryConfig(BigQueryConfig.newBuilder().build())
-   *           .setCloudStorageConfig(CloudStorageConfig.newBuilder().build())
-   *           .setAckDeadlineSeconds(2135351438)
-   *           .setRetainAckedMessages(true)
-   *           .setMessageRetentionDuration(Duration.newBuilder().build())
-   *           .putAllLabels(new HashMap())
-   *           .setEnableMessageOrdering(true)
-   *           .setExpirationPolicy(ExpirationPolicy.newBuilder().build())
-   *           .setFilter("filter-1274492040")
-   *           .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build())
-   *           .setRetryPolicy(RetryPolicy.newBuilder().build())
-   *           .setDetached(true)
-   *           .setEnableExactlyOnceDelivery(true)
-   *           .setTopicMessageRetentionDuration(Duration.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.createSubscriptionCallable().futureCall(request);
-   *   // Do something.
-   *   Subscription response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createSubscriptionCallable() { - return stub.createSubscriptionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration details of a subscription. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   Subscription response = subscriptionAdminClient.getSubscription(subscription);
-   * }
-   * }
- * - * @param subscription Required. The name of the subscription to get. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Subscription getSubscription(SubscriptionName subscription) { - GetSubscriptionRequest request = - GetSubscriptionRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .build(); - return getSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration details of a subscription. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   Subscription response = subscriptionAdminClient.getSubscription(subscription);
-   * }
-   * }
- * - * @param subscription Required. The name of the subscription to get. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Subscription getSubscription(String subscription) { - GetSubscriptionRequest request = - GetSubscriptionRequest.newBuilder().setSubscription(subscription).build(); - return getSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration details of a subscription. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   GetSubscriptionRequest request =
-   *       GetSubscriptionRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .build();
-   *   Subscription response = subscriptionAdminClient.getSubscription(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 Subscription getSubscription(GetSubscriptionRequest request) { - return getSubscriptionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration details of a subscription. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   Subscription response = subscriptionAdminClient.getSubscription(subscription);
-   * }
-   * }
- * - * @param subscription Required. The name of the subscription to get. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #getSubscription(SubscriptionName)} instead. - */ - @Deprecated - public final Subscription getSubscription(ProjectSubscriptionName subscription) { - GetSubscriptionRequest request = - GetSubscriptionRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .build(); - return getSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration details of a subscription. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   GetSubscriptionRequest request =
-   *       GetSubscriptionRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.getSubscriptionCallable().futureCall(request);
-   *   // Do something.
-   *   Subscription response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getSubscriptionCallable() { - return stub.getSubscriptionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an existing subscription. Note that certain properties of a subscription, such as its - * topic, are not modifiable. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   Subscription subscription = Subscription.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Subscription response = subscriptionAdminClient.updateSubscription(subscription, updateMask);
-   * }
-   * }
- * - * @param subscription Required. The updated subscription object. - * @param updateMask Required. Indicates which fields in the provided subscription to update. Must - * be specified and non-empty. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Subscription updateSubscription(Subscription subscription, FieldMask updateMask) { - UpdateSubscriptionRequest request = - UpdateSubscriptionRequest.newBuilder() - .setSubscription(subscription) - .setUpdateMask(updateMask) - .build(); - return updateSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an existing subscription. Note that certain properties of a subscription, such as its - * topic, are not modifiable. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   UpdateSubscriptionRequest request =
-   *       UpdateSubscriptionRequest.newBuilder()
-   *           .setSubscription(Subscription.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Subscription response = subscriptionAdminClient.updateSubscription(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 Subscription updateSubscription(UpdateSubscriptionRequest request) { - return updateSubscriptionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an existing subscription. Note that certain properties of a subscription, such as its - * topic, are not modifiable. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   UpdateSubscriptionRequest request =
-   *       UpdateSubscriptionRequest.newBuilder()
-   *           .setSubscription(Subscription.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.updateSubscriptionCallable().futureCall(request);
-   *   // Do something.
-   *   Subscription response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateSubscriptionCallable() { - return stub.updateSubscriptionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists matching subscriptions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (Subscription element : subscriptionAdminClient.listSubscriptions(project).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param project Required. The name of the project in which to list subscriptions. Format is - * `projects/{project-id}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListSubscriptionsPagedResponse listSubscriptions(ProjectName project) { - ListSubscriptionsRequest request = - ListSubscriptionsRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .build(); - return listSubscriptions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists matching subscriptions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String project = ProjectName.of("[PROJECT]").toString();
-   *   for (Subscription element : subscriptionAdminClient.listSubscriptions(project).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param project Required. The name of the project in which to list subscriptions. Format is - * `projects/{project-id}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListSubscriptionsPagedResponse listSubscriptions(String project) { - ListSubscriptionsRequest request = - ListSubscriptionsRequest.newBuilder().setProject(project).build(); - return listSubscriptions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists matching subscriptions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ListSubscriptionsRequest request =
-   *       ListSubscriptionsRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Subscription element : subscriptionAdminClient.listSubscriptions(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 ListSubscriptionsPagedResponse listSubscriptions(ListSubscriptionsRequest request) { - return listSubscriptionsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists matching subscriptions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ListSubscriptionsRequest request =
-   *       ListSubscriptionsRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.listSubscriptionsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Subscription element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listSubscriptionsPagedCallable() { - return stub.listSubscriptionsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists matching subscriptions. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ListSubscriptionsRequest request =
-   *       ListSubscriptionsRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListSubscriptionsResponse response =
-   *         subscriptionAdminClient.listSubscriptionsCallable().call(request);
-   *     for (Subscription element : response.getSubscriptionsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listSubscriptionsCallable() { - return stub.listSubscriptionsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an existing subscription. All messages retained in the subscription are immediately - * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is - * deleted, a new one may be created with the same name, but the new one has no association with - * the old subscription or its topic unless the same topic is specified. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   subscriptionAdminClient.deleteSubscription(subscription);
-   * }
-   * }
- * - * @param subscription Required. The subscription to delete. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteSubscription(SubscriptionName subscription) { - DeleteSubscriptionRequest request = - DeleteSubscriptionRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .build(); - deleteSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an existing subscription. All messages retained in the subscription are immediately - * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is - * deleted, a new one may be created with the same name, but the new one has no association with - * the old subscription or its topic unless the same topic is specified. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   subscriptionAdminClient.deleteSubscription(subscription);
-   * }
-   * }
- * - * @param subscription Required. The subscription to delete. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteSubscription(String subscription) { - DeleteSubscriptionRequest request = - DeleteSubscriptionRequest.newBuilder().setSubscription(subscription).build(); - deleteSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an existing subscription. All messages retained in the subscription are immediately - * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is - * deleted, a new one may be created with the same name, but the new one has no association with - * the old subscription or its topic unless the same topic is specified. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   DeleteSubscriptionRequest request =
-   *       DeleteSubscriptionRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .build();
-   *   subscriptionAdminClient.deleteSubscription(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 deleteSubscription(DeleteSubscriptionRequest request) { - deleteSubscriptionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an existing subscription. All messages retained in the subscription are immediately - * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is - * deleted, a new one may be created with the same name, but the new one has no association with - * the old subscription or its topic unless the same topic is specified. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   subscriptionAdminClient.deleteSubscription(subscription);
-   * }
-   * }
- * - * @param subscription Required. The subscription to delete. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #deleteSubscription(SubscriptionName)} instead. - */ - @Deprecated - public final void deleteSubscription(ProjectSubscriptionName subscription) { - DeleteSubscriptionRequest request = - DeleteSubscriptionRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .build(); - deleteSubscription(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes an existing subscription. All messages retained in the subscription are immediately - * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is - * deleted, a new one may be created with the same name, but the new one has no association with - * the old subscription or its topic unless the same topic is specified. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   DeleteSubscriptionRequest request =
-   *       DeleteSubscriptionRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.deleteSubscriptionCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteSubscriptionCallable() { - return stub.deleteSubscriptionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Modifies the ack deadline for a specific message. This method is useful to indicate that more - * time is needed to process a message by the subscriber, or to make the message available for - * redelivery if the processing was interrupted. Note that this does not modify the - * subscription-level `ackDeadlineSeconds` used for subsequent messages. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   List ackIds = new ArrayList<>();
-   *   int ackDeadlineSeconds = 2135351438;
-   *   subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds);
-   * }
-   * }
- * - * @param subscription Required. The name of the subscription. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param ackIds Required. List of acknowledgment IDs. - * @param ackDeadlineSeconds Required. The new ack deadline with respect to the time this request - * was sent to the Pub/Sub system. For example, if the value is 10, the new ack deadline will - * expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero might - * immediately make the message available for delivery to another subscriber client. This - * typically results in an increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. The maximum deadline you can specify is - * 600 seconds (10 minutes). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void modifyAckDeadline( - SubscriptionName subscription, List ackIds, int ackDeadlineSeconds) { - ModifyAckDeadlineRequest request = - ModifyAckDeadlineRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .addAllAckIds(ackIds) - .setAckDeadlineSeconds(ackDeadlineSeconds) - .build(); - modifyAckDeadline(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Modifies the ack deadline for a specific message. This method is useful to indicate that more - * time is needed to process a message by the subscriber, or to make the message available for - * redelivery if the processing was interrupted. Note that this does not modify the - * subscription-level `ackDeadlineSeconds` used for subsequent messages. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   List ackIds = new ArrayList<>();
-   *   int ackDeadlineSeconds = 2135351438;
-   *   subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds);
-   * }
-   * }
- * - * @param subscription Required. The name of the subscription. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param ackIds Required. List of acknowledgment IDs. - * @param ackDeadlineSeconds Required. The new ack deadline with respect to the time this request - * was sent to the Pub/Sub system. For example, if the value is 10, the new ack deadline will - * expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero might - * immediately make the message available for delivery to another subscriber client. This - * typically results in an increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. The maximum deadline you can specify is - * 600 seconds (10 minutes). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void modifyAckDeadline( - String subscription, List ackIds, int ackDeadlineSeconds) { - ModifyAckDeadlineRequest request = - ModifyAckDeadlineRequest.newBuilder() - .setSubscription(subscription) - .addAllAckIds(ackIds) - .setAckDeadlineSeconds(ackDeadlineSeconds) - .build(); - modifyAckDeadline(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Modifies the ack deadline for a specific message. This method is useful to indicate that more - * time is needed to process a message by the subscriber, or to make the message available for - * redelivery if the processing was interrupted. Note that this does not modify the - * subscription-level `ackDeadlineSeconds` used for subsequent messages. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ModifyAckDeadlineRequest request =
-   *       ModifyAckDeadlineRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .addAllAckIds(new ArrayList())
-   *           .setAckDeadlineSeconds(2135351438)
-   *           .build();
-   *   subscriptionAdminClient.modifyAckDeadline(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 modifyAckDeadline(ModifyAckDeadlineRequest request) { - modifyAckDeadlineCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Modifies the ack deadline for a specific message. This method is useful to indicate that more - * time is needed to process a message by the subscriber, or to make the message available for - * redelivery if the processing was interrupted. Note that this does not modify the - * subscription-level `ackDeadlineSeconds` used for subsequent messages. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   List ackIds = new ArrayList<>();
-   *   int ackDeadlineSeconds = 2135351438;
-   *   subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds);
-   * }
-   * }
- * - * @param subscription Required. The name of the subscription. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param ackIds Required. List of acknowledgment IDs. - * @param ackDeadlineSeconds Required. The new ack deadline with respect to the time this request - * was sent to the Pub/Sub system. For example, if the value is 10, the new ack deadline will - * expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero might - * immediately make the message available for delivery to another subscriber client. This - * typically results in an increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. The maximum deadline you can specify is - * 600 seconds (10 minutes). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #modifyAckDeadline(SubscriptionName, List, int)} instead. - */ - @Deprecated - final void modifyAckDeadline( - ProjectSubscriptionName subscription, List ackIds, int ackDeadlineSeconds) { - ModifyAckDeadlineRequest request = - ModifyAckDeadlineRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .addAllAckIds(ackIds) - .setAckDeadlineSeconds(ackDeadlineSeconds) - .build(); - modifyAckDeadline(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Modifies the ack deadline for a specific message. This method is useful to indicate that more - * time is needed to process a message by the subscriber, or to make the message available for - * redelivery if the processing was interrupted. Note that this does not modify the - * subscription-level `ackDeadlineSeconds` used for subsequent messages. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ModifyAckDeadlineRequest request =
-   *       ModifyAckDeadlineRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .addAllAckIds(new ArrayList())
-   *           .setAckDeadlineSeconds(2135351438)
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.modifyAckDeadlineCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable modifyAckDeadlineCallable() { - return stub.modifyAckDeadlineCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The - * Pub/Sub system can remove the relevant messages from the subscription. - * - *

Acknowledging a message whose ack deadline has expired may succeed, but such a message may - * be redelivered later. Acknowledging a message more than once will not result in an error. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   List ackIds = new ArrayList<>();
-   *   subscriptionAdminClient.acknowledge(subscription, ackIds);
-   * }
-   * }
- * - * @param subscription Required. The subscription whose message is being acknowledged. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param ackIds Required. The acknowledgment ID for the messages being acknowledged that was - * returned by the Pub/Sub system in the `Pull` response. Must not be empty. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void acknowledge(SubscriptionName subscription, List ackIds) { - AcknowledgeRequest request = - AcknowledgeRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .addAllAckIds(ackIds) - .build(); - acknowledge(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The - * Pub/Sub system can remove the relevant messages from the subscription. - * - *

Acknowledging a message whose ack deadline has expired may succeed, but such a message may - * be redelivered later. Acknowledging a message more than once will not result in an error. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   List ackIds = new ArrayList<>();
-   *   subscriptionAdminClient.acknowledge(subscription, ackIds);
-   * }
-   * }
- * - * @param subscription Required. The subscription whose message is being acknowledged. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param ackIds Required. The acknowledgment ID for the messages being acknowledged that was - * returned by the Pub/Sub system in the `Pull` response. Must not be empty. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void acknowledge(String subscription, List ackIds) { - AcknowledgeRequest request = - AcknowledgeRequest.newBuilder().setSubscription(subscription).addAllAckIds(ackIds).build(); - acknowledge(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The - * Pub/Sub system can remove the relevant messages from the subscription. - * - *

Acknowledging a message whose ack deadline has expired may succeed, but such a message may - * be redelivered later. Acknowledging a message more than once will not result in an error. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   AcknowledgeRequest request =
-   *       AcknowledgeRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .addAllAckIds(new ArrayList())
-   *           .build();
-   *   subscriptionAdminClient.acknowledge(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 acknowledge(AcknowledgeRequest request) { - acknowledgeCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The - * Pub/Sub system can remove the relevant messages from the subscription. - * - *

Acknowledging a message whose ack deadline has expired may succeed, but such a message may - * be redelivered later. Acknowledging a message more than once will not result in an error. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   List ackIds = new ArrayList<>();
-   *   subscriptionAdminClient.acknowledge(subscription, ackIds);
-   * }
-   * }
- * - * @param subscription Required. The subscription whose message is being acknowledged. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param ackIds Required. The acknowledgment ID for the messages being acknowledged that was - * returned by the Pub/Sub system in the `Pull` response. Must not be empty. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #acknowledge(SubscriptionName, List)} instead. - */ - @Deprecated - public final void acknowledge(ProjectSubscriptionName subscription, List ackIds) { - AcknowledgeRequest request = - AcknowledgeRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .addAllAckIds(ackIds) - .build(); - acknowledge(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The - * Pub/Sub system can remove the relevant messages from the subscription. - * - *

Acknowledging a message whose ack deadline has expired may succeed, but such a message may - * be redelivered later. Acknowledging a message more than once will not result in an error. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   AcknowledgeRequest request =
-   *       AcknowledgeRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .addAllAckIds(new ArrayList())
-   *           .build();
-   *   ApiFuture future = subscriptionAdminClient.acknowledgeCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable acknowledgeCallable() { - return stub.acknowledgeCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Pulls messages from the server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   int maxMessages = 496131527;
-   *   PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);
-   * }
-   * }
- * - * @param subscription Required. The subscription from which messages should be pulled. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param maxMessages Required. The maximum number of messages to return for this request. Must be - * a positive integer. The Pub/Sub system may return fewer than the number specified. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PullResponse pull(SubscriptionName subscription, int maxMessages) { - PullRequest request = - PullRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .setMaxMessages(maxMessages) - .build(); - return pull(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Pulls messages from the server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   int maxMessages = 496131527;
-   *   PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);
-   * }
-   * }
- * - * @param subscription Required. The subscription from which messages should be pulled. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param maxMessages Required. The maximum number of messages to return for this request. Must be - * a positive integer. The Pub/Sub system may return fewer than the number specified. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PullResponse pull(String subscription, int maxMessages) { - PullRequest request = - PullRequest.newBuilder().setSubscription(subscription).setMaxMessages(maxMessages).build(); - return pull(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Pulls messages from the server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   boolean returnImmediately = true;
-   *   int maxMessages = 496131527;
-   *   PullResponse response =
-   *       subscriptionAdminClient.pull(subscription, returnImmediately, maxMessages);
-   * }
-   * }
- * - * @param subscription Required. The subscription from which messages should be pulled. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param returnImmediately Optional. If this field set to true, the system will respond - * immediately even if it there are no messages available to return in the `Pull` response. - * Otherwise, the system may wait (for a bounded amount of time) until at least one message is - * available, rather than returning no messages. Warning: setting this field to `true` is - * discouraged because it adversely impacts the performance of `Pull` operations. We recommend - * that users do not set this field. - * @param maxMessages Required. The maximum number of messages to return for this request. Must be - * a positive integer. The Pub/Sub system may return fewer than the number specified. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PullResponse pull( - SubscriptionName subscription, boolean returnImmediately, int maxMessages) { - PullRequest request = - PullRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .setReturnImmediately(returnImmediately) - .setMaxMessages(maxMessages) - .build(); - return pull(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Pulls messages from the server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   boolean returnImmediately = true;
-   *   int maxMessages = 496131527;
-   *   PullResponse response =
-   *       subscriptionAdminClient.pull(subscription, returnImmediately, maxMessages);
-   * }
-   * }
- * - * @param subscription Required. The subscription from which messages should be pulled. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param returnImmediately Optional. If this field set to true, the system will respond - * immediately even if it there are no messages available to return in the `Pull` response. - * Otherwise, the system may wait (for a bounded amount of time) until at least one message is - * available, rather than returning no messages. Warning: setting this field to `true` is - * discouraged because it adversely impacts the performance of `Pull` operations. We recommend - * that users do not set this field. - * @param maxMessages Required. The maximum number of messages to return for this request. Must be - * a positive integer. The Pub/Sub system may return fewer than the number specified. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PullResponse pull(String subscription, boolean returnImmediately, int maxMessages) { - PullRequest request = - PullRequest.newBuilder() - .setSubscription(subscription) - .setReturnImmediately(returnImmediately) - .setMaxMessages(maxMessages) - .build(); - return pull(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Pulls messages from the server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   PullRequest request =
-   *       PullRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .setReturnImmediately(true)
-   *           .setMaxMessages(496131527)
-   *           .build();
-   *   PullResponse response = subscriptionAdminClient.pull(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 PullResponse pull(PullRequest request) { - return pullCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many - * concurrent pull requests pending for the given subscription. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   int maxMessages = 496131527;
-   *   PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);
-   * }
-   * }
- * - * @param subscription Required. The subscription from which messages should be pulled. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param maxMessages Required. The maximum number of messages to return for this request. Must be - * a positive integer. The Pub/Sub system may return fewer than the number specified. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #pull(SubscriptionName, int)} instead. - */ - @Deprecated - public final PullResponse pull(ProjectSubscriptionName subscription, int maxMessages) { - PullRequest request = - PullRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .setMaxMessages(maxMessages) - .build(); - return pull(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many - * concurrent pull requests pending for the given subscription. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   boolean returnImmediately = true;
-   *   int maxMessages = 496131527;
-   *   PullResponse response =
-   *       subscriptionAdminClient.pull(subscription, returnImmediately, maxMessages);
-   * }
-   * }
- * - * @param subscription Required. The subscription from which messages should be pulled. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param returnImmediately Optional. If this field set to true, the system will respond - * immediately even if it there are no messages available to return in the `Pull` response. - * Otherwise, the system may wait (for a bounded amount of time) until at least one message is - * available, rather than returning no messages. Warning: setting this field to `true` is - * discouraged because it adversely impacts the performance of `Pull` operations. We recommend - * that users do not set this field. - * @param maxMessages Required. The maximum number of messages to return for this request. Must be - * a positive integer. The Pub/Sub system may return fewer than the number specified. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #pull(SubscriptionName, boolean, int)} instead. - */ - @Deprecated - final PullResponse pull( - ProjectSubscriptionName subscription, boolean returnImmediately, int maxMessages) { - PullRequest request = - PullRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .setReturnImmediately(returnImmediately) - .setMaxMessages(maxMessages) - .build(); - return pull(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Pulls messages from the server. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   PullRequest request =
-   *       PullRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .setReturnImmediately(true)
-   *           .setMaxMessages(496131527)
-   *           .build();
-   *   ApiFuture future = subscriptionAdminClient.pullCallable().futureCall(request);
-   *   // Do something.
-   *   PullResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable pullCallable() { - return stub.pullCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Establishes a stream with the server, which sends messages down to the client. The client - * streams acknowledgements and ack deadline modifications back to the server. The server will - * close the stream and return the status on any error. The server may close the stream with - * status `UNAVAILABLE` to reassign server-side resources, in which case, the client should - * re-establish the stream. Flow control can be achieved by configuring the underlying RPC - * channel. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   BidiStream bidiStream =
-   *       subscriptionAdminClient.streamingPullCallable().call();
-   *   StreamingPullRequest request =
-   *       StreamingPullRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .addAllAckIds(new ArrayList())
-   *           .addAllModifyDeadlineSeconds(new ArrayList())
-   *           .addAllModifyDeadlineAckIds(new ArrayList())
-   *           .setStreamAckDeadlineSeconds(1875467245)
-   *           .setClientId("clientId908408390")
-   *           .setMaxOutstandingMessages(-1315266996)
-   *           .setMaxOutstandingBytes(-2103098517)
-   *           .build();
-   *   bidiStream.send(request);
-   *   for (StreamingPullResponse response : bidiStream) {
-   *     // Do something when a response is received.
-   *   }
-   * }
-   * }
- */ - public final BidiStreamingCallable - streamingPullCallable() { - return stub.streamingPullCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Modifies the `PushConfig` for a specified subscription. - * - *

This may be used to change a push subscription to a pull one (signified by an empty - * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push - * subscription. Messages will accumulate for delivery continuously through the call regardless of - * changes to the `PushConfig`. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   PushConfig pushConfig = PushConfig.newBuilder().build();
-   *   subscriptionAdminClient.modifyPushConfig(subscription, pushConfig);
-   * }
-   * }
- * - * @param subscription Required. The name of the subscription. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param pushConfig Required. The push configuration for future deliveries. - *

An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages - * from the given subscription and allow messages to be pulled and acknowledged - effectively - * pausing the subscription if `Pull` or `StreamingPull` is not called. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void modifyPushConfig(SubscriptionName subscription, PushConfig pushConfig) { - ModifyPushConfigRequest request = - ModifyPushConfigRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .setPushConfig(pushConfig) - .build(); - modifyPushConfig(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Modifies the `PushConfig` for a specified subscription. - * - *

This may be used to change a push subscription to a pull one (signified by an empty - * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push - * subscription. Messages will accumulate for delivery continuously through the call regardless of - * changes to the `PushConfig`. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   PushConfig pushConfig = PushConfig.newBuilder().build();
-   *   subscriptionAdminClient.modifyPushConfig(subscription, pushConfig);
-   * }
-   * }
- * - * @param subscription Required. The name of the subscription. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param pushConfig Required. The push configuration for future deliveries. - *

An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages - * from the given subscription and allow messages to be pulled and acknowledged - effectively - * pausing the subscription if `Pull` or `StreamingPull` is not called. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void modifyPushConfig(String subscription, PushConfig pushConfig) { - ModifyPushConfigRequest request = - ModifyPushConfigRequest.newBuilder() - .setSubscription(subscription) - .setPushConfig(pushConfig) - .build(); - modifyPushConfig(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Modifies the `PushConfig` for a specified subscription. - * - *

This may be used to change a push subscription to a pull one (signified by an empty - * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push - * subscription. Messages will accumulate for delivery continuously through the call regardless of - * changes to the `PushConfig`. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ModifyPushConfigRequest request =
-   *       ModifyPushConfigRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .setPushConfig(PushConfig.newBuilder().build())
-   *           .build();
-   *   subscriptionAdminClient.modifyPushConfig(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 modifyPushConfig(ModifyPushConfigRequest request) { - modifyPushConfigCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Modifies the `PushConfig` for a specified subscription. - * - *

This may be used to change a push subscription to a pull one (signified by an empty - * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push - * subscription. Messages will accumulate for delivery continuously through the call regardless of - * changes to the `PushConfig`. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   PushConfig pushConfig = PushConfig.newBuilder().build();
-   *   subscriptionAdminClient.modifyPushConfig(subscription, pushConfig);
-   * }
-   * }
- * - * @param subscription Required. The name of the subscription. Format is - * `projects/{project}/subscriptions/{sub}`. - * @param pushConfig Required. The push configuration for future deliveries. - *

An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages - * from the given subscription and allow messages to be pulled and acknowledged - effectively - * pausing the subscription if `Pull` or `StreamingPull` is not called. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #modifyPushConfig(SubscriptionName, PushConfig)} instead. - */ - @Deprecated - public final void modifyPushConfig(ProjectSubscriptionName subscription, PushConfig pushConfig) { - ModifyPushConfigRequest request = - ModifyPushConfigRequest.newBuilder() - .setSubscription(subscription == null ? null : subscription.toString()) - .setPushConfig(pushConfig) - .build(); - modifyPushConfig(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Modifies the `PushConfig` for a specified subscription. - * - *

This may be used to change a push subscription to a pull one (signified by an empty - * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push - * subscription. Messages will accumulate for delivery continuously through the call regardless of - * changes to the `PushConfig`. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ModifyPushConfigRequest request =
-   *       ModifyPushConfigRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .setPushConfig(PushConfig.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.modifyPushConfigCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable modifyPushConfigCallable() { - return stub.modifyPushConfigCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration details of a snapshot. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);
-   * }
-   * }
- * - * @param snapshot Required. The name of the snapshot to get. Format is - * `projects/{project}/snapshots/{snap}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Snapshot getSnapshot(SnapshotName snapshot) { - GetSnapshotRequest request = - GetSnapshotRequest.newBuilder() - .setSnapshot(snapshot == null ? null : snapshot.toString()) - .build(); - return getSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration details of a snapshot. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
-   *   Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);
-   * }
-   * }
- * - * @param snapshot Required. The name of the snapshot to get. Format is - * `projects/{project}/snapshots/{snap}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Snapshot getSnapshot(String snapshot) { - GetSnapshotRequest request = GetSnapshotRequest.newBuilder().setSnapshot(snapshot).build(); - return getSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration details of a snapshot. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   GetSnapshotRequest request =
-   *       GetSnapshotRequest.newBuilder()
-   *           .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
-   *           .build();
-   *   Snapshot response = subscriptionAdminClient.getSnapshot(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 Snapshot getSnapshot(GetSnapshotRequest request) { - return getSnapshotCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration details of a snapshot. Snapshots are used in <a - * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> 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. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);
-   * }
-   * }
- * - * @param snapshot Required. The name of the snapshot to get. Format is - * `projects/{project}/snapshots/{snap}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use Use {@link #getSnapshot(SnapshotName)} instead. - */ - @Deprecated - public final Snapshot getSnapshot(ProjectSnapshotName snapshot) { - GetSnapshotRequest request = - GetSnapshotRequest.newBuilder() - .setSnapshot(snapshot == null ? null : snapshot.toString()) - .build(); - return getSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration details of a snapshot. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   GetSnapshotRequest request =
-   *       GetSnapshotRequest.newBuilder()
-   *           .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.getSnapshotCallable().futureCall(request);
-   *   // Do something.
-   *   Snapshot response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getSnapshotCallable() { - return stub.getSnapshotCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the existing snapshots. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (Snapshot element : subscriptionAdminClient.listSnapshots(project).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param project Required. The name of the project in which to list snapshots. Format is - * `projects/{project-id}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListSnapshotsPagedResponse listSnapshots(ProjectName project) { - ListSnapshotsRequest request = - ListSnapshotsRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .build(); - return listSnapshots(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the existing snapshots. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String project = ProjectName.of("[PROJECT]").toString();
-   *   for (Snapshot element : subscriptionAdminClient.listSnapshots(project).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param project Required. The name of the project in which to list snapshots. Format is - * `projects/{project-id}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListSnapshotsPagedResponse listSnapshots(String project) { - ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder().setProject(project).build(); - return listSnapshots(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the existing snapshots. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ListSnapshotsRequest request =
-   *       ListSnapshotsRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Snapshot element : subscriptionAdminClient.listSnapshots(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 ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest request) { - return listSnapshotsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the existing snapshots. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ListSnapshotsRequest request =
-   *       ListSnapshotsRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.listSnapshotsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Snapshot element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listSnapshotsPagedCallable() { - return stub.listSnapshotsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the existing snapshots. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ListSnapshotsRequest request =
-   *       ListSnapshotsRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListSnapshotsResponse response =
-   *         subscriptionAdminClient.listSnapshotsCallable().call(request);
-   *     for (Snapshot element : response.getSnapshotsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listSnapshotsCallable() { - return stub.listSnapshotsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a snapshot from the requested subscription. 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. If the snapshot - * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns - * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would - * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the - * `Snapshot.expire_time` field. If the name is not provided in the request, the server will - * assign a random name for this snapshot on the same project as the subscription, conforming to - * the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * The generated name is populated in the returned Snapshot object. Note that for REST API - * requests, you must specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
-   * }
-   * }
- * - * @param name Required. User-provided name for this snapshot. If the name is not provided in the - * request, the server will assign a random name for this snapshot on the same project as the - * subscription. Note that for REST API requests, you must specify a name. See the [resource - * name rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). Format is - * `projects/{project}/snapshots/{snap}`. - * @param subscription Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the - * subscription. More precisely, this is defined as the messages in the subscription's backlog - * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as - * well as: (b) Any messages published to the subscription's topic following the successful - * completion of the CreateSnapshot request. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Snapshot createSnapshot(SnapshotName name, SubscriptionName subscription) { - CreateSnapshotRequest request = - CreateSnapshotRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setSubscription(subscription == null ? null : subscription.toString()) - .build(); - return createSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a snapshot from the requested subscription. 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. If the snapshot - * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns - * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would - * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the - * `Snapshot.expire_time` field. If the name is not provided in the request, the server will - * assign a random name for this snapshot on the same project as the subscription, conforming to - * the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * The generated name is populated in the returned Snapshot object. Note that for REST API - * requests, you must specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
-   * }
-   * }
- * - * @param name Required. User-provided name for this snapshot. If the name is not provided in the - * request, the server will assign a random name for this snapshot on the same project as the - * subscription. Note that for REST API requests, you must specify a name. See the [resource - * name rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). Format is - * `projects/{project}/snapshots/{snap}`. - * @param subscription Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the - * subscription. More precisely, this is defined as the messages in the subscription's backlog - * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as - * well as: (b) Any messages published to the subscription's topic following the successful - * completion of the CreateSnapshot request. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Snapshot createSnapshot(SnapshotName name, String subscription) { - CreateSnapshotRequest request = - CreateSnapshotRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setSubscription(subscription) - .build(); - return createSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a snapshot from the requested subscription. 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. If the snapshot - * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns - * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would - * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the - * `Snapshot.expire_time` field. If the name is not provided in the request, the server will - * assign a random name for this snapshot on the same project as the subscription, conforming to - * the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * The generated name is populated in the returned Snapshot object. Note that for REST API - * requests, you must specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
-   *   SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
-   * }
-   * }
- * - * @param name Required. User-provided name for this snapshot. If the name is not provided in the - * request, the server will assign a random name for this snapshot on the same project as the - * subscription. Note that for REST API requests, you must specify a name. See the [resource - * name rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). Format is - * `projects/{project}/snapshots/{snap}`. - * @param subscription Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the - * subscription. More precisely, this is defined as the messages in the subscription's backlog - * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as - * well as: (b) Any messages published to the subscription's topic following the successful - * completion of the CreateSnapshot request. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Snapshot createSnapshot(String name, SubscriptionName subscription) { - CreateSnapshotRequest request = - CreateSnapshotRequest.newBuilder() - .setName(name) - .setSubscription(subscription == null ? null : subscription.toString()) - .build(); - return createSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a snapshot from the requested subscription. 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. If the snapshot - * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns - * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would - * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the - * `Snapshot.expire_time` field. If the name is not provided in the request, the server will - * assign a random name for this snapshot on the same project as the subscription, conforming to - * the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * The generated name is populated in the returned Snapshot object. Note that for REST API - * requests, you must specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
-   *   String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
-   * }
-   * }
- * - * @param name Required. User-provided name for this snapshot. If the name is not provided in the - * request, the server will assign a random name for this snapshot on the same project as the - * subscription. Note that for REST API requests, you must specify a name. See the [resource - * name rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). Format is - * `projects/{project}/snapshots/{snap}`. - * @param subscription Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the - * subscription. More precisely, this is defined as the messages in the subscription's backlog - * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as - * well as: (b) Any messages published to the subscription's topic following the successful - * completion of the CreateSnapshot request. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Snapshot createSnapshot(String name, String subscription) { - CreateSnapshotRequest request = - CreateSnapshotRequest.newBuilder().setName(name).setSubscription(subscription).build(); - return createSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a snapshot from the requested subscription. 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. If the snapshot - * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns - * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would - * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the - * `Snapshot.expire_time` field. If the name is not provided in the request, the server will - * assign a random name for this snapshot on the same project as the subscription, conforming to - * the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * The generated name is populated in the returned Snapshot object. Note that for REST API - * requests, you must specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   CreateSnapshotRequest request =
-   *       CreateSnapshotRequest.newBuilder()
-   *           .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .putAllLabels(new HashMap())
-   *           .build();
-   *   Snapshot response = subscriptionAdminClient.createSnapshot(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 Snapshot createSnapshot(CreateSnapshotRequest request) { - return createSnapshotCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a snapshot from the requested subscription. 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. If the snapshot - * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns - * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would - * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the - * `Snapshot.expire_time` field. If the name is not provided in the request, the server will - * assign a random name for this snapshot on the same project as the subscription, conforming to - * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The - * generated name is populated in the returned Snapshot object. Note that for REST API requests, - * you must specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
-   * }
-   * }
- * - * @param name Required. User-provided name for this snapshot. If the name is not provided in the - * request, the server will assign a random name for this snapshot on the same project as the - * subscription. Note that for REST API requests, you must specify a name. See the <a - * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name - * rules</a>. Format is `projects/{project}/snapshots/{snap}`. - * @param subscription Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the - * subscription. More precisely, this is defined as the messages in the subscription's backlog - * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as - * well as: (b) Any messages published to the subscription's topic following the successful - * completion of the CreateSnapshot request. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use Use {@link #createSnapshot(SnapshotName, SubscriptionName)} instead. - */ - @Deprecated - public final Snapshot createSnapshot( - ProjectSnapshotName name, ProjectSubscriptionName subscription) { - CreateSnapshotRequest request = - CreateSnapshotRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setSubscription(subscription == null ? null : subscription.toString()) - .build(); - return createSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a snapshot from the requested subscription. 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. If the snapshot - * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns - * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would - * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the - * `Snapshot.expire_time` field. If the name is not provided in the request, the server will - * assign a random name for this snapshot on the same project as the subscription, conforming to - * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The - * generated name is populated in the returned Snapshot object. Note that for REST API requests, - * you must specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
-   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
-   * }
-   * }
- * - * @param name Required. User-provided name for this snapshot. If the name is not provided in the - * request, the server will assign a random name for this snapshot on the same project as the - * subscription. Note that for REST API requests, you must specify a name. See the <a - * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name - * rules</a>. Format is `projects/{project}/snapshots/{snap}`. - * @param subscription Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the - * subscription. More precisely, this is defined as the messages in the subscription's backlog - * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as - * well as: (b) Any messages published to the subscription's topic following the successful - * completion of the CreateSnapshot request. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use Use {@link #createSnapshot(String, SubscriptionName)} instead. - */ - @Deprecated - public final Snapshot createSnapshot(String name, ProjectSubscriptionName subscription) { - CreateSnapshotRequest request = - CreateSnapshotRequest.newBuilder() - .setName(name) - .setSubscription(subscription == null ? null : subscription.toString()) - .build(); - return createSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a snapshot from the requested subscription. 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. If the snapshot - * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns - * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would - * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the - * `Snapshot.expire_time` field. If the name is not provided in the request, the server will - * assign a random name for this snapshot on the same project as the subscription, conforming to - * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The - * generated name is populated in the returned Snapshot object. Note that for REST API requests, - * you must specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
-   *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
-   * }
-   * }
- * - * @param name Required. User-provided name for this snapshot. If the name is not provided in the - * request, the server will assign a random name for this snapshot on the same project as the - * subscription. Note that for REST API requests, you must specify a name. See the <a - * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name - * rules</a>. Format is `projects/{project}/snapshots/{snap}`. - * @param subscription Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the - * subscription. More precisely, this is defined as the messages in the subscription's backlog - * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as - * well as: (b) Any messages published to the subscription's topic following the successful - * completion of the CreateSnapshot request. Format is - * `projects/{project}/subscriptions/{sub}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use Use {@link #createSnapshot(SnapshotName, String)} instead. - */ - @Deprecated - public final Snapshot createSnapshot(ProjectSnapshotName name, String subscription) { - CreateSnapshotRequest request = - CreateSnapshotRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setSubscription(subscription) - .build(); - return createSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a snapshot from the requested subscription. 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. If the snapshot - * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns - * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would - * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the - * `Snapshot.expire_time` field. If the name is not provided in the request, the server will - * assign a random name for this snapshot on the same project as the subscription, conforming to - * the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * The generated name is populated in the returned Snapshot object. Note that for REST API - * requests, you must specify a name in the request. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   CreateSnapshotRequest request =
-   *       CreateSnapshotRequest.newBuilder()
-   *           .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .putAllLabels(new HashMap())
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.createSnapshotCallable().futureCall(request);
-   *   // Do something.
-   *   Snapshot response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createSnapshotCallable() { - return stub.createSnapshotCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an existing snapshot. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   Snapshot snapshot = Snapshot.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Snapshot response = subscriptionAdminClient.updateSnapshot(snapshot, updateMask);
-   * }
-   * }
- * - * @param snapshot Required. The updated snapshot object. - * @param updateMask Required. Indicates which fields in the provided snapshot to update. Must be - * specified and non-empty. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Snapshot updateSnapshot(Snapshot snapshot, FieldMask updateMask) { - UpdateSnapshotRequest request = - UpdateSnapshotRequest.newBuilder().setSnapshot(snapshot).setUpdateMask(updateMask).build(); - return updateSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an existing snapshot. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   UpdateSnapshotRequest request =
-   *       UpdateSnapshotRequest.newBuilder()
-   *           .setSnapshot(Snapshot.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Snapshot response = subscriptionAdminClient.updateSnapshot(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 Snapshot updateSnapshot(UpdateSnapshotRequest request) { - return updateSnapshotCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an existing snapshot. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   UpdateSnapshotRequest request =
-   *       UpdateSnapshotRequest.newBuilder()
-   *           .setSnapshot(Snapshot.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.updateSnapshotCallable().futureCall(request);
-   *   // Do something.
-   *   Snapshot response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateSnapshotCallable() { - return stub.updateSnapshotCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Removes an existing snapshot. 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. When the snapshot is deleted, all - * messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new - * one may be created with the same name, but the new one has no association with the old snapshot - * or its subscription, unless the same subscription is specified. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   subscriptionAdminClient.deleteSnapshot(snapshot);
-   * }
-   * }
- * - * @param snapshot Required. The name of the snapshot to delete. Format is - * `projects/{project}/snapshots/{snap}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteSnapshot(SnapshotName snapshot) { - DeleteSnapshotRequest request = - DeleteSnapshotRequest.newBuilder() - .setSnapshot(snapshot == null ? null : snapshot.toString()) - .build(); - deleteSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Removes an existing snapshot. 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. When the snapshot is deleted, all - * messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new - * one may be created with the same name, but the new one has no association with the old snapshot - * or its subscription, unless the same subscription is specified. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
-   *   subscriptionAdminClient.deleteSnapshot(snapshot);
-   * }
-   * }
- * - * @param snapshot Required. The name of the snapshot to delete. Format is - * `projects/{project}/snapshots/{snap}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteSnapshot(String snapshot) { - DeleteSnapshotRequest request = - DeleteSnapshotRequest.newBuilder().setSnapshot(snapshot).build(); - deleteSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Removes an existing snapshot. 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. When the snapshot is deleted, all - * messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new - * one may be created with the same name, but the new one has no association with the old snapshot - * or its subscription, unless the same subscription is specified. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   DeleteSnapshotRequest request =
-   *       DeleteSnapshotRequest.newBuilder()
-   *           .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
-   *           .build();
-   *   subscriptionAdminClient.deleteSnapshot(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 deleteSnapshot(DeleteSnapshotRequest request) { - deleteSnapshotCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Removes an existing snapshot. 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. When the snapshot is deleted, all - * messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new - * one may be created with the same name, but the new one has no association with the old snapshot - * or its subscription, unless the same subscription is specified. - * - *

Sample code: - * - *

{@code
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-   *   subscriptionAdminClient.deleteSnapshot(snapshot);
-   * }
-   * }
- * - * @param snapshot Required. The name of the snapshot to delete. Format is - * `projects/{project}/snapshots/{snap}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use Use {@link #deleteSnapshot(SnapshotName)} instead. - */ - @Deprecated - public final void deleteSnapshot(ProjectSnapshotName snapshot) { - DeleteSnapshotRequest request = - DeleteSnapshotRequest.newBuilder() - .setSnapshot(snapshot == null ? null : snapshot.toString()) - .build(); - deleteSnapshot(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Removes an existing snapshot. 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. When the snapshot is deleted, all - * messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new - * one may be created with the same name, but the new one has no association with the old snapshot - * or its subscription, unless the same subscription is specified. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   DeleteSnapshotRequest request =
-   *       DeleteSnapshotRequest.newBuilder()
-   *           .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.deleteSnapshotCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteSnapshotCallable() { - return stub.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 - * 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SeekRequest request =
-   *       SeekRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .build();
-   *   SeekResponse response = subscriptionAdminClient.seek(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 SeekResponse seek(SeekRequest request) { - return seekCallable().call(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 - * 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SeekRequest request =
-   *       SeekRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .build();
-   *   ApiFuture future = subscriptionAdminClient.seekCallable().futureCall(request);
-   *   // Do something.
-   *   SeekResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable seekCallable() { - return stub.seekCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Sets the access control policy on the specified resource. Replacesany existing policy. - * - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Policy response = subscriptionAdminClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) { - return setIamPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Sets the access control policy on the specified resource. Replaces any existing policy. - * - *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED - * - *

Sample code: - * - *


-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
-   *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = subscriptionAdminClient.setIamPolicy(formattedResource, policy);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy is being specified. See the - * operation documentation for the appropriate value for this field. - * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the - * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud - * Platform services (such as Projects) might reject them. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead. - */ - @Deprecated - public final Policy setIamPolicy(String resource, Policy policy) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); - return setIamPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Sets the access control policy on the specified resource. Replacesany existing policy. - * - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = subscriptionAdminClient.setIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable setIamPolicyCallable() { - return stub.setIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the access control policy for a resource. Returns an empty policyif the resource exists - * and does not have a policy set. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   Policy response = subscriptionAdminClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) { - return getIamPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets the access control policy for a resource. Returns an empty policy if the resource exists - * and does not have a policy set. - * - *

Sample code: - * - *


-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
-   *   Policy response = subscriptionAdminClient.getIamPolicy(formattedResource);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy is being requested. See the - * operation documentation for the appropriate value for this field. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead. - */ - @Deprecated - public final Policy getIamPolicy(String resource) { - GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); - return getIamPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the access control policy for a resource. Returns an empty policyif the resource exists - * and does not have a policy set. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = subscriptionAdminClient.getIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getIamPolicyCallable() { - return stub.getIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns permissions that a caller has on the specified resource. If theresource does not exist, - * this will return an empty set ofpermissions, not a `NOT_FOUND` error. - * - *

Note: This operation is designed to be used for buildingpermission-aware UIs and - * command-line tools, not for authorizationchecking. This operation may "fail open" without - * warning. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { - return testIamPermissionsCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Returns permissions that a caller has on the specified resource. If the resource does not - * exist, this will return an empty set of permissions, not a NOT_FOUND error. - * - *

Note: This operation is designed to be used for building permission-aware UIs and - * command-line tools, not for authorization checking. This operation may "fail open" without - * warning. - * - *

Sample code: - * - *


-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
-   *   List<String> permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(formattedResource, permissions);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy detail is being requested. See the - * operation documentation for the appropriate value for this field. - * @param permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead. - */ - @Deprecated - public final TestIamPermissionsResponse testIamPermissions( - String resource, List permissions) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(resource) - .addAllPermissions(permissions) - .build(); - return testIamPermissions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns permissions that a caller has on the specified resource. If theresource does not exist, - * this will return an empty set ofpermissions, not a `NOT_FOUND` error. - * - *

Note: This operation is designed to be used for buildingpermission-aware UIs and - * command-line tools, not for authorizationchecking. This operation may "fail open" without - * warning. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   ApiFuture future =
-   *       subscriptionAdminClient.testIamPermissionsCallable().futureCall(request);
-   *   // Do something.
-   *   TestIamPermissionsResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - testIamPermissionsCallable() { - return stub.testIamPermissionsCallable(); - } - - @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 ListSubscriptionsPagedResponse - extends AbstractPagedListResponse< - ListSubscriptionsRequest, - ListSubscriptionsResponse, - Subscription, - ListSubscriptionsPage, - ListSubscriptionsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListSubscriptionsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListSubscriptionsPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListSubscriptionsPagedResponse(ListSubscriptionsPage page) { - super(page, ListSubscriptionsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListSubscriptionsPage - extends AbstractPage< - ListSubscriptionsRequest, - ListSubscriptionsResponse, - Subscription, - ListSubscriptionsPage> { - - private ListSubscriptionsPage( - PageContext context, - ListSubscriptionsResponse response) { - super(context, response); - } - - private static ListSubscriptionsPage createEmptyPage() { - return new ListSubscriptionsPage(null, null); - } - - @Override - protected ListSubscriptionsPage createPage( - PageContext context, - ListSubscriptionsResponse response) { - return new ListSubscriptionsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListSubscriptionsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListSubscriptionsRequest, - ListSubscriptionsResponse, - Subscription, - ListSubscriptionsPage, - ListSubscriptionsFixedSizeCollection> { - - private ListSubscriptionsFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListSubscriptionsFixedSizeCollection createEmptyCollection() { - return new ListSubscriptionsFixedSizeCollection(null, 0); - } - - @Override - protected ListSubscriptionsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListSubscriptionsFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListSnapshotsPagedResponse - extends AbstractPagedListResponse< - ListSnapshotsRequest, - ListSnapshotsResponse, - Snapshot, - ListSnapshotsPage, - ListSnapshotsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListSnapshotsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListSnapshotsPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListSnapshotsPagedResponse(ListSnapshotsPage page) { - super(page, ListSnapshotsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListSnapshotsPage - extends AbstractPage< - ListSnapshotsRequest, ListSnapshotsResponse, Snapshot, ListSnapshotsPage> { - - private ListSnapshotsPage( - PageContext context, - ListSnapshotsResponse response) { - super(context, response); - } - - private static ListSnapshotsPage createEmptyPage() { - return new ListSnapshotsPage(null, null); - } - - @Override - protected ListSnapshotsPage createPage( - PageContext context, - ListSnapshotsResponse response) { - return new ListSnapshotsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListSnapshotsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListSnapshotsRequest, - ListSnapshotsResponse, - Snapshot, - ListSnapshotsPage, - ListSnapshotsFixedSizeCollection> { - - private ListSnapshotsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListSnapshotsFixedSizeCollection createEmptyCollection() { - return new ListSnapshotsFixedSizeCollection(null, 0); - } - - @Override - protected ListSnapshotsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListSnapshotsFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java deleted file mode 100644 index 7f50be718..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Copyright 2023 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.SubscriptionAdminClient.ListSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPagedResponse; - -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.httpjson.InstantiatingHttpJsonChannelProvider; -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.StreamingCallSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.pubsub.v1.stub.SubscriberStubSettings; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.AcknowledgeRequest; -import com.google.pubsub.v1.CreateSnapshotRequest; -import com.google.pubsub.v1.DeleteSnapshotRequest; -import com.google.pubsub.v1.DeleteSubscriptionRequest; -import com.google.pubsub.v1.GetSnapshotRequest; -import com.google.pubsub.v1.GetSubscriptionRequest; -import com.google.pubsub.v1.ListSnapshotsRequest; -import com.google.pubsub.v1.ListSnapshotsResponse; -import com.google.pubsub.v1.ListSubscriptionsRequest; -import com.google.pubsub.v1.ListSubscriptionsResponse; -import com.google.pubsub.v1.ModifyAckDeadlineRequest; -import com.google.pubsub.v1.ModifyPushConfigRequest; -import com.google.pubsub.v1.PullRequest; -import com.google.pubsub.v1.PullResponse; -import com.google.pubsub.v1.SeekRequest; -import com.google.pubsub.v1.SeekResponse; -import com.google.pubsub.v1.Snapshot; -import com.google.pubsub.v1.StreamingPullRequest; -import com.google.pubsub.v1.StreamingPullResponse; -import com.google.pubsub.v1.Subscription; -import com.google.pubsub.v1.UpdateSnapshotRequest; -import com.google.pubsub.v1.UpdateSubscriptionRequest; -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 SubscriptionAdminClient}. - * - *

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 createSubscription to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SubscriptionAdminSettings.Builder subscriptionAdminSettingsBuilder =
- *     SubscriptionAdminSettings.newBuilder();
- * subscriptionAdminSettingsBuilder
- *     .createSubscriptionSettings()
- *     .setRetrySettings(
- *         subscriptionAdminSettingsBuilder
- *             .createSubscriptionSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SubscriptionAdminSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class SubscriptionAdminSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createSubscription. */ - public UnaryCallSettings createSubscriptionSettings() { - return ((SubscriberStubSettings) getStubSettings()).createSubscriptionSettings(); - } - - /** Returns the object with the settings used for calls to getSubscription. */ - public UnaryCallSettings getSubscriptionSettings() { - return ((SubscriberStubSettings) getStubSettings()).getSubscriptionSettings(); - } - - /** Returns the object with the settings used for calls to updateSubscription. */ - public UnaryCallSettings updateSubscriptionSettings() { - return ((SubscriberStubSettings) getStubSettings()).updateSubscriptionSettings(); - } - - /** Returns the object with the settings used for calls to listSubscriptions. */ - public PagedCallSettings< - ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> - listSubscriptionsSettings() { - return ((SubscriberStubSettings) getStubSettings()).listSubscriptionsSettings(); - } - - /** Returns the object with the settings used for calls to deleteSubscription. */ - public UnaryCallSettings deleteSubscriptionSettings() { - return ((SubscriberStubSettings) getStubSettings()).deleteSubscriptionSettings(); - } - - /** Returns the object with the settings used for calls to modifyAckDeadline. */ - public UnaryCallSettings modifyAckDeadlineSettings() { - return ((SubscriberStubSettings) getStubSettings()).modifyAckDeadlineSettings(); - } - - /** Returns the object with the settings used for calls to acknowledge. */ - public UnaryCallSettings acknowledgeSettings() { - return ((SubscriberStubSettings) getStubSettings()).acknowledgeSettings(); - } - - /** Returns the object with the settings used for calls to pull. */ - public UnaryCallSettings pullSettings() { - return ((SubscriberStubSettings) getStubSettings()).pullSettings(); - } - - /** Returns the object with the settings used for calls to streamingPull. */ - public StreamingCallSettings - streamingPullSettings() { - return ((SubscriberStubSettings) getStubSettings()).streamingPullSettings(); - } - - /** Returns the object with the settings used for calls to modifyPushConfig. */ - public UnaryCallSettings modifyPushConfigSettings() { - return ((SubscriberStubSettings) getStubSettings()).modifyPushConfigSettings(); - } - - /** Returns the object with the settings used for calls to getSnapshot. */ - public UnaryCallSettings getSnapshotSettings() { - return ((SubscriberStubSettings) getStubSettings()).getSnapshotSettings(); - } - - /** Returns the object with the settings used for calls to listSnapshots. */ - public PagedCallSettings - listSnapshotsSettings() { - return ((SubscriberStubSettings) getStubSettings()).listSnapshotsSettings(); - } - - /** Returns the object with the settings used for calls to createSnapshot. */ - public UnaryCallSettings createSnapshotSettings() { - return ((SubscriberStubSettings) getStubSettings()).createSnapshotSettings(); - } - - /** Returns the object with the settings used for calls to updateSnapshot. */ - public UnaryCallSettings updateSnapshotSettings() { - return ((SubscriberStubSettings) getStubSettings()).updateSnapshotSettings(); - } - - /** Returns the object with the settings used for calls to deleteSnapshot. */ - public UnaryCallSettings deleteSnapshotSettings() { - return ((SubscriberStubSettings) getStubSettings()).deleteSnapshotSettings(); - } - - /** Returns the object with the settings used for calls to seek. */ - public UnaryCallSettings seekSettings() { - return ((SubscriberStubSettings) getStubSettings()).seekSettings(); - } - - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return ((SubscriberStubSettings) getStubSettings()).setIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return ((SubscriberStubSettings) getStubSettings()).getIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return ((SubscriberStubSettings) getStubSettings()).testIamPermissionsSettings(); - } - - public static final SubscriptionAdminSettings create(SubscriberStubSettings stub) - throws IOException { - return new SubscriptionAdminSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return SubscriberStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return SubscriberStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return SubscriberStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return SubscriberStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return SubscriberStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return SubscriberStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return SubscriberStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SubscriberStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 SubscriptionAdminSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for SubscriptionAdminSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(SubscriberStubSettings.newBuilder(clientContext)); - } - - protected Builder(SubscriptionAdminSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(SubscriberStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(SubscriberStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(SubscriberStubSettings.newHttpJsonBuilder()); - } - - public SubscriberStubSettings.Builder getStubSettingsBuilder() { - return ((SubscriberStubSettings.Builder) getStubSettings()); - } - - /** - * 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) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to createSubscription. */ - public UnaryCallSettings.Builder createSubscriptionSettings() { - return getStubSettingsBuilder().createSubscriptionSettings(); - } - - /** Returns the builder for the settings used for calls to getSubscription. */ - public UnaryCallSettings.Builder - getSubscriptionSettings() { - return getStubSettingsBuilder().getSubscriptionSettings(); - } - - /** Returns the builder for the settings used for calls to updateSubscription. */ - public UnaryCallSettings.Builder - updateSubscriptionSettings() { - return getStubSettingsBuilder().updateSubscriptionSettings(); - } - - /** Returns the builder for the settings used for calls to listSubscriptions. */ - public PagedCallSettings.Builder< - ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> - listSubscriptionsSettings() { - return getStubSettingsBuilder().listSubscriptionsSettings(); - } - - /** Returns the builder for the settings used for calls to deleteSubscription. */ - public UnaryCallSettings.Builder - deleteSubscriptionSettings() { - return getStubSettingsBuilder().deleteSubscriptionSettings(); - } - - /** Returns the builder for the settings used for calls to modifyAckDeadline. */ - public UnaryCallSettings.Builder modifyAckDeadlineSettings() { - return getStubSettingsBuilder().modifyAckDeadlineSettings(); - } - - /** Returns the builder for the settings used for calls to acknowledge. */ - public UnaryCallSettings.Builder acknowledgeSettings() { - return getStubSettingsBuilder().acknowledgeSettings(); - } - - /** Returns the builder for the settings used for calls to pull. */ - public UnaryCallSettings.Builder pullSettings() { - return getStubSettingsBuilder().pullSettings(); - } - - /** Returns the builder for the settings used for calls to streamingPull. */ - public StreamingCallSettings.Builder - streamingPullSettings() { - return getStubSettingsBuilder().streamingPullSettings(); - } - - /** Returns the builder for the settings used for calls to modifyPushConfig. */ - public UnaryCallSettings.Builder modifyPushConfigSettings() { - return getStubSettingsBuilder().modifyPushConfigSettings(); - } - - /** Returns the builder for the settings used for calls to getSnapshot. */ - public UnaryCallSettings.Builder getSnapshotSettings() { - return getStubSettingsBuilder().getSnapshotSettings(); - } - - /** Returns the builder for the settings used for calls to listSnapshots. */ - public PagedCallSettings.Builder< - ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> - listSnapshotsSettings() { - return getStubSettingsBuilder().listSnapshotsSettings(); - } - - /** Returns the builder for the settings used for calls to createSnapshot. */ - public UnaryCallSettings.Builder createSnapshotSettings() { - return getStubSettingsBuilder().createSnapshotSettings(); - } - - /** Returns the builder for the settings used for calls to updateSnapshot. */ - public UnaryCallSettings.Builder updateSnapshotSettings() { - return getStubSettingsBuilder().updateSnapshotSettings(); - } - - /** Returns the builder for the settings used for calls to deleteSnapshot. */ - public UnaryCallSettings.Builder deleteSnapshotSettings() { - return getStubSettingsBuilder().deleteSnapshotSettings(); - } - - /** Returns the builder for the settings used for calls to seek. */ - public UnaryCallSettings.Builder seekSettings() { - return getStubSettingsBuilder().seekSettings(); - } - - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return getStubSettingsBuilder().setIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getStubSettingsBuilder().getIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return getStubSettingsBuilder().testIamPermissionsSettings(); - } - - @Override - public SubscriptionAdminSettings build() throws IOException { - return new SubscriptionAdminSettings(this); - } - } -} 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 deleted file mode 100644 index 4e2652585..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java +++ /dev/null @@ -1,2205 +0,0 @@ -/* - * Copyright 2023 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.ApiFuture; -import com.google.api.core.ApiFutures; -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.PublisherStub; -import com.google.cloud.pubsub.v1.stub.PublisherStubSettings; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.pubsub.v1.DeleteTopicRequest; -import com.google.pubsub.v1.DetachSubscriptionRequest; -import com.google.pubsub.v1.DetachSubscriptionResponse; -import com.google.pubsub.v1.GetTopicRequest; -import com.google.pubsub.v1.ListTopicSnapshotsRequest; -import com.google.pubsub.v1.ListTopicSnapshotsResponse; -import com.google.pubsub.v1.ListTopicSubscriptionsRequest; -import com.google.pubsub.v1.ListTopicSubscriptionsResponse; -import com.google.pubsub.v1.ListTopicsRequest; -import com.google.pubsub.v1.ListTopicsResponse; -import com.google.pubsub.v1.ProjectName; -import com.google.pubsub.v1.ProjectTopicName; -import com.google.pubsub.v1.PublishRequest; -import com.google.pubsub.v1.PublishResponse; -import com.google.pubsub.v1.PubsubMessage; -import com.google.pubsub.v1.Topic; -import com.google.pubsub.v1.TopicName; -import com.google.pubsub.v1.UpdateTopicRequest; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: The service that an application uses to manipulate topics, and to send - * messages to a topic. - * - *

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

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
- *   TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
- *   Topic response = topicAdminClient.createTopic(name);
- * }
- * }
- * - *

Note: close() needs to be called on the TopicAdminClient object to clean up resources such as - * threads. In the example above, try-with-resources is used, which automatically calls close(). - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Methods
MethodDescriptionMethod Variants
CreateTopic

Creates the given topic with the given name. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • createTopic(Topic request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • createTopic(TopicName name) - *
  • createTopic(String name) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • createTopicCallable() - *
- *
UpdateTopic

Updates an existing topic. Note that certain properties of a topic are not modifiable.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • updateTopic(UpdateTopicRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • updateTopic(Topic topic, FieldMask updateMask) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • updateTopicCallable() - *
- *
Publish

Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • publish(PublishRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • publish(TopicName topic, List<PubsubMessage> messages) - *
  • publish(String topic, List<PubsubMessage> messages) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • publishCallable() - *
- *
GetTopic

Gets the configuration of a topic.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • getTopic(GetTopicRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • getTopic(TopicName topic) - *
  • getTopic(String topic) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • getTopicCallable() - *
- *
ListTopics

Lists matching topics.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • listTopics(ListTopicsRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • listTopics(ProjectName project) - *
  • listTopics(String project) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • listTopicsPagedCallable() - *
  • listTopicsCallable() - *
- *
ListTopicSubscriptions

Lists the names of the attached subscriptions on this topic.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • listTopicSubscriptions(ListTopicSubscriptionsRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • listTopicSubscriptions(TopicName topic) - *
  • listTopicSubscriptions(String topic) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • listTopicSubscriptionsPagedCallable() - *
  • listTopicSubscriptionsCallable() - *
- *
ListTopicSnapshots

Lists the names of the snapshots on this topic. 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.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • listTopicSnapshots(ListTopicSnapshotsRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • listTopicSnapshots(TopicName topic) - *
  • listTopicSnapshots(String topic) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • listTopicSnapshotsPagedCallable() - *
  • listTopicSnapshotsCallable() - *
- *
DeleteTopic

Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • deleteTopic(DeleteTopicRequest request) - *
- *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

- *
    - *
  • deleteTopic(TopicName topic) - *
  • deleteTopic(String topic) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • deleteTopicCallable() - *
- *
DetachSubscription

Detaches a subscription from this topic. All messages retained in the subscription are dropped. Subsequent `Pull` and `StreamingPull` requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will stop.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • detachSubscription(DetachSubscriptionRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • detachSubscriptionCallable() - *
- *
SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy. - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • setIamPolicy(SetIamPolicyRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • setIamPolicyCallable() - *
- *
GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • getIamPolicy(GetIamPolicyRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • getIamPolicyCallable() - *
- *
TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. - *

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

- *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

- *
    - *
  • testIamPermissions(TestIamPermissionsRequest request) - *
- *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

- *
    - *
  • testIamPermissionsCallable() - *
- *
- * - *

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 TopicAdminSettings to - * create(). For example: - * - *

To customize credentials: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * TopicAdminSettings topicAdminSettings =
- *     TopicAdminSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * TopicAdminClient topicAdminClient = TopicAdminClient.create(topicAdminSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * TopicAdminSettings topicAdminSettings =
- *     TopicAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
- * TopicAdminClient topicAdminClient = TopicAdminClient.create(topicAdminSettings);
- * }
- * - *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * TopicAdminSettings topicAdminSettings = TopicAdminSettings.newHttpJsonBuilder().build();
- * TopicAdminClient topicAdminClient = TopicAdminClient.create(topicAdminSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@Generated("by gapic-generator-java") -public class TopicAdminClient implements BackgroundResource { - private final TopicAdminSettings settings; - private final PublisherStub stub; - - /** Constructs an instance of TopicAdminClient with default settings. */ - public static final TopicAdminClient create() throws IOException { - return create(TopicAdminSettings.newBuilder().build()); - } - - /** - * Constructs an instance of TopicAdminClient, 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 TopicAdminClient create(TopicAdminSettings settings) throws IOException { - return new TopicAdminClient(settings); - } - - /** - * Constructs an instance of TopicAdminClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(TopicAdminSettings). - */ - public static final TopicAdminClient create(PublisherStub stub) { - return new TopicAdminClient(stub); - } - - /** - * Constructs an instance of TopicAdminClient, 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 TopicAdminClient(TopicAdminSettings settings) throws IOException { - this.settings = settings; - this.stub = ((PublisherStubSettings) settings.getStubSettings()).createStub(); - } - - protected TopicAdminClient(PublisherStub stub) { - this.settings = null; - this.stub = stub; - } - - public final TopicAdminSettings getSettings() { - return settings; - } - - public PublisherStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates the given topic with the given name. See the [resource name rules] - * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
-   *   Topic response = topicAdminClient.createTopic(name);
-   * }
-   * }
- * - * @param name Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only - * letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), - * tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in - * length, and it must not start with `"goog"`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Topic createTopic(TopicName name) { - Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build(); - return createTopic(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/pubsub-basics#resource_names). - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
-   *   Topic response = topicAdminClient.createTopic(name);
-   * }
-   * }
- * - * @param name Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only - * letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), - * tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in - * length, and it must not start with `"goog"`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Topic createTopic(String name) { - Topic request = Topic.newBuilder().setName(name).build(); - return createTopic(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Creates the given topic with the given name. See the <a - * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name - * rules</a>. - * - *

Sample code: - * - *


-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
-   *   Topic response = topicAdminClient.createTopic(name);
-   * }
-   * 
- * - * @param name Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only - * letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), - * tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in - * length, and it must not start with `"goog"`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #createTopic(TopicName)} instead. - */ - @Deprecated - public final Topic createTopic(ProjectTopicName name) { - Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build(); - return createTopic(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/pubsub-basics#resource_names). - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   Topic request =
-   *       Topic.newBuilder()
-   *           .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .putAllLabels(new HashMap())
-   *           .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build())
-   *           .setKmsKeyName("kmsKeyName412586233")
-   *           .setSchemaSettings(SchemaSettings.newBuilder().build())
-   *           .setSatisfiesPzs(true)
-   *           .setMessageRetentionDuration(Duration.newBuilder().build())
-   *           .build();
-   *   Topic response = topicAdminClient.createTopic(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 Topic createTopic(Topic request) { - return createTopicCallable().call(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/pubsub-basics#resource_names). - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   Topic request =
-   *       Topic.newBuilder()
-   *           .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .putAllLabels(new HashMap())
-   *           .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build())
-   *           .setKmsKeyName("kmsKeyName412586233")
-   *           .setSchemaSettings(SchemaSettings.newBuilder().build())
-   *           .setSatisfiesPzs(true)
-   *           .setMessageRetentionDuration(Duration.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = topicAdminClient.createTopicCallable().futureCall(request);
-   *   // Do something.
-   *   Topic response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createTopicCallable() { - return stub.createTopicCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an existing topic. Note that certain properties of a topic are not modifiable. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   Topic topic = Topic.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Topic response = topicAdminClient.updateTopic(topic, updateMask);
-   * }
-   * }
- * - * @param topic Required. The updated topic object. - * @param updateMask Required. Indicates which fields in the provided topic to update. Must be - * specified and non-empty. Note that if `update_mask` contains "message_storage_policy" but - * the `message_storage_policy` is not set in the `topic` provided above, then the updated - * value is determined by the policy configured at the project or organization level. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Topic updateTopic(Topic topic, FieldMask updateMask) { - UpdateTopicRequest request = - UpdateTopicRequest.newBuilder().setTopic(topic).setUpdateMask(updateMask).build(); - return updateTopic(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an existing topic. Note that certain properties of a topic are not modifiable. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   UpdateTopicRequest request =
-   *       UpdateTopicRequest.newBuilder()
-   *           .setTopic(Topic.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Topic response = topicAdminClient.updateTopic(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 Topic updateTopic(UpdateTopicRequest request) { - return updateTopicCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates an existing topic. Note that certain properties of a topic are not modifiable. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   UpdateTopicRequest request =
-   *       UpdateTopicRequest.newBuilder()
-   *           .setTopic(Topic.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = topicAdminClient.updateTopicCallable().futureCall(request);
-   *   // Do something.
-   *   Topic response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateTopicCallable() { - return stub.updateTopicCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
-   *   List messages = new ArrayList<>();
-   *   PublishResponse response = topicAdminClient.publish(topic, messages);
-   * }
-   * }
- * - * @param topic Required. The messages in the request will be published on this topic. Format is - * `projects/{project}/topics/{topic}`. - * @param messages Required. The messages to publish. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PublishResponse publish(TopicName topic, List messages) { - PublishRequest request = - PublishRequest.newBuilder() - .setTopic(topic == null ? null : topic.toString()) - .addAllMessages(messages) - .build(); - return publish(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
-   *   List messages = new ArrayList<>();
-   *   PublishResponse response = topicAdminClient.publish(topic, messages);
-   * }
-   * }
- * - * @param topic Required. The messages in the request will be published on this topic. Format is - * `projects/{project}/topics/{topic}`. - * @param messages Required. The messages to publish. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PublishResponse publish(String topic, List messages) { - PublishRequest request = - PublishRequest.newBuilder().setTopic(topic).addAllMessages(messages).build(); - return publish(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   PublishRequest request =
-   *       PublishRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .addAllMessages(new ArrayList())
-   *           .build();
-   *   PublishResponse response = topicAdminClient.publish(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 PublishResponse publish(PublishRequest request) { - return publishCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   PublishRequest request =
-   *       PublishRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .addAllMessages(new ArrayList())
-   *           .build();
-   *   ApiFuture future = topicAdminClient.publishCallable().futureCall(request);
-   *   // Do something.
-   *   PublishResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable publishCallable() { - return stub.publishCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration of a topic. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
-   *   Topic response = topicAdminClient.getTopic(topic);
-   * }
-   * }
- * - * @param topic Required. The name of the topic to get. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Topic getTopic(TopicName topic) { - GetTopicRequest request = - GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); - return getTopic(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration of a topic. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
-   *   Topic response = topicAdminClient.getTopic(topic);
-   * }
-   * }
- * - * @param topic Required. The name of the topic to get. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Topic getTopic(String topic) { - GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(topic).build(); - return getTopic(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets the configuration of a topic. - * - *

Sample code: - * - *


-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
-   *   Topic response = topicAdminClient.getTopic(topic);
-   * }
-   * 
- * - * @param topic Required. The name of the topic to get. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #getTopic(TopicName)} instead. - */ - @Deprecated - public final Topic getTopic(ProjectTopicName topic) { - GetTopicRequest request = - GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); - return getTopic(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration of a topic. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   GetTopicRequest request =
-   *       GetTopicRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .build();
-   *   Topic response = topicAdminClient.getTopic(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 Topic getTopic(GetTopicRequest request) { - return getTopicCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the configuration of a topic. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   GetTopicRequest request =
-   *       GetTopicRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .build();
-   *   ApiFuture future = topicAdminClient.getTopicCallable().futureCall(request);
-   *   // Do something.
-   *   Topic response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getTopicCallable() { - return stub.getTopicCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists matching topics. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectName project = ProjectName.of("[PROJECT]");
-   *   for (Topic element : topicAdminClient.listTopics(project).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param project Required. The name of the project in which to list topics. Format is - * `projects/{project-id}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListTopicsPagedResponse listTopics(ProjectName project) { - ListTopicsRequest request = - ListTopicsRequest.newBuilder() - .setProject(project == null ? null : project.toString()) - .build(); - return listTopics(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists matching topics. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String project = ProjectName.of("[PROJECT]").toString();
-   *   for (Topic element : topicAdminClient.listTopics(project).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param project Required. The name of the project in which to list topics. Format is - * `projects/{project-id}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListTopicsPagedResponse listTopics(String project) { - ListTopicsRequest request = ListTopicsRequest.newBuilder().setProject(project).build(); - return listTopics(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists matching topics. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ListTopicsRequest request =
-   *       ListTopicsRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (Topic element : topicAdminClient.listTopics(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 ListTopicsPagedResponse listTopics(ListTopicsRequest request) { - return listTopicsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists matching topics. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ListTopicsRequest request =
-   *       ListTopicsRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future = topicAdminClient.listTopicsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Topic element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listTopicsPagedCallable() { - return stub.listTopicsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists matching topics. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ListTopicsRequest request =
-   *       ListTopicsRequest.newBuilder()
-   *           .setProject(ProjectName.of("[PROJECT]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListTopicsResponse response = topicAdminClient.listTopicsCallable().call(request);
-   *     for (Topic element : response.getTopicsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listTopicsCallable() { - return stub.listTopicsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the names of the attached subscriptions on this topic. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
-   *   for (String element : topicAdminClient.listTopicSubscriptions(topic).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param topic Required. The name of the topic that subscriptions are attached to. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(TopicName topic) { - ListTopicSubscriptionsRequest request = - ListTopicSubscriptionsRequest.newBuilder() - .setTopic(topic == null ? null : topic.toString()) - .build(); - return listTopicSubscriptions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the names of the attached subscriptions on this topic. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
-   *   for (String element : topicAdminClient.listTopicSubscriptions(topic).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param topic Required. The name of the topic that subscriptions are attached to. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(String topic) { - ListTopicSubscriptionsRequest request = - ListTopicSubscriptionsRequest.newBuilder().setTopic(topic).build(); - return listTopicSubscriptions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists the names of the subscriptions on this topic. - * - *

Sample code: - * - *


-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
-   *   for (ProjectSubscriptionName element : topicAdminClient.listTopicSubscriptions(topic).iterateAllAsProjectSubscriptionName()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param topic Required. The name of the topic that subscriptions are attached to. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #listTopicSubscriptions(TopicName)} instead. - */ - @Deprecated - public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(ProjectTopicName topic) { - ListTopicSubscriptionsRequest request = - ListTopicSubscriptionsRequest.newBuilder() - .setTopic(topic == null ? null : topic.toString()) - .build(); - return listTopicSubscriptions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the names of the attached subscriptions on this topic. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ListTopicSubscriptionsRequest request =
-   *       ListTopicSubscriptionsRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (String element : topicAdminClient.listTopicSubscriptions(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 ListTopicSubscriptionsPagedResponse listTopicSubscriptions( - ListTopicSubscriptionsRequest request) { - return listTopicSubscriptionsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the names of the attached subscriptions on this topic. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ListTopicSubscriptionsRequest request =
-   *       ListTopicSubscriptionsRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       topicAdminClient.listTopicSubscriptionsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (String element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listTopicSubscriptionsPagedCallable() { - return stub.listTopicSubscriptionsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the names of the attached subscriptions on this topic. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ListTopicSubscriptionsRequest request =
-   *       ListTopicSubscriptionsRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListTopicSubscriptionsResponse response =
-   *         topicAdminClient.listTopicSubscriptionsCallable().call(request);
-   *     for (String element : response.getSubscriptionsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listTopicSubscriptionsCallable() { - return stub.listTopicSubscriptionsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the names of the snapshots on this topic. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
-   *   for (String element : topicAdminClient.listTopicSnapshots(topic).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param topic Required. The name of the topic that snapshots are attached to. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListTopicSnapshotsPagedResponse listTopicSnapshots(TopicName topic) { - ListTopicSnapshotsRequest request = - ListTopicSnapshotsRequest.newBuilder() - .setTopic(topic == null ? null : topic.toString()) - .build(); - return listTopicSnapshots(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the names of the snapshots on this topic. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
-   *   for (String element : topicAdminClient.listTopicSnapshots(topic).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param topic Required. The name of the topic that snapshots are attached to. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListTopicSnapshotsPagedResponse listTopicSnapshots(String topic) { - ListTopicSnapshotsRequest request = - ListTopicSnapshotsRequest.newBuilder().setTopic(topic).build(); - return listTopicSnapshots(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the names of the snapshots on this topic. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ListTopicSnapshotsRequest request =
-   *       ListTopicSnapshotsRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (String element : topicAdminClient.listTopicSnapshots(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 ListTopicSnapshotsPagedResponse listTopicSnapshots( - ListTopicSnapshotsRequest request) { - return listTopicSnapshotsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the names of the snapshots on this topic. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ListTopicSnapshotsRequest request =
-   *       ListTopicSnapshotsRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       topicAdminClient.listTopicSnapshotsPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (String element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listTopicSnapshotsPagedCallable() { - return stub.listTopicSnapshotsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the names of the snapshots on this topic. 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. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ListTopicSnapshotsRequest request =
-   *       ListTopicSnapshotsRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListTopicSnapshotsResponse response =
-   *         topicAdminClient.listTopicSnapshotsCallable().call(request);
-   *     for (String element : response.getSnapshotsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listTopicSnapshotsCallable() { - return stub.listTopicSnapshotsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a - * topic is deleted, a new topic may be created with the same name; this is an entirely new topic - * with none of the old configuration or subscriptions. Existing subscriptions to this topic are - * not deleted, but their `topic` field is set to `_deleted-topic_`. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
-   *   topicAdminClient.deleteTopic(topic);
-   * }
-   * }
- * - * @param topic Required. Name of the topic to delete. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteTopic(TopicName topic) { - DeleteTopicRequest request = - DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); - deleteTopic(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a - * topic is deleted, a new topic may be created with the same name; this is an entirely new topic - * with none of the old configuration or subscriptions. Existing subscriptions to this topic are - * not deleted, but their `topic` field is set to `_deleted-topic_`. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
-   *   topicAdminClient.deleteTopic(topic);
-   * }
-   * }
- * - * @param topic Required. Name of the topic to delete. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteTopic(String topic) { - DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(topic).build(); - deleteTopic(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a - * topic is deleted, a new topic may be created with the same name; this is an entirely new topic - * with none of the old configuration or subscriptions. Existing subscriptions to this topic are - * not deleted, but their `topic` field is set to `_deleted-topic_`. - * - *

Sample code: - * - *


-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
-   *   topicAdminClient.deleteTopic(topic);
-   * }
-   * 
- * - * @param topic Required. Name of the topic to delete. Format is - * `projects/{project}/topics/{topic}`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #deleteTopic(TopicName)} instead. - */ - @Deprecated - public final void deleteTopic(ProjectTopicName topic) { - DeleteTopicRequest request = - DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); - deleteTopic(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a - * topic is deleted, a new topic may be created with the same name; this is an entirely new topic - * with none of the old configuration or subscriptions. Existing subscriptions to this topic are - * not deleted, but their `topic` field is set to `_deleted-topic_`. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   DeleteTopicRequest request =
-   *       DeleteTopicRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .build();
-   *   topicAdminClient.deleteTopic(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 deleteTopic(DeleteTopicRequest request) { - deleteTopicCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a - * topic is deleted, a new topic may be created with the same name; this is an entirely new topic - * with none of the old configuration or subscriptions. Existing subscriptions to this topic are - * not deleted, but their `topic` field is set to `_deleted-topic_`. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   DeleteTopicRequest request =
-   *       DeleteTopicRequest.newBuilder()
-   *           .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
-   *           .build();
-   *   ApiFuture future = topicAdminClient.deleteTopicCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteTopicCallable() { - return stub.deleteTopicCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Detaches a subscription from this topic. All messages retained in the subscription are dropped. - * Subsequent `Pull` and `StreamingPull` requests will return FAILED_PRECONDITION. If the - * subscription is a push subscription, pushes to the endpoint will stop. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   DetachSubscriptionRequest request =
-   *       DetachSubscriptionRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .build();
-   *   DetachSubscriptionResponse response = topicAdminClient.detachSubscription(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 DetachSubscriptionResponse detachSubscription(DetachSubscriptionRequest request) { - return detachSubscriptionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Detaches a subscription from this topic. All messages retained in the subscription are dropped. - * Subsequent `Pull` and `StreamingPull` requests will return FAILED_PRECONDITION. If the - * subscription is a push subscription, pushes to the endpoint will stop. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   DetachSubscriptionRequest request =
-   *       DetachSubscriptionRequest.newBuilder()
-   *           .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
-   *           .build();
-   *   ApiFuture future =
-   *       topicAdminClient.detachSubscriptionCallable().futureCall(request);
-   *   // Do something.
-   *   DetachSubscriptionResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - detachSubscriptionCallable() { - return stub.detachSubscriptionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Sets the access control policy on the specified resource. Replacesany existing policy. - * - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   Policy response = topicAdminClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) { - return setIamPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Sets the access control policy on the specified resource. Replaces any existing policy. - * - *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED - * - *

Sample code: - * - *


-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
-   *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = topicAdminClient.setIamPolicy(formattedResource, policy);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy is being specified. See the - * operation documentation for the appropriate value for this field. - * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the - * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud - * Platform services (such as Projects) might reject them. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead. - */ - @Deprecated - public final Policy setIamPolicy(String resource, Policy policy) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); - return setIamPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Sets the access control policy on the specified resource. Replacesany existing policy. - * - *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = topicAdminClient.setIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable setIamPolicyCallable() { - return stub.setIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the access control policy for a resource. Returns an empty policyif the resource exists - * and does not have a policy set. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   Policy response = topicAdminClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) { - return getIamPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets the access control policy for a resource. Returns an empty policy if the resource exists - * and does not have a policy set. - * - *

Sample code: - * - *


-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
-   *   Policy response = topicAdminClient.getIamPolicy(formattedResource);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy is being requested. See the - * operation documentation for the appropriate value for this field. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead. - */ - @Deprecated - public final Policy getIamPolicy(String resource) { - GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); - return getIamPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets the access control policy for a resource. Returns an empty policyif the resource exists - * and does not have a policy set. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = topicAdminClient.getIamPolicyCallable().futureCall(request);
-   *   // Do something.
-   *   Policy response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getIamPolicyCallable() { - return stub.getIamPolicyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns permissions that a caller has on the specified resource. If theresource does not exist, - * this will return an empty set ofpermissions, not a `NOT_FOUND` error. - * - *

Note: This operation is designed to be used for buildingpermission-aware UIs and - * command-line tools, not for authorizationchecking. This operation may "fail open" without - * warning. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { - return testIamPermissionsCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Returns permissions that a caller has on the specified resource. If the resource does not - * exist, this will return an empty set of permissions, not a NOT_FOUND error. - * - *

Note: This operation is designed to be used for building permission-aware UIs and - * command-line tools, not for authorization checking. This operation may "fail open" without - * warning. - * - *

Sample code: - * - *


-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
-   *   List<String> permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy detail is being requested. See the - * operation documentation for the appropriate value for this field. - * @param permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead. - */ - @Deprecated - public final TestIamPermissionsResponse testIamPermissions( - String resource, List permissions) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(resource) - .addAllPermissions(permissions) - .build(); - return testIamPermissions(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Returns permissions that a caller has on the specified resource. If theresource does not exist, - * this will return an empty set ofpermissions, not a `NOT_FOUND` error. - * - *

Note: This operation is designed to be used for buildingpermission-aware UIs and - * command-line tools, not for authorizationchecking. This operation may "fail open" without - * warning. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
-   *           .addAllPermissions(new ArrayList())
-   *           .build();
-   *   ApiFuture future =
-   *       topicAdminClient.testIamPermissionsCallable().futureCall(request);
-   *   // Do something.
-   *   TestIamPermissionsResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - testIamPermissionsCallable() { - return stub.testIamPermissionsCallable(); - } - - @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 ListTopicsPagedResponse - extends AbstractPagedListResponse< - ListTopicsRequest, - ListTopicsResponse, - Topic, - ListTopicsPage, - ListTopicsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListTopicsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListTopicsPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListTopicsPagedResponse(ListTopicsPage page) { - super(page, ListTopicsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListTopicsPage - extends AbstractPage { - - private ListTopicsPage( - PageContext context, - ListTopicsResponse response) { - super(context, response); - } - - private static ListTopicsPage createEmptyPage() { - return new ListTopicsPage(null, null); - } - - @Override - protected ListTopicsPage createPage( - PageContext context, - ListTopicsResponse response) { - return new ListTopicsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListTopicsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListTopicsRequest, - ListTopicsResponse, - Topic, - ListTopicsPage, - ListTopicsFixedSizeCollection> { - - private ListTopicsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListTopicsFixedSizeCollection createEmptyCollection() { - return new ListTopicsFixedSizeCollection(null, 0); - } - - @Override - protected ListTopicsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListTopicsFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListTopicSubscriptionsPagedResponse - extends AbstractPagedListResponse< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - String, - ListTopicSubscriptionsPage, - ListTopicSubscriptionsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListTopicSubscriptionsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListTopicSubscriptionsPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListTopicSubscriptionsPagedResponse(ListTopicSubscriptionsPage page) { - super(page, ListTopicSubscriptionsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListTopicSubscriptionsPage - extends AbstractPage< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - String, - ListTopicSubscriptionsPage> { - - private ListTopicSubscriptionsPage( - PageContext context, - ListTopicSubscriptionsResponse response) { - super(context, response); - } - - private static ListTopicSubscriptionsPage createEmptyPage() { - return new ListTopicSubscriptionsPage(null, null); - } - - @Override - protected ListTopicSubscriptionsPage createPage( - PageContext context, - ListTopicSubscriptionsResponse response) { - return new ListTopicSubscriptionsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListTopicSubscriptionsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - String, - ListTopicSubscriptionsPage, - ListTopicSubscriptionsFixedSizeCollection> { - - private ListTopicSubscriptionsFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListTopicSubscriptionsFixedSizeCollection createEmptyCollection() { - return new ListTopicSubscriptionsFixedSizeCollection(null, 0); - } - - @Override - protected ListTopicSubscriptionsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListTopicSubscriptionsFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListTopicSnapshotsPagedResponse - extends AbstractPagedListResponse< - ListTopicSnapshotsRequest, - ListTopicSnapshotsResponse, - String, - ListTopicSnapshotsPage, - ListTopicSnapshotsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListTopicSnapshotsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListTopicSnapshotsPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListTopicSnapshotsPagedResponse(ListTopicSnapshotsPage page) { - super(page, ListTopicSnapshotsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListTopicSnapshotsPage - extends AbstractPage< - ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, String, ListTopicSnapshotsPage> { - - private ListTopicSnapshotsPage( - PageContext context, - ListTopicSnapshotsResponse response) { - super(context, response); - } - - private static ListTopicSnapshotsPage createEmptyPage() { - return new ListTopicSnapshotsPage(null, null); - } - - @Override - protected ListTopicSnapshotsPage createPage( - PageContext context, - ListTopicSnapshotsResponse response) { - return new ListTopicSnapshotsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListTopicSnapshotsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListTopicSnapshotsRequest, - ListTopicSnapshotsResponse, - String, - ListTopicSnapshotsPage, - ListTopicSnapshotsFixedSizeCollection> { - - private ListTopicSnapshotsFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListTopicSnapshotsFixedSizeCollection createEmptyCollection() { - return new ListTopicSnapshotsFixedSizeCollection(null, 0); - } - - @Override - protected ListTopicSnapshotsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListTopicSnapshotsFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java deleted file mode 100644 index 9dd62bda3..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright 2023 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.TopicAdminClient.ListTopicSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; - -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.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.BatchingCallSettings; -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.PublisherStubSettings; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.DeleteTopicRequest; -import com.google.pubsub.v1.DetachSubscriptionRequest; -import com.google.pubsub.v1.DetachSubscriptionResponse; -import com.google.pubsub.v1.GetTopicRequest; -import com.google.pubsub.v1.ListTopicSnapshotsRequest; -import com.google.pubsub.v1.ListTopicSnapshotsResponse; -import com.google.pubsub.v1.ListTopicSubscriptionsRequest; -import com.google.pubsub.v1.ListTopicSubscriptionsResponse; -import com.google.pubsub.v1.ListTopicsRequest; -import com.google.pubsub.v1.ListTopicsResponse; -import com.google.pubsub.v1.PublishRequest; -import com.google.pubsub.v1.PublishResponse; -import com.google.pubsub.v1.Topic; -import com.google.pubsub.v1.UpdateTopicRequest; -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 TopicAdminClient}. - * - *

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 createTopic to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * TopicAdminSettings.Builder topicAdminSettingsBuilder = TopicAdminSettings.newBuilder();
- * topicAdminSettingsBuilder
- *     .createTopicSettings()
- *     .setRetrySettings(
- *         topicAdminSettingsBuilder
- *             .createTopicSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * TopicAdminSettings topicAdminSettings = topicAdminSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class TopicAdminSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createTopic. */ - public UnaryCallSettings createTopicSettings() { - return ((PublisherStubSettings) getStubSettings()).createTopicSettings(); - } - - /** Returns the object with the settings used for calls to updateTopic. */ - public UnaryCallSettings updateTopicSettings() { - return ((PublisherStubSettings) getStubSettings()).updateTopicSettings(); - } - - /** Returns the object with the settings used for calls to publish. */ - public BatchingCallSettings publishSettings() { - return ((PublisherStubSettings) getStubSettings()).publishSettings(); - } - - /** Returns the object with the settings used for calls to getTopic. */ - public UnaryCallSettings getTopicSettings() { - return ((PublisherStubSettings) getStubSettings()).getTopicSettings(); - } - - /** Returns the object with the settings used for calls to listTopics. */ - public PagedCallSettings - listTopicsSettings() { - return ((PublisherStubSettings) getStubSettings()).listTopicsSettings(); - } - - /** Returns the object with the settings used for calls to listTopicSubscriptions. */ - public PagedCallSettings< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - ListTopicSubscriptionsPagedResponse> - listTopicSubscriptionsSettings() { - return ((PublisherStubSettings) getStubSettings()).listTopicSubscriptionsSettings(); - } - - /** Returns the object with the settings used for calls to listTopicSnapshots. */ - public PagedCallSettings< - ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> - listTopicSnapshotsSettings() { - return ((PublisherStubSettings) getStubSettings()).listTopicSnapshotsSettings(); - } - - /** Returns the object with the settings used for calls to deleteTopic. */ - public UnaryCallSettings deleteTopicSettings() { - return ((PublisherStubSettings) getStubSettings()).deleteTopicSettings(); - } - - /** Returns the object with the settings used for calls to detachSubscription. */ - public UnaryCallSettings - detachSubscriptionSettings() { - return ((PublisherStubSettings) getStubSettings()).detachSubscriptionSettings(); - } - - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return ((PublisherStubSettings) getStubSettings()).setIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return ((PublisherStubSettings) getStubSettings()).getIamPolicySettings(); - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return ((PublisherStubSettings) getStubSettings()).testIamPermissionsSettings(); - } - - public static final TopicAdminSettings create(PublisherStubSettings stub) throws IOException { - return new TopicAdminSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return PublisherStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return PublisherStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return PublisherStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return PublisherStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return PublisherStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return PublisherStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return PublisherStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return PublisherStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 TopicAdminSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for TopicAdminSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(PublisherStubSettings.newBuilder(clientContext)); - } - - protected Builder(TopicAdminSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(PublisherStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(PublisherStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(PublisherStubSettings.newHttpJsonBuilder()); - } - - public PublisherStubSettings.Builder getStubSettingsBuilder() { - return ((PublisherStubSettings.Builder) getStubSettings()); - } - - /** - * 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) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to createTopic. */ - public UnaryCallSettings.Builder createTopicSettings() { - return getStubSettingsBuilder().createTopicSettings(); - } - - /** Returns the builder for the settings used for calls to updateTopic. */ - public UnaryCallSettings.Builder updateTopicSettings() { - return getStubSettingsBuilder().updateTopicSettings(); - } - - /** Returns the builder for the settings used for calls to publish. */ - public BatchingCallSettings.Builder publishSettings() { - return getStubSettingsBuilder().publishSettings(); - } - - /** Returns the builder for the settings used for calls to getTopic. */ - public UnaryCallSettings.Builder getTopicSettings() { - return getStubSettingsBuilder().getTopicSettings(); - } - - /** Returns the builder for the settings used for calls to listTopics. */ - public PagedCallSettings.Builder - listTopicsSettings() { - return getStubSettingsBuilder().listTopicsSettings(); - } - - /** Returns the builder for the settings used for calls to listTopicSubscriptions. */ - public PagedCallSettings.Builder< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - ListTopicSubscriptionsPagedResponse> - listTopicSubscriptionsSettings() { - return getStubSettingsBuilder().listTopicSubscriptionsSettings(); - } - - /** Returns the builder for the settings used for calls to listTopicSnapshots. */ - public PagedCallSettings.Builder< - ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> - listTopicSnapshotsSettings() { - return getStubSettingsBuilder().listTopicSnapshotsSettings(); - } - - /** Returns the builder for the settings used for calls to deleteTopic. */ - public UnaryCallSettings.Builder deleteTopicSettings() { - return getStubSettingsBuilder().deleteTopicSettings(); - } - - /** Returns the builder for the settings used for calls to detachSubscription. */ - public UnaryCallSettings.Builder - detachSubscriptionSettings() { - return getStubSettingsBuilder().detachSubscriptionSettings(); - } - - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return getStubSettingsBuilder().setIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getStubSettingsBuilder().getIamPolicySettings(); - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return getStubSettingsBuilder().testIamPermissionsSettings(); - } - - @Override - public TopicAdminSettings build() throws IOException { - return new TopicAdminSettings(this); - } - } -} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json deleted file mode 100644 index 2cf1c90a4..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/gapic_metadata.json +++ /dev/null @@ -1,168 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "java", - "protoPackage": "google.pubsub.v1", - "libraryPackage": "com.google.cloud.pubsub.v1", - "services": { - "Publisher": { - "clients": { - "grpc": { - "libraryClient": "TopicAdminClient", - "rpcs": { - "CreateTopic": { - "methods": ["createTopic", "createTopic", "createTopic", "createTopicCallable"] - }, - "DeleteTopic": { - "methods": ["deleteTopic", "deleteTopic", "deleteTopic", "deleteTopicCallable"] - }, - "DetachSubscription": { - "methods": ["detachSubscription", "detachSubscriptionCallable"] - }, - "GetIamPolicy": { - "methods": ["getIamPolicy", "getIamPolicyCallable"] - }, - "GetTopic": { - "methods": ["getTopic", "getTopic", "getTopic", "getTopicCallable"] - }, - "ListTopicSnapshots": { - "methods": ["listTopicSnapshots", "listTopicSnapshots", "listTopicSnapshots", "listTopicSnapshotsPagedCallable", "listTopicSnapshotsCallable"] - }, - "ListTopicSubscriptions": { - "methods": ["listTopicSubscriptions", "listTopicSubscriptions", "listTopicSubscriptions", "listTopicSubscriptionsPagedCallable", "listTopicSubscriptionsCallable"] - }, - "ListTopics": { - "methods": ["listTopics", "listTopics", "listTopics", "listTopicsPagedCallable", "listTopicsCallable"] - }, - "Publish": { - "methods": ["publish", "publish", "publish", "publishCallable"] - }, - "SetIamPolicy": { - "methods": ["setIamPolicy", "setIamPolicyCallable"] - }, - "TestIamPermissions": { - "methods": ["testIamPermissions", "testIamPermissionsCallable"] - }, - "UpdateTopic": { - "methods": ["updateTopic", "updateTopic", "updateTopicCallable"] - } - } - } - } - }, - "Subscriber": { - "clients": { - "grpc": { - "libraryClient": "SubscriptionAdminClient", - "rpcs": { - "Acknowledge": { - "methods": ["acknowledge", "acknowledge", "acknowledge", "acknowledgeCallable"] - }, - "CreateSnapshot": { - "methods": ["createSnapshot", "createSnapshot", "createSnapshot", "createSnapshot", "createSnapshot", "createSnapshotCallable"] - }, - "CreateSubscription": { - "methods": ["createSubscription", "createSubscription", "createSubscription", "createSubscription", "createSubscription", "createSubscriptionCallable"] - }, - "DeleteSnapshot": { - "methods": ["deleteSnapshot", "deleteSnapshot", "deleteSnapshot", "deleteSnapshotCallable"] - }, - "DeleteSubscription": { - "methods": ["deleteSubscription", "deleteSubscription", "deleteSubscription", "deleteSubscriptionCallable"] - }, - "GetIamPolicy": { - "methods": ["getIamPolicy", "getIamPolicyCallable"] - }, - "GetSnapshot": { - "methods": ["getSnapshot", "getSnapshot", "getSnapshot", "getSnapshotCallable"] - }, - "GetSubscription": { - "methods": ["getSubscription", "getSubscription", "getSubscription", "getSubscriptionCallable"] - }, - "ListSnapshots": { - "methods": ["listSnapshots", "listSnapshots", "listSnapshots", "listSnapshotsPagedCallable", "listSnapshotsCallable"] - }, - "ListSubscriptions": { - "methods": ["listSubscriptions", "listSubscriptions", "listSubscriptions", "listSubscriptionsPagedCallable", "listSubscriptionsCallable"] - }, - "ModifyAckDeadline": { - "methods": ["modifyAckDeadline", "modifyAckDeadline", "modifyAckDeadline", "modifyAckDeadlineCallable"] - }, - "ModifyPushConfig": { - "methods": ["modifyPushConfig", "modifyPushConfig", "modifyPushConfig", "modifyPushConfigCallable"] - }, - "Pull": { - "methods": ["pull", "pull", "pull", "pull", "pull", "pullCallable"] - }, - "Seek": { - "methods": ["seek", "seekCallable"] - }, - "SetIamPolicy": { - "methods": ["setIamPolicy", "setIamPolicyCallable"] - }, - "StreamingPull": { - "methods": ["streamingPullCallable"] - }, - "TestIamPermissions": { - "methods": ["testIamPermissions", "testIamPermissionsCallable"] - }, - "UpdateSnapshot": { - "methods": ["updateSnapshot", "updateSnapshot", "updateSnapshotCallable"] - }, - "UpdateSubscription": { - "methods": ["updateSubscription", "updateSubscription", "updateSubscriptionCallable"] - } - } - } - } - }, - "SchemaService": { - "clients": { - "grpc": { - "libraryClient": "SchemaServiceClient", - "rpcs": { - "CommitSchema": { - "methods": ["commitSchema", "commitSchema", "commitSchema", "commitSchemaCallable"] - }, - "CreateSchema": { - "methods": ["createSchema", "createSchema", "createSchema", "createSchemaCallable"] - }, - "DeleteSchema": { - "methods": ["deleteSchema", "deleteSchema", "deleteSchema", "deleteSchemaCallable"] - }, - "DeleteSchemaRevision": { - "methods": ["deleteSchemaRevision", "deleteSchemaRevision", "deleteSchemaRevision", "deleteSchemaRevisionCallable"] - }, - "GetIamPolicy": { - "methods": ["getIamPolicy", "getIamPolicyCallable"] - }, - "GetSchema": { - "methods": ["getSchema", "getSchema", "getSchema", "getSchemaCallable"] - }, - "ListSchemaRevisions": { - "methods": ["listSchemaRevisions", "listSchemaRevisions", "listSchemaRevisions", "listSchemaRevisionsPagedCallable", "listSchemaRevisionsCallable"] - }, - "ListSchemas": { - "methods": ["listSchemas", "listSchemas", "listSchemas", "listSchemasPagedCallable", "listSchemasCallable"] - }, - "RollbackSchema": { - "methods": ["rollbackSchema", "rollbackSchema", "rollbackSchema", "rollbackSchemaCallable"] - }, - "SetIamPolicy": { - "methods": ["setIamPolicy", "setIamPolicyCallable"] - }, - "TestIamPermissions": { - "methods": ["testIamPermissions", "testIamPermissionsCallable"] - }, - "ValidateMessage": { - "methods": ["validateMessage", "validateMessageCallable"] - }, - "ValidateSchema": { - "methods": ["validateSchema", "validateSchema", "validateSchema", "validateSchemaCallable"] - } - } - } - } - } - } -} \ No newline at end of file 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 deleted file mode 100644 index 5e73e3a64..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/package-info.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2023 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. - */ - -/** - * A client to Cloud Pub/Sub API - * - *

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

======================= TopicAdminClient ======================= - * - *

Service Description: The service that an application uses to manipulate topics, and to send - * messages to a topic. - * - *

Sample for TopicAdminClient: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
- *   TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
- *   Topic response = topicAdminClient.createTopic(name);
- * }
- * }
- * - *

======================= SubscriptionAdminClient ======================= - * - *

Service Description: The service that an application uses to manipulate subscriptions and to - * consume messages from a subscription via the `Pull` method or by establishing a bi-directional - * stream using the `StreamingPull` method. - * - *

Sample for SubscriptionAdminClient: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- *   SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
- *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
- *   PushConfig pushConfig = PushConfig.newBuilder().build();
- *   int ackDeadlineSeconds = 2135351438;
- *   Subscription response =
- *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
- * }
- * }
- * - *

======================= SchemaServiceClient ======================= - * - *

Service Description: Service for doing schema-related operations. - * - *

Sample for SchemaServiceClient: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
- *   ProjectName parent = ProjectName.of("[PROJECT]");
- *   Schema schema = Schema.newBuilder().build();
- *   String schemaId = "schemaId-697673060";
- *   Schema response = schemaServiceClient.createSchema(parent, schema, schemaId);
- * }
- * }
- */ -@Generated("by gapic-generator-java") -package com.google.cloud.pubsub.v1; - -import javax.annotation.Generated; diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java deleted file mode 100644 index 60af80164..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2023 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.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.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Publisher service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -public class GrpcPublisherCallableFactory 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 callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java deleted file mode 100644 index d4c26515d..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java +++ /dev/null @@ -1,547 +0,0 @@ -/* - * Copyright 2023 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.TopicAdminClient.ListTopicSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; - -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.RequestParamsBuilder; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.DeleteTopicRequest; -import com.google.pubsub.v1.DetachSubscriptionRequest; -import com.google.pubsub.v1.DetachSubscriptionResponse; -import com.google.pubsub.v1.GetTopicRequest; -import com.google.pubsub.v1.ListTopicSnapshotsRequest; -import com.google.pubsub.v1.ListTopicSnapshotsResponse; -import com.google.pubsub.v1.ListTopicSubscriptionsRequest; -import com.google.pubsub.v1.ListTopicSubscriptionsResponse; -import com.google.pubsub.v1.ListTopicsRequest; -import com.google.pubsub.v1.ListTopicsResponse; -import com.google.pubsub.v1.PublishRequest; -import com.google.pubsub.v1.PublishResponse; -import com.google.pubsub.v1.Topic; -import com.google.pubsub.v1.UpdateTopicRequest; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Publisher service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public class GrpcPublisherStub extends PublisherStub { - private static final MethodDescriptor createTopicMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Publisher/CreateTopic") - .setRequestMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) - .build(); - - private static final MethodDescriptor updateTopicMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Publisher/UpdateTopic") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateTopicRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) - .build(); - - private static final MethodDescriptor publishMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Publisher/Publish") - .setRequestMarshaller(ProtoUtils.marshaller(PublishRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(PublishResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getTopicMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Publisher/GetTopic") - .setRequestMarshaller(ProtoUtils.marshaller(GetTopicRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listTopicsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Publisher/ListTopics") - .setRequestMarshaller(ProtoUtils.marshaller(ListTopicsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListTopicsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor< - ListTopicSubscriptionsRequest, ListTopicSubscriptionsResponse> - listTopicSubscriptionsMethodDescriptor = - MethodDescriptor - .newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Publisher/ListTopicSubscriptions") - .setRequestMarshaller( - ProtoUtils.marshaller(ListTopicSubscriptionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListTopicSubscriptionsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listTopicSnapshotsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Publisher/ListTopicSnapshots") - .setRequestMarshaller( - ProtoUtils.marshaller(ListTopicSnapshotsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListTopicSnapshotsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteTopicMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Publisher/DeleteTopic") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteTopicRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - detachSubscriptionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Publisher/DetachSubscription") - .setRequestMarshaller( - ProtoUtils.marshaller(DetachSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(DetachSubscriptionResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor setIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - testIamPermissionsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") - .setRequestMarshaller( - ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable createTopicCallable; - private final UnaryCallable updateTopicCallable; - private final UnaryCallable publishCallable; - private final UnaryCallable getTopicCallable; - private final UnaryCallable listTopicsCallable; - private final UnaryCallable listTopicsPagedCallable; - private final UnaryCallable - listTopicSubscriptionsCallable; - private final UnaryCallable - listTopicSubscriptionsPagedCallable; - private final UnaryCallable - listTopicSnapshotsCallable; - private final UnaryCallable - listTopicSnapshotsPagedCallable; - private final UnaryCallable deleteTopicCallable; - private final UnaryCallable - detachSubscriptionCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcPublisherStub create(PublisherStubSettings settings) throws IOException { - return new GrpcPublisherStub(settings, ClientContext.create(settings)); - } - - public static final GrpcPublisherStub create(ClientContext clientContext) throws IOException { - return new GrpcPublisherStub(PublisherStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcPublisherStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcPublisherStub( - PublisherStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcPublisherStub, 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 GrpcPublisherStub(PublisherStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcPublisherCallableFactory()); - } - - /** - * Constructs an instance of GrpcPublisherStub, 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 GrpcPublisherStub( - PublisherStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createTopicTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createTopicMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings updateTopicTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateTopicMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic.name", String.valueOf(request.getTopic().getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings publishTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(publishMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic", String.valueOf(request.getTopic())); - return builder.build(); - }) - .build(); - GrpcCallSettings getTopicTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getTopicMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic", String.valueOf(request.getTopic())); - return builder.build(); - }) - .build(); - GrpcCallSettings listTopicsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listTopicsMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("project", String.valueOf(request.getProject())); - return builder.build(); - }) - .build(); - GrpcCallSettings - listTopicSubscriptionsTransportSettings = - GrpcCallSettings - .newBuilder() - .setMethodDescriptor(listTopicSubscriptionsMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic", String.valueOf(request.getTopic())); - return builder.build(); - }) - .build(); - GrpcCallSettings - listTopicSnapshotsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listTopicSnapshotsMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic", String.valueOf(request.getTopic())); - return builder.build(); - }) - .build(); - GrpcCallSettings deleteTopicTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteTopicMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic", String.valueOf(request.getTopic())); - return builder.build(); - }) - .build(); - GrpcCallSettings - detachSubscriptionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(detachSubscriptionMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - GrpcCallSettings setIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - GrpcCallSettings getIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - GrpcCallSettings - testIamPermissionsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - - this.createTopicCallable = - callableFactory.createUnaryCallable( - createTopicTransportSettings, settings.createTopicSettings(), clientContext); - this.updateTopicCallable = - callableFactory.createUnaryCallable( - updateTopicTransportSettings, settings.updateTopicSettings(), clientContext); - this.publishCallable = - callableFactory.createBatchingCallable( - publishTransportSettings, settings.publishSettings(), clientContext); - this.getTopicCallable = - callableFactory.createUnaryCallable( - getTopicTransportSettings, settings.getTopicSettings(), clientContext); - this.listTopicsCallable = - callableFactory.createUnaryCallable( - listTopicsTransportSettings, settings.listTopicsSettings(), clientContext); - this.listTopicsPagedCallable = - callableFactory.createPagedCallable( - listTopicsTransportSettings, settings.listTopicsSettings(), clientContext); - this.listTopicSubscriptionsCallable = - callableFactory.createUnaryCallable( - listTopicSubscriptionsTransportSettings, - settings.listTopicSubscriptionsSettings(), - clientContext); - this.listTopicSubscriptionsPagedCallable = - callableFactory.createPagedCallable( - listTopicSubscriptionsTransportSettings, - settings.listTopicSubscriptionsSettings(), - clientContext); - this.listTopicSnapshotsCallable = - callableFactory.createUnaryCallable( - listTopicSnapshotsTransportSettings, - settings.listTopicSnapshotsSettings(), - clientContext); - this.listTopicSnapshotsPagedCallable = - callableFactory.createPagedCallable( - listTopicSnapshotsTransportSettings, - settings.listTopicSnapshotsSettings(), - clientContext); - this.deleteTopicCallable = - callableFactory.createUnaryCallable( - deleteTopicTransportSettings, settings.deleteTopicSettings(), clientContext); - this.detachSubscriptionCallable = - callableFactory.createUnaryCallable( - detachSubscriptionTransportSettings, - settings.detachSubscriptionSettings(), - clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createTopicCallable() { - return createTopicCallable; - } - - @Override - public UnaryCallable updateTopicCallable() { - return updateTopicCallable; - } - - @Override - public UnaryCallable publishCallable() { - return publishCallable; - } - - @Override - public UnaryCallable getTopicCallable() { - return getTopicCallable; - } - - @Override - public UnaryCallable listTopicsCallable() { - return listTopicsCallable; - } - - @Override - public UnaryCallable listTopicsPagedCallable() { - return listTopicsPagedCallable; - } - - @Override - public UnaryCallable - listTopicSubscriptionsCallable() { - return listTopicSubscriptionsCallable; - } - - @Override - public UnaryCallable - listTopicSubscriptionsPagedCallable() { - return listTopicSubscriptionsPagedCallable; - } - - @Override - public UnaryCallable - listTopicSnapshotsCallable() { - return listTopicSnapshotsCallable; - } - - @Override - public UnaryCallable - listTopicSnapshotsPagedCallable() { - return listTopicSnapshotsPagedCallable; - } - - @Override - public UnaryCallable deleteTopicCallable() { - return deleteTopicCallable; - } - - @Override - public UnaryCallable - detachSubscriptionCallable() { - return detachSubscriptionCallable; - } - - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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/GrpcSchemaServiceCallableFactory.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java deleted file mode 100644 index b7ad8cab4..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2023 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.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.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the SchemaService service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -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 callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, 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 deleted file mode 100644 index cbaf6a608..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java +++ /dev/null @@ -1,560 +0,0 @@ -/* - * Copyright 2023 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.ListSchemaRevisionsPagedResponse; -import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; - -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.RequestParamsBuilder; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.CommitSchemaRequest; -import com.google.pubsub.v1.CreateSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRevisionRequest; -import com.google.pubsub.v1.GetSchemaRequest; -import com.google.pubsub.v1.ListSchemaRevisionsRequest; -import com.google.pubsub.v1.ListSchemaRevisionsResponse; -import com.google.pubsub.v1.ListSchemasRequest; -import com.google.pubsub.v1.ListSchemasResponse; -import com.google.pubsub.v1.RollbackSchemaRequest; -import com.google.pubsub.v1.Schema; -import com.google.pubsub.v1.ValidateMessageRequest; -import com.google.pubsub.v1.ValidateMessageResponse; -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.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the SchemaService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -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 - listSchemaRevisionsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.SchemaService/ListSchemaRevisions") - .setRequestMarshaller( - ProtoUtils.marshaller(ListSchemaRevisionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListSchemaRevisionsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor commitSchemaMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.SchemaService/CommitSchema") - .setRequestMarshaller(ProtoUtils.marshaller(CommitSchemaRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - rollbackSchemaMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.SchemaService/RollbackSchema") - .setRequestMarshaller( - ProtoUtils.marshaller(RollbackSchemaRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - deleteSchemaRevisionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.SchemaService/DeleteSchemaRevision") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteSchemaRevisionRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteSchemaMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .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 static final MethodDescriptor setIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - testIamPermissionsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") - .setRequestMarshaller( - ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable createSchemaCallable; - private final UnaryCallable getSchemaCallable; - private final UnaryCallable listSchemasCallable; - private final UnaryCallable - listSchemasPagedCallable; - private final UnaryCallable - listSchemaRevisionsCallable; - private final UnaryCallable - listSchemaRevisionsPagedCallable; - private final UnaryCallable commitSchemaCallable; - private final UnaryCallable rollbackSchemaCallable; - private final UnaryCallable deleteSchemaRevisionCallable; - private final UnaryCallable deleteSchemaCallable; - private final UnaryCallable validateSchemaCallable; - private final UnaryCallable - validateMessageCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - 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; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createSchemaTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createSchemaMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("parent", String.valueOf(request.getParent())); - return builder.build(); - }) - .build(); - GrpcCallSettings getSchemaTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getSchemaMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings listSchemasTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listSchemasMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("parent", String.valueOf(request.getParent())); - return builder.build(); - }) - .build(); - GrpcCallSettings - listSchemaRevisionsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listSchemaRevisionsMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings commitSchemaTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(commitSchemaMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings rollbackSchemaTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(rollbackSchemaMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings deleteSchemaRevisionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteSchemaRevisionMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings deleteSchemaTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteSchemaMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings - validateSchemaTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(validateSchemaMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("parent", String.valueOf(request.getParent())); - return builder.build(); - }) - .build(); - GrpcCallSettings - validateMessageTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(validateMessageMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("parent", String.valueOf(request.getParent())); - return builder.build(); - }) - .build(); - GrpcCallSettings setIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - GrpcCallSettings getIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - GrpcCallSettings - testIamPermissionsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.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.listSchemaRevisionsCallable = - callableFactory.createUnaryCallable( - listSchemaRevisionsTransportSettings, - settings.listSchemaRevisionsSettings(), - clientContext); - this.listSchemaRevisionsPagedCallable = - callableFactory.createPagedCallable( - listSchemaRevisionsTransportSettings, - settings.listSchemaRevisionsSettings(), - clientContext); - this.commitSchemaCallable = - callableFactory.createUnaryCallable( - commitSchemaTransportSettings, settings.commitSchemaSettings(), clientContext); - this.rollbackSchemaCallable = - callableFactory.createUnaryCallable( - rollbackSchemaTransportSettings, settings.rollbackSchemaSettings(), clientContext); - this.deleteSchemaRevisionCallable = - callableFactory.createUnaryCallable( - deleteSchemaRevisionTransportSettings, - settings.deleteSchemaRevisionSettings(), - clientContext); - this.deleteSchemaCallable = - callableFactory.createUnaryCallable( - deleteSchemaTransportSettings, settings.deleteSchemaSettings(), clientContext); - this.validateSchemaCallable = - callableFactory.createUnaryCallable( - validateSchemaTransportSettings, settings.validateSchemaSettings(), clientContext); - this.validateMessageCallable = - callableFactory.createUnaryCallable( - validateMessageTransportSettings, settings.validateMessageSettings(), clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createSchemaCallable() { - return createSchemaCallable; - } - - @Override - public UnaryCallable getSchemaCallable() { - return getSchemaCallable; - } - - @Override - public UnaryCallable listSchemasCallable() { - return listSchemasCallable; - } - - @Override - public UnaryCallable listSchemasPagedCallable() { - return listSchemasPagedCallable; - } - - @Override - public UnaryCallable - listSchemaRevisionsCallable() { - return listSchemaRevisionsCallable; - } - - @Override - public UnaryCallable - listSchemaRevisionsPagedCallable() { - return listSchemaRevisionsPagedCallable; - } - - @Override - public UnaryCallable commitSchemaCallable() { - return commitSchemaCallable; - } - - @Override - public UnaryCallable rollbackSchemaCallable() { - return rollbackSchemaCallable; - } - - @Override - public UnaryCallable deleteSchemaRevisionCallable() { - return deleteSchemaRevisionCallable; - } - - @Override - public UnaryCallable deleteSchemaCallable() { - return deleteSchemaCallable; - } - - @Override - public UnaryCallable validateSchemaCallable() { - return validateSchemaCallable; - } - - @Override - public UnaryCallable validateMessageCallable() { - return validateMessageCallable; - } - - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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/GrpcSubscriberCallableFactory.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java deleted file mode 100644 index 27f99f671..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2023 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.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.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Subscriber service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -public class GrpcSubscriberCallableFactory 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 callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java deleted file mode 100644 index b3651167c..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java +++ /dev/null @@ -1,742 +0,0 @@ -/* - * Copyright 2023 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.SubscriptionAdminClient.ListSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPagedResponse; - -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.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsBuilder; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.AcknowledgeRequest; -import com.google.pubsub.v1.CreateSnapshotRequest; -import com.google.pubsub.v1.DeleteSnapshotRequest; -import com.google.pubsub.v1.DeleteSubscriptionRequest; -import com.google.pubsub.v1.GetSnapshotRequest; -import com.google.pubsub.v1.GetSubscriptionRequest; -import com.google.pubsub.v1.ListSnapshotsRequest; -import com.google.pubsub.v1.ListSnapshotsResponse; -import com.google.pubsub.v1.ListSubscriptionsRequest; -import com.google.pubsub.v1.ListSubscriptionsResponse; -import com.google.pubsub.v1.ModifyAckDeadlineRequest; -import com.google.pubsub.v1.ModifyPushConfigRequest; -import com.google.pubsub.v1.PullRequest; -import com.google.pubsub.v1.PullResponse; -import com.google.pubsub.v1.SeekRequest; -import com.google.pubsub.v1.SeekResponse; -import com.google.pubsub.v1.Snapshot; -import com.google.pubsub.v1.StreamingPullRequest; -import com.google.pubsub.v1.StreamingPullResponse; -import com.google.pubsub.v1.Subscription; -import com.google.pubsub.v1.UpdateSnapshotRequest; -import com.google.pubsub.v1.UpdateSubscriptionRequest; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Subscriber service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public class GrpcSubscriberStub extends SubscriberStub { - private static final MethodDescriptor - createSubscriptionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/CreateSubscription") - .setRequestMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getSubscriptionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/GetSubscription") - .setRequestMarshaller( - ProtoUtils.marshaller(GetSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - updateSubscriptionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/UpdateSubscription") - .setRequestMarshaller( - ProtoUtils.marshaller(UpdateSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listSubscriptionsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/ListSubscriptions") - .setRequestMarshaller( - ProtoUtils.marshaller(ListSubscriptionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListSubscriptionsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - deleteSubscriptionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/DeleteSubscription") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - modifyAckDeadlineMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/ModifyAckDeadline") - .setRequestMarshaller( - ProtoUtils.marshaller(ModifyAckDeadlineRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor acknowledgeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/Acknowledge") - .setRequestMarshaller(ProtoUtils.marshaller(AcknowledgeRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor pullMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/Pull") - .setRequestMarshaller(ProtoUtils.marshaller(PullRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(PullResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - streamingPullMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName("google.pubsub.v1.Subscriber/StreamingPull") - .setRequestMarshaller( - ProtoUtils.marshaller(StreamingPullRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(StreamingPullResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - modifyPushConfigMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/ModifyPushConfig") - .setRequestMarshaller( - ProtoUtils.marshaller(ModifyPushConfigRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getSnapshotMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/GetSnapshot") - .setRequestMarshaller(ProtoUtils.marshaller(GetSnapshotRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listSnapshotsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/ListSnapshots") - .setRequestMarshaller( - ProtoUtils.marshaller(ListSnapshotsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListSnapshotsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - createSnapshotMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/CreateSnapshot") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateSnapshotRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - updateSnapshotMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/UpdateSnapshot") - .setRequestMarshaller( - ProtoUtils.marshaller(UpdateSnapshotRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - deleteSnapshotMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/DeleteSnapshot") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteSnapshotRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor seekMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.pubsub.v1.Subscriber/Seek") - .setRequestMarshaller(ProtoUtils.marshaller(SeekRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(SeekResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor setIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getIamPolicyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") - .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - testIamPermissionsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") - .setRequestMarshaller( - ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable createSubscriptionCallable; - private final UnaryCallable getSubscriptionCallable; - private final UnaryCallable updateSubscriptionCallable; - private final UnaryCallable - listSubscriptionsCallable; - private final UnaryCallable - listSubscriptionsPagedCallable; - private final UnaryCallable deleteSubscriptionCallable; - private final UnaryCallable modifyAckDeadlineCallable; - private final UnaryCallable acknowledgeCallable; - private final UnaryCallable pullCallable; - private final BidiStreamingCallable - streamingPullCallable; - private final UnaryCallable modifyPushConfigCallable; - private final UnaryCallable getSnapshotCallable; - private final UnaryCallable listSnapshotsCallable; - private final UnaryCallable - listSnapshotsPagedCallable; - private final UnaryCallable createSnapshotCallable; - private final UnaryCallable updateSnapshotCallable; - private final UnaryCallable deleteSnapshotCallable; - private final UnaryCallable seekCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcSubscriberStub create(SubscriberStubSettings settings) - throws IOException { - return new GrpcSubscriberStub(settings, ClientContext.create(settings)); - } - - public static final GrpcSubscriberStub create(ClientContext clientContext) throws IOException { - return new GrpcSubscriberStub(SubscriberStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcSubscriberStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcSubscriberStub( - SubscriberStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcSubscriberStub, 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 GrpcSubscriberStub(SubscriberStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcSubscriberCallableFactory()); - } - - /** - * Constructs an instance of GrpcSubscriberStub, 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 GrpcSubscriberStub( - SubscriberStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createSubscriptionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createSubscriptionMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings getSubscriptionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getSubscriptionMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - GrpcCallSettings updateSubscriptionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateSubscriptionMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add( - "subscription.name", String.valueOf(request.getSubscription().getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings - listSubscriptionsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listSubscriptionsMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("project", String.valueOf(request.getProject())); - return builder.build(); - }) - .build(); - GrpcCallSettings deleteSubscriptionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteSubscriptionMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - GrpcCallSettings modifyAckDeadlineTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(modifyAckDeadlineMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - GrpcCallSettings acknowledgeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(acknowledgeMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - GrpcCallSettings pullTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(pullMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - GrpcCallSettings streamingPullTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(streamingPullMethodDescriptor) - .build(); - GrpcCallSettings modifyPushConfigTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(modifyPushConfigMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - GrpcCallSettings getSnapshotTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getSnapshotMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("snapshot", String.valueOf(request.getSnapshot())); - return builder.build(); - }) - .build(); - GrpcCallSettings listSnapshotsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listSnapshotsMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("project", String.valueOf(request.getProject())); - return builder.build(); - }) - .build(); - GrpcCallSettings createSnapshotTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createSnapshotMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings updateSnapshotTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateSnapshotMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("snapshot.name", String.valueOf(request.getSnapshot().getName())); - return builder.build(); - }) - .build(); - GrpcCallSettings deleteSnapshotTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteSnapshotMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("snapshot", String.valueOf(request.getSnapshot())); - return builder.build(); - }) - .build(); - GrpcCallSettings seekTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(seekMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - GrpcCallSettings setIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - GrpcCallSettings getIamPolicyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - GrpcCallSettings - testIamPermissionsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - - this.createSubscriptionCallable = - callableFactory.createUnaryCallable( - createSubscriptionTransportSettings, - settings.createSubscriptionSettings(), - clientContext); - this.getSubscriptionCallable = - callableFactory.createUnaryCallable( - getSubscriptionTransportSettings, settings.getSubscriptionSettings(), clientContext); - this.updateSubscriptionCallable = - callableFactory.createUnaryCallable( - updateSubscriptionTransportSettings, - settings.updateSubscriptionSettings(), - clientContext); - this.listSubscriptionsCallable = - callableFactory.createUnaryCallable( - listSubscriptionsTransportSettings, - settings.listSubscriptionsSettings(), - clientContext); - this.listSubscriptionsPagedCallable = - callableFactory.createPagedCallable( - listSubscriptionsTransportSettings, - settings.listSubscriptionsSettings(), - clientContext); - this.deleteSubscriptionCallable = - callableFactory.createUnaryCallable( - deleteSubscriptionTransportSettings, - settings.deleteSubscriptionSettings(), - clientContext); - this.modifyAckDeadlineCallable = - callableFactory.createUnaryCallable( - modifyAckDeadlineTransportSettings, - settings.modifyAckDeadlineSettings(), - clientContext); - this.acknowledgeCallable = - callableFactory.createUnaryCallable( - acknowledgeTransportSettings, settings.acknowledgeSettings(), clientContext); - this.pullCallable = - callableFactory.createUnaryCallable( - pullTransportSettings, settings.pullSettings(), clientContext); - this.streamingPullCallable = - callableFactory.createBidiStreamingCallable( - streamingPullTransportSettings, settings.streamingPullSettings(), clientContext); - this.modifyPushConfigCallable = - callableFactory.createUnaryCallable( - modifyPushConfigTransportSettings, settings.modifyPushConfigSettings(), clientContext); - this.getSnapshotCallable = - callableFactory.createUnaryCallable( - getSnapshotTransportSettings, settings.getSnapshotSettings(), clientContext); - this.listSnapshotsCallable = - callableFactory.createUnaryCallable( - listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); - this.listSnapshotsPagedCallable = - callableFactory.createPagedCallable( - listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); - this.createSnapshotCallable = - callableFactory.createUnaryCallable( - createSnapshotTransportSettings, settings.createSnapshotSettings(), clientContext); - this.updateSnapshotCallable = - callableFactory.createUnaryCallable( - updateSnapshotTransportSettings, settings.updateSnapshotSettings(), clientContext); - this.deleteSnapshotCallable = - callableFactory.createUnaryCallable( - deleteSnapshotTransportSettings, settings.deleteSnapshotSettings(), clientContext); - this.seekCallable = - callableFactory.createUnaryCallable( - seekTransportSettings, settings.seekSettings(), clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createSubscriptionCallable() { - return createSubscriptionCallable; - } - - @Override - public UnaryCallable getSubscriptionCallable() { - return getSubscriptionCallable; - } - - @Override - public UnaryCallable updateSubscriptionCallable() { - return updateSubscriptionCallable; - } - - @Override - public UnaryCallable - listSubscriptionsCallable() { - return listSubscriptionsCallable; - } - - @Override - public UnaryCallable - listSubscriptionsPagedCallable() { - return listSubscriptionsPagedCallable; - } - - @Override - public UnaryCallable deleteSubscriptionCallable() { - return deleteSubscriptionCallable; - } - - @Override - public UnaryCallable modifyAckDeadlineCallable() { - return modifyAckDeadlineCallable; - } - - @Override - public UnaryCallable acknowledgeCallable() { - return acknowledgeCallable; - } - - @Override - public UnaryCallable pullCallable() { - return pullCallable; - } - - @Override - public BidiStreamingCallable - streamingPullCallable() { - return streamingPullCallable; - } - - @Override - public UnaryCallable modifyPushConfigCallable() { - return modifyPushConfigCallable; - } - - @Override - public UnaryCallable getSnapshotCallable() { - return getSnapshotCallable; - } - - @Override - public UnaryCallable listSnapshotsCallable() { - return listSnapshotsCallable; - } - - @Override - public UnaryCallable - listSnapshotsPagedCallable() { - return listSnapshotsPagedCallable; - } - - @Override - public UnaryCallable createSnapshotCallable() { - return createSnapshotCallable; - } - - @Override - public UnaryCallable updateSnapshotCallable() { - return updateSnapshotCallable; - } - - @Override - public UnaryCallable deleteSnapshotCallable() { - return deleteSnapshotCallable; - } - - @Override - public UnaryCallable seekCallable() { - return seekCallable; - } - - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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/HttpJsonPublisherCallableFactory.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherCallableFactory.java deleted file mode 100644 index cd5b6e6f2..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2023 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.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Publisher service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonPublisherCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java deleted file mode 100644 index 5ae0dfc9e..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonPublisherStub.java +++ /dev/null @@ -1,911 +0,0 @@ -/* - * Copyright 2023 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.TopicAdminClient.ListTopicSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsBuilder; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.pubsub.v1.DeleteTopicRequest; -import com.google.pubsub.v1.DetachSubscriptionRequest; -import com.google.pubsub.v1.DetachSubscriptionResponse; -import com.google.pubsub.v1.GetTopicRequest; -import com.google.pubsub.v1.ListTopicSnapshotsRequest; -import com.google.pubsub.v1.ListTopicSnapshotsResponse; -import com.google.pubsub.v1.ListTopicSubscriptionsRequest; -import com.google.pubsub.v1.ListTopicSubscriptionsResponse; -import com.google.pubsub.v1.ListTopicsRequest; -import com.google.pubsub.v1.ListTopicsResponse; -import com.google.pubsub.v1.PublishRequest; -import com.google.pubsub.v1.PublishResponse; -import com.google.pubsub.v1.Topic; -import com.google.pubsub.v1.UpdateTopicRequest; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Publisher service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonPublisherStub extends PublisherStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor createTopicMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Publisher/CreateTopic") - .setHttpMethod("PUT") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/topics/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Topic.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor updateTopicMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Publisher/UpdateTopic") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{topic.name=projects/*/topics/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "topic.name", request.getTopic().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Topic.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - publishMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Publisher/Publish") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{topic=projects/*/topics/*}:publish", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "topic", request.getTopic()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearTopic().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PublishResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getTopicMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Publisher/GetTopic") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{topic=projects/*/topics/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "topic", request.getTopic()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Topic.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listTopicsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Publisher/ListTopics") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{project=projects/*}/topics", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "project", request.getProject()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListTopicsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor< - ListTopicSubscriptionsRequest, ListTopicSubscriptionsResponse> - listTopicSubscriptionsMethodDescriptor = - ApiMethodDescriptor - .newBuilder() - .setFullMethodName("google.pubsub.v1.Publisher/ListTopicSubscriptions") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{topic=projects/*/topics/*}/subscriptions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "topic", request.getTopic()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListTopicSubscriptionsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listTopicSnapshotsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Publisher/ListTopicSnapshots") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{topic=projects/*/topics/*}/snapshots", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "topic", request.getTopic()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListTopicSnapshotsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor deleteTopicMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Publisher/DeleteTopic") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{topic=projects/*/topics/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "topic", request.getTopic()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - detachSubscriptionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Publisher/DetachSubscription") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{subscription=projects/*/subscriptions/*}:detach", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "subscription", request.getSubscription()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(DetachSubscriptionResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - setIamPolicyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/topics/*}:setIamPolicy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setAdditionalPaths( - "/v1/{resource=projects/*/subscriptions/*}:setIamPolicy", - "/v1/{resource=projects/*/snapshots/*}:setIamPolicy", - "/v1/{resource=projects/*/schemas/*}:setIamPolicy") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Policy.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getIamPolicyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/topics/*}:getIamPolicy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setAdditionalPaths( - "/v1/{resource=projects/*/subscriptions/*}:getIamPolicy", - "/v1/{resource=projects/*/snapshots/*}:getIamPolicy", - "/v1/{resource=projects/*/schemas/*}:getIamPolicy") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Policy.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - testIamPermissionsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/subscriptions/*}:testIamPermissions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setAdditionalPaths( - "/v1/{resource=projects/*/topics/*}:testIamPermissions", - "/v1/{resource=projects/*/snapshots/*}:testIamPermissions", - "/v1/{resource=projects/*/schemas/*}:testIamPermissions") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createTopicCallable; - private final UnaryCallable updateTopicCallable; - private final UnaryCallable publishCallable; - private final UnaryCallable getTopicCallable; - private final UnaryCallable listTopicsCallable; - private final UnaryCallable listTopicsPagedCallable; - private final UnaryCallable - listTopicSubscriptionsCallable; - private final UnaryCallable - listTopicSubscriptionsPagedCallable; - private final UnaryCallable - listTopicSnapshotsCallable; - private final UnaryCallable - listTopicSnapshotsPagedCallable; - private final UnaryCallable deleteTopicCallable; - private final UnaryCallable - detachSubscriptionCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonPublisherStub create(PublisherStubSettings settings) - throws IOException { - return new HttpJsonPublisherStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonPublisherStub create(ClientContext clientContext) throws IOException { - return new HttpJsonPublisherStub( - PublisherStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonPublisherStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonPublisherStub( - PublisherStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonPublisherStub, 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 HttpJsonPublisherStub(PublisherStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonPublisherCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonPublisherStub, 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 HttpJsonPublisherStub( - PublisherStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createTopicTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createTopicMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings updateTopicTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateTopicMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic.name", String.valueOf(request.getTopic().getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings publishTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(publishMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic", String.valueOf(request.getTopic())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings getTopicTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getTopicMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic", String.valueOf(request.getTopic())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings listTopicsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTopicsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("project", String.valueOf(request.getProject())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - listTopicSubscriptionsTransportSettings = - HttpJsonCallSettings - .newBuilder() - .setMethodDescriptor(listTopicSubscriptionsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic", String.valueOf(request.getTopic())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - listTopicSnapshotsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTopicSnapshotsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic", String.valueOf(request.getTopic())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings deleteTopicTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTopicMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("topic", String.valueOf(request.getTopic())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - detachSubscriptionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(detachSubscriptionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings setIamPolicyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings getIamPolicyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - testIamPermissionsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - - this.createTopicCallable = - callableFactory.createUnaryCallable( - createTopicTransportSettings, settings.createTopicSettings(), clientContext); - this.updateTopicCallable = - callableFactory.createUnaryCallable( - updateTopicTransportSettings, settings.updateTopicSettings(), clientContext); - this.publishCallable = - callableFactory.createBatchingCallable( - publishTransportSettings, settings.publishSettings(), clientContext); - this.getTopicCallable = - callableFactory.createUnaryCallable( - getTopicTransportSettings, settings.getTopicSettings(), clientContext); - this.listTopicsCallable = - callableFactory.createUnaryCallable( - listTopicsTransportSettings, settings.listTopicsSettings(), clientContext); - this.listTopicsPagedCallable = - callableFactory.createPagedCallable( - listTopicsTransportSettings, settings.listTopicsSettings(), clientContext); - this.listTopicSubscriptionsCallable = - callableFactory.createUnaryCallable( - listTopicSubscriptionsTransportSettings, - settings.listTopicSubscriptionsSettings(), - clientContext); - this.listTopicSubscriptionsPagedCallable = - callableFactory.createPagedCallable( - listTopicSubscriptionsTransportSettings, - settings.listTopicSubscriptionsSettings(), - clientContext); - this.listTopicSnapshotsCallable = - callableFactory.createUnaryCallable( - listTopicSnapshotsTransportSettings, - settings.listTopicSnapshotsSettings(), - clientContext); - this.listTopicSnapshotsPagedCallable = - callableFactory.createPagedCallable( - listTopicSnapshotsTransportSettings, - settings.listTopicSnapshotsSettings(), - clientContext); - this.deleteTopicCallable = - callableFactory.createUnaryCallable( - deleteTopicTransportSettings, settings.deleteTopicSettings(), clientContext); - this.detachSubscriptionCallable = - callableFactory.createUnaryCallable( - detachSubscriptionTransportSettings, - settings.detachSubscriptionSettings(), - clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createTopicMethodDescriptor); - methodDescriptors.add(updateTopicMethodDescriptor); - methodDescriptors.add(publishMethodDescriptor); - methodDescriptors.add(getTopicMethodDescriptor); - methodDescriptors.add(listTopicsMethodDescriptor); - methodDescriptors.add(listTopicSubscriptionsMethodDescriptor); - methodDescriptors.add(listTopicSnapshotsMethodDescriptor); - methodDescriptors.add(deleteTopicMethodDescriptor); - methodDescriptors.add(detachSubscriptionMethodDescriptor); - methodDescriptors.add(setIamPolicyMethodDescriptor); - methodDescriptors.add(getIamPolicyMethodDescriptor); - methodDescriptors.add(testIamPermissionsMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createTopicCallable() { - return createTopicCallable; - } - - @Override - public UnaryCallable updateTopicCallable() { - return updateTopicCallable; - } - - @Override - public UnaryCallable publishCallable() { - return publishCallable; - } - - @Override - public UnaryCallable getTopicCallable() { - return getTopicCallable; - } - - @Override - public UnaryCallable listTopicsCallable() { - return listTopicsCallable; - } - - @Override - public UnaryCallable listTopicsPagedCallable() { - return listTopicsPagedCallable; - } - - @Override - public UnaryCallable - listTopicSubscriptionsCallable() { - return listTopicSubscriptionsCallable; - } - - @Override - public UnaryCallable - listTopicSubscriptionsPagedCallable() { - return listTopicSubscriptionsPagedCallable; - } - - @Override - public UnaryCallable - listTopicSnapshotsCallable() { - return listTopicSnapshotsCallable; - } - - @Override - public UnaryCallable - listTopicSnapshotsPagedCallable() { - return listTopicSnapshotsPagedCallable; - } - - @Override - public UnaryCallable deleteTopicCallable() { - return deleteTopicCallable; - } - - @Override - public UnaryCallable - detachSubscriptionCallable() { - return detachSubscriptionCallable; - } - - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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/HttpJsonSchemaServiceCallableFactory.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceCallableFactory.java deleted file mode 100644 index c1db412c1..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2023 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.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the SchemaService service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonSchemaServiceCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java deleted file mode 100644 index 186405096..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSchemaServiceStub.java +++ /dev/null @@ -1,962 +0,0 @@ -/* - * Copyright 2023 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.ListSchemaRevisionsPagedResponse; -import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsBuilder; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.pubsub.v1.CommitSchemaRequest; -import com.google.pubsub.v1.CreateSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRevisionRequest; -import com.google.pubsub.v1.GetSchemaRequest; -import com.google.pubsub.v1.ListSchemaRevisionsRequest; -import com.google.pubsub.v1.ListSchemaRevisionsResponse; -import com.google.pubsub.v1.ListSchemasRequest; -import com.google.pubsub.v1.ListSchemasResponse; -import com.google.pubsub.v1.RollbackSchemaRequest; -import com.google.pubsub.v1.Schema; -import com.google.pubsub.v1.ValidateMessageRequest; -import com.google.pubsub.v1.ValidateMessageResponse; -import com.google.pubsub.v1.ValidateSchemaRequest; -import com.google.pubsub.v1.ValidateSchemaResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the SchemaService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonSchemaServiceStub extends SchemaServiceStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - createSchemaMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.SchemaService/CreateSchema") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{parent=projects/*}/schemas", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "schemaId", request.getSchemaId()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("schema", request.getSchema(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Schema.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getSchemaMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.SchemaService/GetSchema") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/schemas/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "view", request.getViewValue()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Schema.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listSchemasMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.SchemaService/ListSchemas") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{parent=projects/*}/schemas", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "view", request.getViewValue()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListSchemasResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listSchemaRevisionsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.SchemaService/ListSchemaRevisions") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/schemas/*}:listRevisions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "view", request.getViewValue()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListSchemaRevisionsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - commitSchemaMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.SchemaService/CommitSchema") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/schemas/*}:commit", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Schema.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - rollbackSchemaMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.SchemaService/RollbackSchema") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/schemas/*}:rollback", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Schema.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - deleteSchemaRevisionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.SchemaService/DeleteSchemaRevision") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/schemas/*}:deleteRevision", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "revisionId", request.getRevisionId()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Schema.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - deleteSchemaMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.SchemaService/DeleteSchema") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/schemas/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - validateSchemaMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.SchemaService/ValidateSchema") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{parent=projects/*}/schemas:validate", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ValidateSchemaResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - validateMessageMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.SchemaService/ValidateMessage") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{parent=projects/*}/schemas:validateMessage", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ValidateMessageResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - setIamPolicyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/topics/*}:setIamPolicy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setAdditionalPaths( - "/v1/{resource=projects/*/subscriptions/*}:setIamPolicy", - "/v1/{resource=projects/*/snapshots/*}:setIamPolicy", - "/v1/{resource=projects/*/schemas/*}:setIamPolicy") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Policy.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getIamPolicyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/topics/*}:getIamPolicy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setAdditionalPaths( - "/v1/{resource=projects/*/subscriptions/*}:getIamPolicy", - "/v1/{resource=projects/*/snapshots/*}:getIamPolicy", - "/v1/{resource=projects/*/schemas/*}:getIamPolicy") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Policy.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - testIamPermissionsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/subscriptions/*}:testIamPermissions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setAdditionalPaths( - "/v1/{resource=projects/*/topics/*}:testIamPermissions", - "/v1/{resource=projects/*/snapshots/*}:testIamPermissions", - "/v1/{resource=projects/*/schemas/*}:testIamPermissions") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createSchemaCallable; - private final UnaryCallable getSchemaCallable; - private final UnaryCallable listSchemasCallable; - private final UnaryCallable - listSchemasPagedCallable; - private final UnaryCallable - listSchemaRevisionsCallable; - private final UnaryCallable - listSchemaRevisionsPagedCallable; - private final UnaryCallable commitSchemaCallable; - private final UnaryCallable rollbackSchemaCallable; - private final UnaryCallable deleteSchemaRevisionCallable; - private final UnaryCallable deleteSchemaCallable; - private final UnaryCallable validateSchemaCallable; - private final UnaryCallable - validateMessageCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonSchemaServiceStub create(SchemaServiceStubSettings settings) - throws IOException { - return new HttpJsonSchemaServiceStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonSchemaServiceStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonSchemaServiceStub( - SchemaServiceStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonSchemaServiceStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonSchemaServiceStub( - SchemaServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonSchemaServiceStub, 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 HttpJsonSchemaServiceStub( - SchemaServiceStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new HttpJsonSchemaServiceCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonSchemaServiceStub, 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 HttpJsonSchemaServiceStub( - SchemaServiceStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createSchemaTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createSchemaMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("parent", String.valueOf(request.getParent())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings getSchemaTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getSchemaMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings listSchemasTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listSchemasMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("parent", String.valueOf(request.getParent())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - listSchemaRevisionsTransportSettings = - HttpJsonCallSettings - .newBuilder() - .setMethodDescriptor(listSchemaRevisionsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings commitSchemaTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(commitSchemaMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings rollbackSchemaTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(rollbackSchemaMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - deleteSchemaRevisionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteSchemaRevisionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings deleteSchemaTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteSchemaMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - validateSchemaTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(validateSchemaMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("parent", String.valueOf(request.getParent())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - validateMessageTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(validateMessageMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("parent", String.valueOf(request.getParent())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings setIamPolicyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings getIamPolicyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - testIamPermissionsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.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.listSchemaRevisionsCallable = - callableFactory.createUnaryCallable( - listSchemaRevisionsTransportSettings, - settings.listSchemaRevisionsSettings(), - clientContext); - this.listSchemaRevisionsPagedCallable = - callableFactory.createPagedCallable( - listSchemaRevisionsTransportSettings, - settings.listSchemaRevisionsSettings(), - clientContext); - this.commitSchemaCallable = - callableFactory.createUnaryCallable( - commitSchemaTransportSettings, settings.commitSchemaSettings(), clientContext); - this.rollbackSchemaCallable = - callableFactory.createUnaryCallable( - rollbackSchemaTransportSettings, settings.rollbackSchemaSettings(), clientContext); - this.deleteSchemaRevisionCallable = - callableFactory.createUnaryCallable( - deleteSchemaRevisionTransportSettings, - settings.deleteSchemaRevisionSettings(), - clientContext); - this.deleteSchemaCallable = - callableFactory.createUnaryCallable( - deleteSchemaTransportSettings, settings.deleteSchemaSettings(), clientContext); - this.validateSchemaCallable = - callableFactory.createUnaryCallable( - validateSchemaTransportSettings, settings.validateSchemaSettings(), clientContext); - this.validateMessageCallable = - callableFactory.createUnaryCallable( - validateMessageTransportSettings, settings.validateMessageSettings(), clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createSchemaMethodDescriptor); - methodDescriptors.add(getSchemaMethodDescriptor); - methodDescriptors.add(listSchemasMethodDescriptor); - methodDescriptors.add(listSchemaRevisionsMethodDescriptor); - methodDescriptors.add(commitSchemaMethodDescriptor); - methodDescriptors.add(rollbackSchemaMethodDescriptor); - methodDescriptors.add(deleteSchemaRevisionMethodDescriptor); - methodDescriptors.add(deleteSchemaMethodDescriptor); - methodDescriptors.add(validateSchemaMethodDescriptor); - methodDescriptors.add(validateMessageMethodDescriptor); - methodDescriptors.add(setIamPolicyMethodDescriptor); - methodDescriptors.add(getIamPolicyMethodDescriptor); - methodDescriptors.add(testIamPermissionsMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createSchemaCallable() { - return createSchemaCallable; - } - - @Override - public UnaryCallable getSchemaCallable() { - return getSchemaCallable; - } - - @Override - public UnaryCallable listSchemasCallable() { - return listSchemasCallable; - } - - @Override - public UnaryCallable listSchemasPagedCallable() { - return listSchemasPagedCallable; - } - - @Override - public UnaryCallable - listSchemaRevisionsCallable() { - return listSchemaRevisionsCallable; - } - - @Override - public UnaryCallable - listSchemaRevisionsPagedCallable() { - return listSchemaRevisionsPagedCallable; - } - - @Override - public UnaryCallable commitSchemaCallable() { - return commitSchemaCallable; - } - - @Override - public UnaryCallable rollbackSchemaCallable() { - return rollbackSchemaCallable; - } - - @Override - public UnaryCallable deleteSchemaRevisionCallable() { - return deleteSchemaRevisionCallable; - } - - @Override - public UnaryCallable deleteSchemaCallable() { - return deleteSchemaCallable; - } - - @Override - public UnaryCallable validateSchemaCallable() { - return validateSchemaCallable; - } - - @Override - public UnaryCallable validateMessageCallable() { - return validateMessageCallable; - } - - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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/HttpJsonSubscriberCallableFactory.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberCallableFactory.java deleted file mode 100644 index 7acbff90f..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2023 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.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Subscriber service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonSubscriberCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java deleted file mode 100644 index 010a08bac..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/HttpJsonSubscriberStub.java +++ /dev/null @@ -1,1266 +0,0 @@ -/* - * Copyright 2023 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.SubscriptionAdminClient.ListSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.RequestParamsBuilder; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.pubsub.v1.AcknowledgeRequest; -import com.google.pubsub.v1.CreateSnapshotRequest; -import com.google.pubsub.v1.DeleteSnapshotRequest; -import com.google.pubsub.v1.DeleteSubscriptionRequest; -import com.google.pubsub.v1.GetSnapshotRequest; -import com.google.pubsub.v1.GetSubscriptionRequest; -import com.google.pubsub.v1.ListSnapshotsRequest; -import com.google.pubsub.v1.ListSnapshotsResponse; -import com.google.pubsub.v1.ListSubscriptionsRequest; -import com.google.pubsub.v1.ListSubscriptionsResponse; -import com.google.pubsub.v1.ModifyAckDeadlineRequest; -import com.google.pubsub.v1.ModifyPushConfigRequest; -import com.google.pubsub.v1.PullRequest; -import com.google.pubsub.v1.PullResponse; -import com.google.pubsub.v1.SeekRequest; -import com.google.pubsub.v1.SeekResponse; -import com.google.pubsub.v1.Snapshot; -import com.google.pubsub.v1.StreamingPullRequest; -import com.google.pubsub.v1.StreamingPullResponse; -import com.google.pubsub.v1.Subscription; -import com.google.pubsub.v1.UpdateSnapshotRequest; -import com.google.pubsub.v1.UpdateSubscriptionRequest; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Subscriber service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonSubscriberStub extends SubscriberStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - createSubscriptionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/CreateSubscription") - .setHttpMethod("PUT") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/subscriptions/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Subscription.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getSubscriptionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/GetSubscription") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{subscription=projects/*/subscriptions/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "subscription", request.getSubscription()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Subscription.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - updateSubscriptionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/UpdateSubscription") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{subscription.name=projects/*/subscriptions/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "subscription.name", request.getSubscription().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Subscription.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listSubscriptionsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/ListSubscriptions") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{project=projects/*}/subscriptions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "project", request.getProject()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListSubscriptionsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - deleteSubscriptionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/DeleteSubscription") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{subscription=projects/*/subscriptions/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "subscription", request.getSubscription()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - modifyAckDeadlineMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/ModifyAckDeadline") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "subscription", request.getSubscription()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody( - "*", request.toBuilder().clearSubscription().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor acknowledgeMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/Acknowledge") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{subscription=projects/*/subscriptions/*}:acknowledge", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "subscription", request.getSubscription()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearSubscription().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor pullMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/Pull") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{subscription=projects/*/subscriptions/*}:pull", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putPathParam(fields, "subscription", request.getSubscription()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearSubscription().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PullResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - modifyPushConfigMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/ModifyPushConfig") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "subscription", request.getSubscription()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody( - "*", request.toBuilder().clearSubscription().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getSnapshotMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/GetSnapshot") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{snapshot=projects/*/snapshots/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "snapshot", request.getSnapshot()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Snapshot.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listSnapshotsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/ListSnapshots") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{project=projects/*}/snapshots", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "project", request.getProject()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListSnapshotsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - createSnapshotMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/CreateSnapshot") - .setHttpMethod("PUT") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/snapshots/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Snapshot.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - updateSnapshotMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/UpdateSnapshot") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{snapshot.name=projects/*/snapshots/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "snapshot.name", request.getSnapshot().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Snapshot.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - deleteSnapshotMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/DeleteSnapshot") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{snapshot=projects/*/snapshots/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "snapshot", request.getSnapshot()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor seekMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.pubsub.v1.Subscriber/Seek") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{subscription=projects/*/subscriptions/*}:seek", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putPathParam(fields, "subscription", request.getSubscription()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearSubscription().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(SeekResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - setIamPolicyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/topics/*}:setIamPolicy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setAdditionalPaths( - "/v1/{resource=projects/*/subscriptions/*}:setIamPolicy", - "/v1/{resource=projects/*/snapshots/*}:setIamPolicy", - "/v1/{resource=projects/*/schemas/*}:setIamPolicy") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Policy.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getIamPolicyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/topics/*}:getIamPolicy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setAdditionalPaths( - "/v1/{resource=projects/*/subscriptions/*}:getIamPolicy", - "/v1/{resource=projects/*/snapshots/*}:getIamPolicy", - "/v1/{resource=projects/*/schemas/*}:getIamPolicy") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Policy.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - testIamPermissionsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{resource=projects/*/subscriptions/*}:testIamPermissions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "resource", request.getResource()); - return fields; - }) - .setAdditionalPaths( - "/v1/{resource=projects/*/topics/*}:testIamPermissions", - "/v1/{resource=projects/*/snapshots/*}:testIamPermissions", - "/v1/{resource=projects/*/schemas/*}:testIamPermissions") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createSubscriptionCallable; - private final UnaryCallable getSubscriptionCallable; - private final UnaryCallable updateSubscriptionCallable; - private final UnaryCallable - listSubscriptionsCallable; - private final UnaryCallable - listSubscriptionsPagedCallable; - private final UnaryCallable deleteSubscriptionCallable; - private final UnaryCallable modifyAckDeadlineCallable; - private final UnaryCallable acknowledgeCallable; - private final UnaryCallable pullCallable; - private final UnaryCallable modifyPushConfigCallable; - private final UnaryCallable getSnapshotCallable; - private final UnaryCallable listSnapshotsCallable; - private final UnaryCallable - listSnapshotsPagedCallable; - private final UnaryCallable createSnapshotCallable; - private final UnaryCallable updateSnapshotCallable; - private final UnaryCallable deleteSnapshotCallable; - private final UnaryCallable seekCallable; - private final UnaryCallable setIamPolicyCallable; - private final UnaryCallable getIamPolicyCallable; - private final UnaryCallable - testIamPermissionsCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonSubscriberStub create(SubscriberStubSettings settings) - throws IOException { - return new HttpJsonSubscriberStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonSubscriberStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonSubscriberStub( - SubscriberStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonSubscriberStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonSubscriberStub( - SubscriberStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonSubscriberStub, 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 HttpJsonSubscriberStub(SubscriberStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonSubscriberCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonSubscriberStub, 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 HttpJsonSubscriberStub( - SubscriberStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createSubscriptionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createSubscriptionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings getSubscriptionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getSubscriptionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - updateSubscriptionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateSubscriptionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add( - "subscription.name", String.valueOf(request.getSubscription().getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - listSubscriptionsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listSubscriptionsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("project", String.valueOf(request.getProject())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings deleteSubscriptionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteSubscriptionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings modifyAckDeadlineTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(modifyAckDeadlineMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings acknowledgeTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(acknowledgeMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings pullTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(pullMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings modifyPushConfigTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(modifyPushConfigMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings getSnapshotTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getSnapshotMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("snapshot", String.valueOf(request.getSnapshot())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - listSnapshotsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listSnapshotsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("project", String.valueOf(request.getProject())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings createSnapshotTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createSnapshotMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("name", String.valueOf(request.getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings updateSnapshotTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateSnapshotMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("snapshot.name", String.valueOf(request.getSnapshot().getName())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings deleteSnapshotTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteSnapshotMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("snapshot", String.valueOf(request.getSnapshot())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings seekTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(seekMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("subscription", String.valueOf(request.getSubscription())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings setIamPolicyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(setIamPolicyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings getIamPolicyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getIamPolicyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - HttpJsonCallSettings - testIamPermissionsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(testIamPermissionsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("resource", String.valueOf(request.getResource())); - return builder.build(); - }) - .build(); - - this.createSubscriptionCallable = - callableFactory.createUnaryCallable( - createSubscriptionTransportSettings, - settings.createSubscriptionSettings(), - clientContext); - this.getSubscriptionCallable = - callableFactory.createUnaryCallable( - getSubscriptionTransportSettings, settings.getSubscriptionSettings(), clientContext); - this.updateSubscriptionCallable = - callableFactory.createUnaryCallable( - updateSubscriptionTransportSettings, - settings.updateSubscriptionSettings(), - clientContext); - this.listSubscriptionsCallable = - callableFactory.createUnaryCallable( - listSubscriptionsTransportSettings, - settings.listSubscriptionsSettings(), - clientContext); - this.listSubscriptionsPagedCallable = - callableFactory.createPagedCallable( - listSubscriptionsTransportSettings, - settings.listSubscriptionsSettings(), - clientContext); - this.deleteSubscriptionCallable = - callableFactory.createUnaryCallable( - deleteSubscriptionTransportSettings, - settings.deleteSubscriptionSettings(), - clientContext); - this.modifyAckDeadlineCallable = - callableFactory.createUnaryCallable( - modifyAckDeadlineTransportSettings, - settings.modifyAckDeadlineSettings(), - clientContext); - this.acknowledgeCallable = - callableFactory.createUnaryCallable( - acknowledgeTransportSettings, settings.acknowledgeSettings(), clientContext); - this.pullCallable = - callableFactory.createUnaryCallable( - pullTransportSettings, settings.pullSettings(), clientContext); - this.modifyPushConfigCallable = - callableFactory.createUnaryCallable( - modifyPushConfigTransportSettings, settings.modifyPushConfigSettings(), clientContext); - this.getSnapshotCallable = - callableFactory.createUnaryCallable( - getSnapshotTransportSettings, settings.getSnapshotSettings(), clientContext); - this.listSnapshotsCallable = - callableFactory.createUnaryCallable( - listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); - this.listSnapshotsPagedCallable = - callableFactory.createPagedCallable( - listSnapshotsTransportSettings, settings.listSnapshotsSettings(), clientContext); - this.createSnapshotCallable = - callableFactory.createUnaryCallable( - createSnapshotTransportSettings, settings.createSnapshotSettings(), clientContext); - this.updateSnapshotCallable = - callableFactory.createUnaryCallable( - updateSnapshotTransportSettings, settings.updateSnapshotSettings(), clientContext); - this.deleteSnapshotCallable = - callableFactory.createUnaryCallable( - deleteSnapshotTransportSettings, settings.deleteSnapshotSettings(), clientContext); - this.seekCallable = - callableFactory.createUnaryCallable( - seekTransportSettings, settings.seekSettings(), clientContext); - this.setIamPolicyCallable = - callableFactory.createUnaryCallable( - setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); - this.getIamPolicyCallable = - callableFactory.createUnaryCallable( - getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); - this.testIamPermissionsCallable = - callableFactory.createUnaryCallable( - testIamPermissionsTransportSettings, - settings.testIamPermissionsSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createSubscriptionMethodDescriptor); - methodDescriptors.add(getSubscriptionMethodDescriptor); - methodDescriptors.add(updateSubscriptionMethodDescriptor); - methodDescriptors.add(listSubscriptionsMethodDescriptor); - methodDescriptors.add(deleteSubscriptionMethodDescriptor); - methodDescriptors.add(modifyAckDeadlineMethodDescriptor); - methodDescriptors.add(acknowledgeMethodDescriptor); - methodDescriptors.add(pullMethodDescriptor); - methodDescriptors.add(modifyPushConfigMethodDescriptor); - methodDescriptors.add(getSnapshotMethodDescriptor); - methodDescriptors.add(listSnapshotsMethodDescriptor); - methodDescriptors.add(createSnapshotMethodDescriptor); - methodDescriptors.add(updateSnapshotMethodDescriptor); - methodDescriptors.add(deleteSnapshotMethodDescriptor); - methodDescriptors.add(seekMethodDescriptor); - methodDescriptors.add(setIamPolicyMethodDescriptor); - methodDescriptors.add(getIamPolicyMethodDescriptor); - methodDescriptors.add(testIamPermissionsMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createSubscriptionCallable() { - return createSubscriptionCallable; - } - - @Override - public UnaryCallable getSubscriptionCallable() { - return getSubscriptionCallable; - } - - @Override - public UnaryCallable updateSubscriptionCallable() { - return updateSubscriptionCallable; - } - - @Override - public UnaryCallable - listSubscriptionsCallable() { - return listSubscriptionsCallable; - } - - @Override - public UnaryCallable - listSubscriptionsPagedCallable() { - return listSubscriptionsPagedCallable; - } - - @Override - public UnaryCallable deleteSubscriptionCallable() { - return deleteSubscriptionCallable; - } - - @Override - public UnaryCallable modifyAckDeadlineCallable() { - return modifyAckDeadlineCallable; - } - - @Override - public UnaryCallable acknowledgeCallable() { - return acknowledgeCallable; - } - - @Override - public UnaryCallable pullCallable() { - return pullCallable; - } - - @Override - public UnaryCallable modifyPushConfigCallable() { - return modifyPushConfigCallable; - } - - @Override - public UnaryCallable getSnapshotCallable() { - return getSnapshotCallable; - } - - @Override - public UnaryCallable listSnapshotsCallable() { - return listSnapshotsCallable; - } - - @Override - public UnaryCallable - listSnapshotsPagedCallable() { - return listSnapshotsPagedCallable; - } - - @Override - public UnaryCallable createSnapshotCallable() { - return createSnapshotCallable; - } - - @Override - public UnaryCallable updateSnapshotCallable() { - return updateSnapshotCallable; - } - - @Override - public UnaryCallable deleteSnapshotCallable() { - return deleteSnapshotCallable; - } - - @Override - public UnaryCallable seekCallable() { - return seekCallable; - } - - @Override - public UnaryCallable setIamPolicyCallable() { - return setIamPolicyCallable; - } - - @Override - public UnaryCallable getIamPolicyCallable() { - return getIamPolicyCallable; - } - - @Override - public UnaryCallable - testIamPermissionsCallable() { - return testIamPermissionsCallable; - } - - @Override - public BidiStreamingCallable - streamingPullCallable() { - throw new UnsupportedOperationException( - "Not implemented: streamingPullCallable(). REST transport is not implemented for this method yet."); - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @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/PublisherStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStub.java deleted file mode 100644 index 5b8ed6112..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStub.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2023 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.TopicAdminClient.ListTopicSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.DeleteTopicRequest; -import com.google.pubsub.v1.DetachSubscriptionRequest; -import com.google.pubsub.v1.DetachSubscriptionResponse; -import com.google.pubsub.v1.GetTopicRequest; -import com.google.pubsub.v1.ListTopicSnapshotsRequest; -import com.google.pubsub.v1.ListTopicSnapshotsResponse; -import com.google.pubsub.v1.ListTopicSubscriptionsRequest; -import com.google.pubsub.v1.ListTopicSubscriptionsResponse; -import com.google.pubsub.v1.ListTopicsRequest; -import com.google.pubsub.v1.ListTopicsResponse; -import com.google.pubsub.v1.PublishRequest; -import com.google.pubsub.v1.PublishResponse; -import com.google.pubsub.v1.Topic; -import com.google.pubsub.v1.UpdateTopicRequest; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Publisher service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public abstract class PublisherStub implements BackgroundResource { - - public UnaryCallable createTopicCallable() { - throw new UnsupportedOperationException("Not implemented: createTopicCallable()"); - } - - public UnaryCallable updateTopicCallable() { - throw new UnsupportedOperationException("Not implemented: updateTopicCallable()"); - } - - public UnaryCallable publishCallable() { - throw new UnsupportedOperationException("Not implemented: publishCallable()"); - } - - public UnaryCallable getTopicCallable() { - throw new UnsupportedOperationException("Not implemented: getTopicCallable()"); - } - - public UnaryCallable listTopicsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listTopicsPagedCallable()"); - } - - public UnaryCallable listTopicsCallable() { - throw new UnsupportedOperationException("Not implemented: listTopicsCallable()"); - } - - public UnaryCallable - listTopicSubscriptionsPagedCallable() { - throw new UnsupportedOperationException( - "Not implemented: listTopicSubscriptionsPagedCallable()"); - } - - public UnaryCallable - listTopicSubscriptionsCallable() { - throw new UnsupportedOperationException("Not implemented: listTopicSubscriptionsCallable()"); - } - - public UnaryCallable - listTopicSnapshotsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listTopicSnapshotsPagedCallable()"); - } - - public UnaryCallable - listTopicSnapshotsCallable() { - throw new UnsupportedOperationException("Not implemented: listTopicSnapshotsCallable()"); - } - - public UnaryCallable deleteTopicCallable() { - throw new UnsupportedOperationException("Not implemented: deleteTopicCallable()"); - } - - public UnaryCallable - detachSubscriptionCallable() { - throw new UnsupportedOperationException("Not implemented: detachSubscriptionCallable()"); - } - - public UnaryCallable setIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); - } - - public UnaryCallable getIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); - } - - public UnaryCallable - testIamPermissionsCallable() { - throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); - } - - @Override - public abstract void close(); -} 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 deleted file mode 100644 index f3c495688..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java +++ /dev/null @@ -1,949 +0,0 @@ -/* - * Copyright 2023 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.TopicAdminClient.ListTopicSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.batching.BatchingSettings; -import com.google.api.gax.batching.FlowControlSettings; -import com.google.api.gax.batching.FlowController; -import com.google.api.gax.batching.PartitionKey; -import com.google.api.gax.batching.RequestBuilder; -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.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.BatchedRequestIssuer; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BatchingDescriptor; -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.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.DeleteTopicRequest; -import com.google.pubsub.v1.DetachSubscriptionRequest; -import com.google.pubsub.v1.DetachSubscriptionResponse; -import com.google.pubsub.v1.GetTopicRequest; -import com.google.pubsub.v1.ListTopicSnapshotsRequest; -import com.google.pubsub.v1.ListTopicSnapshotsResponse; -import com.google.pubsub.v1.ListTopicSubscriptionsRequest; -import com.google.pubsub.v1.ListTopicSubscriptionsResponse; -import com.google.pubsub.v1.ListTopicsRequest; -import com.google.pubsub.v1.ListTopicsResponse; -import com.google.pubsub.v1.PublishRequest; -import com.google.pubsub.v1.PublishResponse; -import com.google.pubsub.v1.Topic; -import com.google.pubsub.v1.UpdateTopicRequest; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -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 PublisherStub}. - * - *

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 createTopic to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * PublisherStubSettings.Builder topicAdminSettingsBuilder = PublisherStubSettings.newBuilder();
- * topicAdminSettingsBuilder
- *     .createTopicSettings()
- *     .setRetrySettings(
- *         topicAdminSettingsBuilder
- *             .createTopicSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * PublisherStubSettings topicAdminSettings = topicAdminSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class PublisherStubSettings 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 createTopicSettings; - private final UnaryCallSettings updateTopicSettings; - private final BatchingCallSettings publishSettings; - private final UnaryCallSettings getTopicSettings; - private final PagedCallSettings - listTopicsSettings; - private final PagedCallSettings< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - ListTopicSubscriptionsPagedResponse> - listTopicSubscriptionsSettings; - private final PagedCallSettings< - ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> - listTopicSnapshotsSettings; - private final UnaryCallSettings deleteTopicSettings; - private final UnaryCallSettings - detachSubscriptionSettings; - private final UnaryCallSettings setIamPolicySettings; - private final UnaryCallSettings getIamPolicySettings; - private final UnaryCallSettings - testIamPermissionsSettings; - - private static final PagedListDescriptor - LIST_TOPICS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListTopicsRequest injectToken(ListTopicsRequest payload, String token) { - return ListTopicsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListTopicsRequest injectPageSize(ListTopicsRequest payload, int pageSize) { - return ListTopicsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListTopicsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListTopicsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListTopicsResponse payload) { - return payload.getTopicsList() == null - ? ImmutableList.of() - : payload.getTopicsList(); - } - }; - - private static final PagedListDescriptor< - ListTopicSubscriptionsRequest, ListTopicSubscriptionsResponse, String> - LIST_TOPIC_SUBSCRIPTIONS_PAGE_STR_DESC = - new PagedListDescriptor< - ListTopicSubscriptionsRequest, ListTopicSubscriptionsResponse, String>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListTopicSubscriptionsRequest injectToken( - ListTopicSubscriptionsRequest payload, String token) { - return ListTopicSubscriptionsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListTopicSubscriptionsRequest injectPageSize( - ListTopicSubscriptionsRequest payload, int pageSize) { - return ListTopicSubscriptionsRequest.newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - - @Override - public Integer extractPageSize(ListTopicSubscriptionsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListTopicSubscriptionsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListTopicSubscriptionsResponse payload) { - return payload.getSubscriptionsList() == null - ? ImmutableList.of() - : payload.getSubscriptionsList(); - } - }; - - private static final PagedListDescriptor< - ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, String> - LIST_TOPIC_SNAPSHOTS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListTopicSnapshotsRequest injectToken( - ListTopicSnapshotsRequest payload, String token) { - return ListTopicSnapshotsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListTopicSnapshotsRequest injectPageSize( - ListTopicSnapshotsRequest payload, int pageSize) { - return ListTopicSnapshotsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListTopicSnapshotsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListTopicSnapshotsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListTopicSnapshotsResponse payload) { - return payload.getSnapshotsList() == null - ? ImmutableList.of() - : payload.getSnapshotsList(); - } - }; - - private static final PagedListResponseFactory< - ListTopicsRequest, ListTopicsResponse, ListTopicsPagedResponse> - LIST_TOPICS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListTopicsRequest, ListTopicsResponse, ListTopicsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListTopicsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_TOPICS_PAGE_STR_DESC, request, context); - return ListTopicsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - ListTopicSubscriptionsPagedResponse> - LIST_TOPIC_SUBSCRIPTIONS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - ListTopicSubscriptionsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable - callable, - ListTopicSubscriptionsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_TOPIC_SUBSCRIPTIONS_PAGE_STR_DESC, request, context); - return ListTopicSubscriptionsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> - LIST_TOPIC_SNAPSHOTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListTopicSnapshotsRequest, - ListTopicSnapshotsResponse, - ListTopicSnapshotsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListTopicSnapshotsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_TOPIC_SNAPSHOTS_PAGE_STR_DESC, request, context); - return ListTopicSnapshotsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final BatchingDescriptor PUBLISH_BATCHING_DESC = - new BatchingDescriptor() { - @Override - public PartitionKey getBatchPartitionKey(PublishRequest request) { - return new PartitionKey(request.getTopic()); - } - - @Override - public RequestBuilder getRequestBuilder() { - return new RequestBuilder() { - private PublishRequest.Builder builder; - - @Override - public void appendRequest(PublishRequest request) { - if (builder == null) { - builder = request.toBuilder(); - } else { - builder.addAllMessages(request.getMessagesList()); - } - } - - @Override - public PublishRequest build() { - return builder.build(); - } - }; - } - - @Override - public void splitResponse( - PublishResponse batchResponse, - Collection> batch) { - int batchMessageIndex = 0; - for (BatchedRequestIssuer responder : batch) { - List subresponseElements = new ArrayList<>(); - long subresponseCount = responder.getMessageCount(); - for (int i = 0; i < subresponseCount; i++) { - subresponseElements.add(batchResponse.getMessageIds(batchMessageIndex++)); - } - PublishResponse response = - PublishResponse.newBuilder().addAllMessageIds(subresponseElements).build(); - responder.setResponse(response); - } - } - - @Override - public void splitException( - Throwable throwable, - Collection> batch) { - for (BatchedRequestIssuer responder : batch) { - responder.setException(throwable); - } - } - - @Override - public long countElements(PublishRequest request) { - return request.getMessagesCount(); - } - - @Override - public long countBytes(PublishRequest request) { - return request.getSerializedSize(); - } - }; - - /** Returns the object with the settings used for calls to createTopic. */ - public UnaryCallSettings createTopicSettings() { - return createTopicSettings; - } - - /** Returns the object with the settings used for calls to updateTopic. */ - public UnaryCallSettings updateTopicSettings() { - return updateTopicSettings; - } - - /** Returns the object with the settings used for calls to publish. */ - public BatchingCallSettings publishSettings() { - return publishSettings; - } - - /** Returns the object with the settings used for calls to getTopic. */ - public UnaryCallSettings getTopicSettings() { - return getTopicSettings; - } - - /** Returns the object with the settings used for calls to listTopics. */ - public PagedCallSettings - listTopicsSettings() { - return listTopicsSettings; - } - - /** Returns the object with the settings used for calls to listTopicSubscriptions. */ - public PagedCallSettings< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - ListTopicSubscriptionsPagedResponse> - listTopicSubscriptionsSettings() { - return listTopicSubscriptionsSettings; - } - - /** Returns the object with the settings used for calls to listTopicSnapshots. */ - public PagedCallSettings< - ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> - listTopicSnapshotsSettings() { - return listTopicSnapshotsSettings; - } - - /** Returns the object with the settings used for calls to deleteTopic. */ - public UnaryCallSettings deleteTopicSettings() { - return deleteTopicSettings; - } - - /** Returns the object with the settings used for calls to detachSubscription. */ - public UnaryCallSettings - detachSubscriptionSettings() { - return detachSubscriptionSettings; - } - - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - - public PublisherStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcPublisherStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonPublisherStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns the default service name. */ - @Override - public String getServiceName() { - return "pubsub"; - } - - /** 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 mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "pubsub.mtls.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) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - 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 defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(PublisherStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(PublisherStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return PublisherStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 PublisherStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createTopicSettings = settingsBuilder.createTopicSettings().build(); - updateTopicSettings = settingsBuilder.updateTopicSettings().build(); - publishSettings = settingsBuilder.publishSettings().build(); - getTopicSettings = settingsBuilder.getTopicSettings().build(); - listTopicsSettings = settingsBuilder.listTopicsSettings().build(); - listTopicSubscriptionsSettings = settingsBuilder.listTopicSubscriptionsSettings().build(); - listTopicSnapshotsSettings = settingsBuilder.listTopicSnapshotsSettings().build(); - deleteTopicSettings = settingsBuilder.deleteTopicSettings().build(); - detachSubscriptionSettings = settingsBuilder.detachSubscriptionSettings().build(); - setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); - getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); - testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); - } - - /** Builder for PublisherStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createTopicSettings; - private final UnaryCallSettings.Builder updateTopicSettings; - private final BatchingCallSettings.Builder publishSettings; - private final UnaryCallSettings.Builder getTopicSettings; - private final PagedCallSettings.Builder< - ListTopicsRequest, ListTopicsResponse, ListTopicsPagedResponse> - listTopicsSettings; - private final PagedCallSettings.Builder< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - ListTopicSubscriptionsPagedResponse> - listTopicSubscriptionsSettings; - private final PagedCallSettings.Builder< - ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> - listTopicSnapshotsSettings; - private final UnaryCallSettings.Builder deleteTopicSettings; - private final UnaryCallSettings.Builder - detachSubscriptionSettings; - private final UnaryCallSettings.Builder setIamPolicySettings; - private final UnaryCallSettings.Builder getIamPolicySettings; - private final UnaryCallSettings.Builder - testIamPermissionsSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_0_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "retry_policy_1_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_2_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_0_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(4.0) - .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_2_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createTopicSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateTopicSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - publishSettings = - BatchingCallSettings.newBuilder(PUBLISH_BATCHING_DESC) - .setBatchingSettings(BatchingSettings.newBuilder().build()); - getTopicSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listTopicsSettings = PagedCallSettings.newBuilder(LIST_TOPICS_PAGE_STR_FACT); - listTopicSubscriptionsSettings = - PagedCallSettings.newBuilder(LIST_TOPIC_SUBSCRIPTIONS_PAGE_STR_FACT); - listTopicSnapshotsSettings = PagedCallSettings.newBuilder(LIST_TOPIC_SNAPSHOTS_PAGE_STR_FACT); - deleteTopicSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - detachSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createTopicSettings, - updateTopicSettings, - publishSettings, - getTopicSettings, - listTopicsSettings, - listTopicSubscriptionsSettings, - listTopicSnapshotsSettings, - deleteTopicSettings, - detachSubscriptionSettings, - setIamPolicySettings, - getIamPolicySettings, - testIamPermissionsSettings); - initDefaults(this); - } - - protected Builder(PublisherStubSettings settings) { - super(settings); - - createTopicSettings = settings.createTopicSettings.toBuilder(); - updateTopicSettings = settings.updateTopicSettings.toBuilder(); - publishSettings = settings.publishSettings.toBuilder(); - getTopicSettings = settings.getTopicSettings.toBuilder(); - listTopicsSettings = settings.listTopicsSettings.toBuilder(); - listTopicSubscriptionsSettings = settings.listTopicSubscriptionsSettings.toBuilder(); - listTopicSnapshotsSettings = settings.listTopicSnapshotsSettings.toBuilder(); - deleteTopicSettings = settings.deleteTopicSettings.toBuilder(); - detachSubscriptionSettings = settings.detachSubscriptionSettings.toBuilder(); - setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); - getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); - testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createTopicSettings, - updateTopicSettings, - publishSettings, - getTopicSettings, - listTopicsSettings, - listTopicSubscriptionsSettings, - listTopicSnapshotsSettings, - deleteTopicSettings, - detachSubscriptionSettings, - setIamPolicySettings, - getIamPolicySettings, - testIamPermissionsSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createTopicSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .updateTopicSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .publishSettings() - .setBatchingSettings( - BatchingSettings.newBuilder() - .setElementCountThreshold(100L) - .setRequestByteThreshold(1048576L) - .setDelayThreshold(Duration.ofMillis(10L)) - .setFlowControlSettings( - FlowControlSettings.newBuilder() - .setLimitExceededBehavior(FlowController.LimitExceededBehavior.Ignore) - .build()) - .build()); - - builder - .publishSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .getTopicSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); - - builder - .listTopicsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); - - builder - .listTopicSubscriptionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); - - builder - .listTopicSnapshotsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); - - builder - .deleteTopicSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .detachSubscriptionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .setIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .getIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); - - builder - .testIamPermissionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - return builder; - } - - /** - * 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) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to createTopic. */ - public UnaryCallSettings.Builder createTopicSettings() { - return createTopicSettings; - } - - /** Returns the builder for the settings used for calls to updateTopic. */ - public UnaryCallSettings.Builder updateTopicSettings() { - return updateTopicSettings; - } - - /** Returns the builder for the settings used for calls to publish. */ - public BatchingCallSettings.Builder publishSettings() { - return publishSettings; - } - - /** Returns the builder for the settings used for calls to getTopic. */ - public UnaryCallSettings.Builder getTopicSettings() { - return getTopicSettings; - } - - /** Returns the builder for the settings used for calls to listTopics. */ - public PagedCallSettings.Builder - listTopicsSettings() { - return listTopicsSettings; - } - - /** Returns the builder for the settings used for calls to listTopicSubscriptions. */ - public PagedCallSettings.Builder< - ListTopicSubscriptionsRequest, - ListTopicSubscriptionsResponse, - ListTopicSubscriptionsPagedResponse> - listTopicSubscriptionsSettings() { - return listTopicSubscriptionsSettings; - } - - /** Returns the builder for the settings used for calls to listTopicSnapshots. */ - public PagedCallSettings.Builder< - ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> - listTopicSnapshotsSettings() { - return listTopicSnapshotsSettings; - } - - /** Returns the builder for the settings used for calls to deleteTopic. */ - public UnaryCallSettings.Builder deleteTopicSettings() { - return deleteTopicSettings; - } - - /** Returns the builder for the settings used for calls to detachSubscription. */ - public UnaryCallSettings.Builder - detachSubscriptionSettings() { - return detachSubscriptionSettings; - } - - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - - @Override - public PublisherStubSettings build() throws IOException { - return new PublisherStubSettings(this); - } - } -} diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java deleted file mode 100644 index ab5200375..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2023 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.ListSchemaRevisionsPagedResponse; -import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.CommitSchemaRequest; -import com.google.pubsub.v1.CreateSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRevisionRequest; -import com.google.pubsub.v1.GetSchemaRequest; -import com.google.pubsub.v1.ListSchemaRevisionsRequest; -import com.google.pubsub.v1.ListSchemaRevisionsResponse; -import com.google.pubsub.v1.ListSchemasRequest; -import com.google.pubsub.v1.ListSchemasResponse; -import com.google.pubsub.v1.RollbackSchemaRequest; -import com.google.pubsub.v1.Schema; -import com.google.pubsub.v1.ValidateMessageRequest; -import com.google.pubsub.v1.ValidateMessageResponse; -import com.google.pubsub.v1.ValidateSchemaRequest; -import com.google.pubsub.v1.ValidateSchemaResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the SchemaService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -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 - listSchemaRevisionsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listSchemaRevisionsPagedCallable()"); - } - - public UnaryCallable - listSchemaRevisionsCallable() { - throw new UnsupportedOperationException("Not implemented: listSchemaRevisionsCallable()"); - } - - public UnaryCallable commitSchemaCallable() { - throw new UnsupportedOperationException("Not implemented: commitSchemaCallable()"); - } - - public UnaryCallable rollbackSchemaCallable() { - throw new UnsupportedOperationException("Not implemented: rollbackSchemaCallable()"); - } - - public UnaryCallable deleteSchemaRevisionCallable() { - throw new UnsupportedOperationException("Not implemented: deleteSchemaRevisionCallable()"); - } - - public UnaryCallable deleteSchemaCallable() { - throw new UnsupportedOperationException("Not implemented: deleteSchemaCallable()"); - } - - public UnaryCallable validateSchemaCallable() { - throw new UnsupportedOperationException("Not implemented: validateSchemaCallable()"); - } - - public UnaryCallable validateMessageCallable() { - throw new UnsupportedOperationException("Not implemented: validateMessageCallable()"); - } - - public UnaryCallable setIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); - } - - public UnaryCallable getIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); - } - - public UnaryCallable - testIamPermissionsCallable() { - throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); - } - - @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 deleted file mode 100644 index 8b036328d..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java +++ /dev/null @@ -1,778 +0,0 @@ -/* - * Copyright 2023 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.ListSchemaRevisionsPagedResponse; -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.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.CommitSchemaRequest; -import com.google.pubsub.v1.CreateSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRevisionRequest; -import com.google.pubsub.v1.GetSchemaRequest; -import com.google.pubsub.v1.ListSchemaRevisionsRequest; -import com.google.pubsub.v1.ListSchemaRevisionsResponse; -import com.google.pubsub.v1.ListSchemasRequest; -import com.google.pubsub.v1.ListSchemasResponse; -import com.google.pubsub.v1.RollbackSchemaRequest; -import com.google.pubsub.v1.Schema; -import com.google.pubsub.v1.ValidateMessageRequest; -import com.google.pubsub.v1.ValidateMessageResponse; -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: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * 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-java") -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 PagedCallSettings< - ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> - listSchemaRevisionsSettings; - private final UnaryCallSettings commitSchemaSettings; - private final UnaryCallSettings rollbackSchemaSettings; - private final UnaryCallSettings deleteSchemaRevisionSettings; - private final UnaryCallSettings deleteSchemaSettings; - private final UnaryCallSettings - validateSchemaSettings; - private final UnaryCallSettings - validateMessageSettings; - private final UnaryCallSettings setIamPolicySettings; - private final UnaryCallSettings getIamPolicySettings; - private final UnaryCallSettings - testIamPermissionsSettings; - - 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 - ? ImmutableList.of() - : payload.getSchemasList(); - } - }; - - private static final PagedListDescriptor< - ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, Schema> - LIST_SCHEMA_REVISIONS_PAGE_STR_DESC = - new PagedListDescriptor< - ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, Schema>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListSchemaRevisionsRequest injectToken( - ListSchemaRevisionsRequest payload, String token) { - return ListSchemaRevisionsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListSchemaRevisionsRequest injectPageSize( - ListSchemaRevisionsRequest payload, int pageSize) { - return ListSchemaRevisionsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListSchemaRevisionsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListSchemaRevisionsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListSchemaRevisionsResponse payload) { - return payload.getSchemasList() == null - ? ImmutableList.of() - : payload.getSchemasList(); - } - }; - - private static final PagedListResponseFactory< - ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse> - LIST_SCHEMAS_PAGE_STR_FACT = - 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); - } - }; - - private static final PagedListResponseFactory< - ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> - LIST_SCHEMA_REVISIONS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListSchemaRevisionsRequest, - ListSchemaRevisionsResponse, - ListSchemaRevisionsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListSchemaRevisionsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_SCHEMA_REVISIONS_PAGE_STR_DESC, request, context); - return ListSchemaRevisionsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to createSchema. */ - public UnaryCallSettings createSchemaSettings() { - return createSchemaSettings; - } - - /** 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 listSchemaRevisions. */ - public PagedCallSettings< - ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> - listSchemaRevisionsSettings() { - return listSchemaRevisionsSettings; - } - - /** Returns the object with the settings used for calls to commitSchema. */ - public UnaryCallSettings commitSchemaSettings() { - return commitSchemaSettings; - } - - /** Returns the object with the settings used for calls to rollbackSchema. */ - public UnaryCallSettings rollbackSchemaSettings() { - return rollbackSchemaSettings; - } - - /** Returns the object with the settings used for calls to deleteSchemaRevision. */ - public UnaryCallSettings deleteSchemaRevisionSettings() { - return deleteSchemaRevisionSettings; - } - - /** Returns the object with the settings used for calls to deleteSchema. */ - public UnaryCallSettings deleteSchemaSettings() { - return deleteSchemaSettings; - } - - /** 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; - } - - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - - public SchemaServiceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcSchemaServiceStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonSchemaServiceStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns the default service name. */ - @Override - public String getServiceName() { - return "pubsub"; - } - - /** 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 mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "pubsub.mtls.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) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - 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 defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(SchemaServiceStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(SchemaServiceStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SchemaServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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(); - listSchemaRevisionsSettings = settingsBuilder.listSchemaRevisionsSettings().build(); - commitSchemaSettings = settingsBuilder.commitSchemaSettings().build(); - rollbackSchemaSettings = settingsBuilder.rollbackSchemaSettings().build(); - deleteSchemaRevisionSettings = settingsBuilder.deleteSchemaRevisionSettings().build(); - deleteSchemaSettings = settingsBuilder.deleteSchemaSettings().build(); - validateSchemaSettings = settingsBuilder.validateSchemaSettings().build(); - validateMessageSettings = settingsBuilder.validateMessageSettings().build(); - setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); - getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); - testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); - } - - /** 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 PagedCallSettings.Builder< - ListSchemaRevisionsRequest, - ListSchemaRevisionsResponse, - ListSchemaRevisionsPagedResponse> - listSchemaRevisionsSettings; - private final UnaryCallSettings.Builder commitSchemaSettings; - private final UnaryCallSettings.Builder rollbackSchemaSettings; - private final UnaryCallSettings.Builder - deleteSchemaRevisionSettings; - private final UnaryCallSettings.Builder deleteSchemaSettings; - private final UnaryCallSettings.Builder - validateSchemaSettings; - private final UnaryCallSettings.Builder - validateMessageSettings; - private final UnaryCallSettings.Builder setIamPolicySettings; - private final UnaryCallSettings.Builder getIamPolicySettings; - private final UnaryCallSettings.Builder - testIamPermissionsSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_7_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - 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_7_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); - listSchemaRevisionsSettings = - PagedCallSettings.newBuilder(LIST_SCHEMA_REVISIONS_PAGE_STR_FACT); - commitSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - rollbackSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteSchemaRevisionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - validateSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - validateMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSchemaSettings, - getSchemaSettings, - listSchemasSettings, - listSchemaRevisionsSettings, - commitSchemaSettings, - rollbackSchemaSettings, - deleteSchemaRevisionSettings, - deleteSchemaSettings, - validateSchemaSettings, - validateMessageSettings, - setIamPolicySettings, - getIamPolicySettings, - testIamPermissionsSettings); - initDefaults(this); - } - - protected Builder(SchemaServiceStubSettings settings) { - super(settings); - - createSchemaSettings = settings.createSchemaSettings.toBuilder(); - getSchemaSettings = settings.getSchemaSettings.toBuilder(); - listSchemasSettings = settings.listSchemasSettings.toBuilder(); - listSchemaRevisionsSettings = settings.listSchemaRevisionsSettings.toBuilder(); - commitSchemaSettings = settings.commitSchemaSettings.toBuilder(); - rollbackSchemaSettings = settings.rollbackSchemaSettings.toBuilder(); - deleteSchemaRevisionSettings = settings.deleteSchemaRevisionSettings.toBuilder(); - deleteSchemaSettings = settings.deleteSchemaSettings.toBuilder(); - validateSchemaSettings = settings.validateSchemaSettings.toBuilder(); - validateMessageSettings = settings.validateMessageSettings.toBuilder(); - setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); - getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); - testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSchemaSettings, - getSchemaSettings, - listSchemasSettings, - listSchemaRevisionsSettings, - commitSchemaSettings, - rollbackSchemaSettings, - deleteSchemaRevisionSettings, - deleteSchemaSettings, - validateSchemaSettings, - validateMessageSettings, - setIamPolicySettings, - getIamPolicySettings, - testIamPermissionsSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createSchemaSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); - - builder - .getSchemaSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); - - builder - .listSchemasSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); - - builder - .listSchemaRevisionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); - - builder - .commitSchemaSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); - - builder - .rollbackSchemaSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); - - builder - .deleteSchemaRevisionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); - - builder - .deleteSchemaSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); - - builder - .validateSchemaSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); - - builder - .validateMessageSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_7_params")); - - builder - .setIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .testIamPermissionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - return builder; - } - - /** - * 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) { - 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 listSchemaRevisions. */ - public PagedCallSettings.Builder< - ListSchemaRevisionsRequest, - ListSchemaRevisionsResponse, - ListSchemaRevisionsPagedResponse> - listSchemaRevisionsSettings() { - return listSchemaRevisionsSettings; - } - - /** Returns the builder for the settings used for calls to commitSchema. */ - public UnaryCallSettings.Builder commitSchemaSettings() { - return commitSchemaSettings; - } - - /** Returns the builder for the settings used for calls to rollbackSchema. */ - public UnaryCallSettings.Builder rollbackSchemaSettings() { - return rollbackSchemaSettings; - } - - /** Returns the builder for the settings used for calls to deleteSchemaRevision. */ - public UnaryCallSettings.Builder - deleteSchemaRevisionSettings() { - return deleteSchemaRevisionSettings; - } - - /** 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; - } - - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - - @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/SubscriberStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStub.java deleted file mode 100644 index f04f4acd5..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStub.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2023 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.SubscriptionAdminClient.ListSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPagedResponse; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.AcknowledgeRequest; -import com.google.pubsub.v1.CreateSnapshotRequest; -import com.google.pubsub.v1.DeleteSnapshotRequest; -import com.google.pubsub.v1.DeleteSubscriptionRequest; -import com.google.pubsub.v1.GetSnapshotRequest; -import com.google.pubsub.v1.GetSubscriptionRequest; -import com.google.pubsub.v1.ListSnapshotsRequest; -import com.google.pubsub.v1.ListSnapshotsResponse; -import com.google.pubsub.v1.ListSubscriptionsRequest; -import com.google.pubsub.v1.ListSubscriptionsResponse; -import com.google.pubsub.v1.ModifyAckDeadlineRequest; -import com.google.pubsub.v1.ModifyPushConfigRequest; -import com.google.pubsub.v1.PullRequest; -import com.google.pubsub.v1.PullResponse; -import com.google.pubsub.v1.SeekRequest; -import com.google.pubsub.v1.SeekResponse; -import com.google.pubsub.v1.Snapshot; -import com.google.pubsub.v1.StreamingPullRequest; -import com.google.pubsub.v1.StreamingPullResponse; -import com.google.pubsub.v1.Subscription; -import com.google.pubsub.v1.UpdateSnapshotRequest; -import com.google.pubsub.v1.UpdateSubscriptionRequest; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Subscriber service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public abstract class SubscriberStub implements BackgroundResource { - - public UnaryCallable createSubscriptionCallable() { - throw new UnsupportedOperationException("Not implemented: createSubscriptionCallable()"); - } - - public UnaryCallable getSubscriptionCallable() { - throw new UnsupportedOperationException("Not implemented: getSubscriptionCallable()"); - } - - public UnaryCallable updateSubscriptionCallable() { - throw new UnsupportedOperationException("Not implemented: updateSubscriptionCallable()"); - } - - public UnaryCallable - listSubscriptionsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listSubscriptionsPagedCallable()"); - } - - public UnaryCallable - listSubscriptionsCallable() { - throw new UnsupportedOperationException("Not implemented: listSubscriptionsCallable()"); - } - - public UnaryCallable deleteSubscriptionCallable() { - throw new UnsupportedOperationException("Not implemented: deleteSubscriptionCallable()"); - } - - public UnaryCallable modifyAckDeadlineCallable() { - throw new UnsupportedOperationException("Not implemented: modifyAckDeadlineCallable()"); - } - - public UnaryCallable acknowledgeCallable() { - throw new UnsupportedOperationException("Not implemented: acknowledgeCallable()"); - } - - public UnaryCallable pullCallable() { - throw new UnsupportedOperationException("Not implemented: pullCallable()"); - } - - public BidiStreamingCallable - streamingPullCallable() { - throw new UnsupportedOperationException("Not implemented: streamingPullCallable()"); - } - - public UnaryCallable modifyPushConfigCallable() { - throw new UnsupportedOperationException("Not implemented: modifyPushConfigCallable()"); - } - - public UnaryCallable getSnapshotCallable() { - throw new UnsupportedOperationException("Not implemented: getSnapshotCallable()"); - } - - public UnaryCallable - listSnapshotsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listSnapshotsPagedCallable()"); - } - - public UnaryCallable listSnapshotsCallable() { - throw new UnsupportedOperationException("Not implemented: listSnapshotsCallable()"); - } - - public UnaryCallable createSnapshotCallable() { - throw new UnsupportedOperationException("Not implemented: createSnapshotCallable()"); - } - - public UnaryCallable updateSnapshotCallable() { - throw new UnsupportedOperationException("Not implemented: updateSnapshotCallable()"); - } - - public UnaryCallable deleteSnapshotCallable() { - throw new UnsupportedOperationException("Not implemented: deleteSnapshotCallable()"); - } - - public UnaryCallable seekCallable() { - throw new UnsupportedOperationException("Not implemented: seekCallable()"); - } - - public UnaryCallable setIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); - } - - public UnaryCallable getIamPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); - } - - public UnaryCallable - testIamPermissionsCallable() { - throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); - } - - @Override - public abstract void close(); -} 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 deleted file mode 100644 index c517f17d6..000000000 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java +++ /dev/null @@ -1,962 +0,0 @@ -/* - * Copyright 2023 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.SubscriptionAdminClient.ListSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPagedResponse; - -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.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.StreamingCallSettings; -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.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.Empty; -import com.google.pubsub.v1.AcknowledgeRequest; -import com.google.pubsub.v1.CreateSnapshotRequest; -import com.google.pubsub.v1.DeleteSnapshotRequest; -import com.google.pubsub.v1.DeleteSubscriptionRequest; -import com.google.pubsub.v1.GetSnapshotRequest; -import com.google.pubsub.v1.GetSubscriptionRequest; -import com.google.pubsub.v1.ListSnapshotsRequest; -import com.google.pubsub.v1.ListSnapshotsResponse; -import com.google.pubsub.v1.ListSubscriptionsRequest; -import com.google.pubsub.v1.ListSubscriptionsResponse; -import com.google.pubsub.v1.ModifyAckDeadlineRequest; -import com.google.pubsub.v1.ModifyPushConfigRequest; -import com.google.pubsub.v1.PullRequest; -import com.google.pubsub.v1.PullResponse; -import com.google.pubsub.v1.SeekRequest; -import com.google.pubsub.v1.SeekResponse; -import com.google.pubsub.v1.Snapshot; -import com.google.pubsub.v1.StreamingPullRequest; -import com.google.pubsub.v1.StreamingPullResponse; -import com.google.pubsub.v1.Subscription; -import com.google.pubsub.v1.UpdateSnapshotRequest; -import com.google.pubsub.v1.UpdateSubscriptionRequest; -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 SubscriberStub}. - * - *

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 createSubscription to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SubscriberStubSettings.Builder subscriptionAdminSettingsBuilder =
- *     SubscriberStubSettings.newBuilder();
- * subscriptionAdminSettingsBuilder
- *     .createSubscriptionSettings()
- *     .setRetrySettings(
- *         subscriptionAdminSettingsBuilder
- *             .createSubscriptionSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SubscriberStubSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class SubscriberStubSettings 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 createSubscriptionSettings; - private final UnaryCallSettings getSubscriptionSettings; - private final UnaryCallSettings - updateSubscriptionSettings; - private final PagedCallSettings< - ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> - listSubscriptionsSettings; - private final UnaryCallSettings deleteSubscriptionSettings; - private final UnaryCallSettings modifyAckDeadlineSettings; - private final UnaryCallSettings acknowledgeSettings; - private final UnaryCallSettings pullSettings; - private final StreamingCallSettings - streamingPullSettings; - private final UnaryCallSettings modifyPushConfigSettings; - private final UnaryCallSettings getSnapshotSettings; - private final PagedCallSettings< - ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> - listSnapshotsSettings; - private final UnaryCallSettings createSnapshotSettings; - private final UnaryCallSettings updateSnapshotSettings; - private final UnaryCallSettings deleteSnapshotSettings; - private final UnaryCallSettings seekSettings; - private final UnaryCallSettings setIamPolicySettings; - private final UnaryCallSettings getIamPolicySettings; - private final UnaryCallSettings - testIamPermissionsSettings; - - private static final PagedListDescriptor< - ListSubscriptionsRequest, ListSubscriptionsResponse, Subscription> - LIST_SUBSCRIPTIONS_PAGE_STR_DESC = - new PagedListDescriptor< - ListSubscriptionsRequest, ListSubscriptionsResponse, Subscription>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListSubscriptionsRequest injectToken( - ListSubscriptionsRequest payload, String token) { - return ListSubscriptionsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListSubscriptionsRequest injectPageSize( - ListSubscriptionsRequest payload, int pageSize) { - return ListSubscriptionsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListSubscriptionsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListSubscriptionsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListSubscriptionsResponse payload) { - return payload.getSubscriptionsList() == null - ? ImmutableList.of() - : payload.getSubscriptionsList(); - } - }; - - private static final PagedListDescriptor - LIST_SNAPSHOTS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListSnapshotsRequest injectToken(ListSnapshotsRequest payload, String token) { - return ListSnapshotsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListSnapshotsRequest injectPageSize(ListSnapshotsRequest payload, int pageSize) { - return ListSnapshotsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListSnapshotsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListSnapshotsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListSnapshotsResponse payload) { - return payload.getSnapshotsList() == null - ? ImmutableList.of() - : payload.getSnapshotsList(); - } - }; - - private static final PagedListResponseFactory< - ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> - LIST_SUBSCRIPTIONS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListSubscriptionsRequest, - ListSubscriptionsResponse, - ListSubscriptionsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListSubscriptionsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_SUBSCRIPTIONS_PAGE_STR_DESC, request, context); - return ListSubscriptionsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> - LIST_SNAPSHOTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListSnapshotsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_SNAPSHOTS_PAGE_STR_DESC, request, context); - return ListSnapshotsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to createSubscription. */ - public UnaryCallSettings createSubscriptionSettings() { - return createSubscriptionSettings; - } - - /** Returns the object with the settings used for calls to getSubscription. */ - public UnaryCallSettings getSubscriptionSettings() { - return getSubscriptionSettings; - } - - /** Returns the object with the settings used for calls to updateSubscription. */ - public UnaryCallSettings updateSubscriptionSettings() { - return updateSubscriptionSettings; - } - - /** Returns the object with the settings used for calls to listSubscriptions. */ - public PagedCallSettings< - ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> - listSubscriptionsSettings() { - return listSubscriptionsSettings; - } - - /** Returns the object with the settings used for calls to deleteSubscription. */ - public UnaryCallSettings deleteSubscriptionSettings() { - return deleteSubscriptionSettings; - } - - /** Returns the object with the settings used for calls to modifyAckDeadline. */ - public UnaryCallSettings modifyAckDeadlineSettings() { - return modifyAckDeadlineSettings; - } - - /** Returns the object with the settings used for calls to acknowledge. */ - public UnaryCallSettings acknowledgeSettings() { - return acknowledgeSettings; - } - - /** Returns the object with the settings used for calls to pull. */ - public UnaryCallSettings pullSettings() { - return pullSettings; - } - - /** Returns the object with the settings used for calls to streamingPull. */ - public StreamingCallSettings - streamingPullSettings() { - return streamingPullSettings; - } - - /** Returns the object with the settings used for calls to modifyPushConfig. */ - public UnaryCallSettings modifyPushConfigSettings() { - return modifyPushConfigSettings; - } - - /** Returns the object with the settings used for calls to getSnapshot. */ - public UnaryCallSettings getSnapshotSettings() { - return getSnapshotSettings; - } - - /** Returns the object with the settings used for calls to listSnapshots. */ - public PagedCallSettings - listSnapshotsSettings() { - return listSnapshotsSettings; - } - - /** Returns the object with the settings used for calls to createSnapshot. */ - public UnaryCallSettings createSnapshotSettings() { - return createSnapshotSettings; - } - - /** Returns the object with the settings used for calls to updateSnapshot. */ - public UnaryCallSettings updateSnapshotSettings() { - return updateSnapshotSettings; - } - - /** Returns the object with the settings used for calls to deleteSnapshot. */ - public UnaryCallSettings deleteSnapshotSettings() { - return deleteSnapshotSettings; - } - - /** Returns the object with the settings used for calls to seek. */ - public UnaryCallSettings seekSettings() { - return seekSettings; - } - - /** Returns the object with the settings used for calls to setIamPolicy. */ - public UnaryCallSettings setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the object with the settings used for calls to getIamPolicy. */ - public UnaryCallSettings getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the object with the settings used for calls to testIamPermissions. */ - public UnaryCallSettings - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - - public SubscriberStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcSubscriberStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonSubscriberStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns the default service name. */ - @Override - public String getServiceName() { - return "pubsub"; - } - - /** 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 mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "pubsub.mtls.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) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder().setMaxInboundMessageSize(20 << 20); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - 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 defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(SubscriberStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(SubscriberStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SubscriberStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 SubscriberStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createSubscriptionSettings = settingsBuilder.createSubscriptionSettings().build(); - getSubscriptionSettings = settingsBuilder.getSubscriptionSettings().build(); - updateSubscriptionSettings = settingsBuilder.updateSubscriptionSettings().build(); - listSubscriptionsSettings = settingsBuilder.listSubscriptionsSettings().build(); - deleteSubscriptionSettings = settingsBuilder.deleteSubscriptionSettings().build(); - modifyAckDeadlineSettings = settingsBuilder.modifyAckDeadlineSettings().build(); - acknowledgeSettings = settingsBuilder.acknowledgeSettings().build(); - pullSettings = settingsBuilder.pullSettings().build(); - streamingPullSettings = settingsBuilder.streamingPullSettings().build(); - modifyPushConfigSettings = settingsBuilder.modifyPushConfigSettings().build(); - getSnapshotSettings = settingsBuilder.getSnapshotSettings().build(); - listSnapshotsSettings = settingsBuilder.listSnapshotsSettings().build(); - createSnapshotSettings = settingsBuilder.createSnapshotSettings().build(); - updateSnapshotSettings = settingsBuilder.updateSnapshotSettings().build(); - deleteSnapshotSettings = settingsBuilder.deleteSnapshotSettings().build(); - seekSettings = settingsBuilder.seekSettings().build(); - setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); - getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); - testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); - } - - /** Builder for SubscriberStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createSubscriptionSettings; - private final UnaryCallSettings.Builder - getSubscriptionSettings; - private final UnaryCallSettings.Builder - updateSubscriptionSettings; - private final PagedCallSettings.Builder< - ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> - listSubscriptionsSettings; - private final UnaryCallSettings.Builder - deleteSubscriptionSettings; - private final UnaryCallSettings.Builder - modifyAckDeadlineSettings; - private final UnaryCallSettings.Builder acknowledgeSettings; - private final UnaryCallSettings.Builder pullSettings; - private final StreamingCallSettings.Builder - streamingPullSettings; - private final UnaryCallSettings.Builder - modifyPushConfigSettings; - private final UnaryCallSettings.Builder getSnapshotSettings; - private final PagedCallSettings.Builder< - ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> - listSnapshotsSettings; - private final UnaryCallSettings.Builder createSnapshotSettings; - private final UnaryCallSettings.Builder updateSnapshotSettings; - private final UnaryCallSettings.Builder deleteSnapshotSettings; - private final UnaryCallSettings.Builder seekSettings; - private final UnaryCallSettings.Builder setIamPolicySettings; - private final UnaryCallSettings.Builder getIamPolicySettings; - private final UnaryCallSettings.Builder - testIamPermissionsSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_5_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNKNOWN, StatusCode.Code.ABORTED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "retry_policy_6_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "retry_policy_4_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNKNOWN, - StatusCode.Code.ABORTED, - StatusCode.Code.UNAVAILABLE, - StatusCode.Code.INTERNAL))); - definitions.put( - "retry_policy_3_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, - StatusCode.Code.RESOURCE_EXHAUSTED, - StatusCode.Code.ABORTED, - StatusCode.Code.INTERNAL, - 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_5_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_4_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(4.0) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(900000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(900000L)) - .setTotalTimeout(Duration.ofMillis(900000L)) - .build(); - definitions.put("retry_policy_3_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listSubscriptionsSettings = PagedCallSettings.newBuilder(LIST_SUBSCRIPTIONS_PAGE_STR_FACT); - deleteSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - modifyAckDeadlineSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - acknowledgeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - pullSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - streamingPullSettings = StreamingCallSettings.newBuilder(); - modifyPushConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listSnapshotsSettings = PagedCallSettings.newBuilder(LIST_SNAPSHOTS_PAGE_STR_FACT); - createSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - seekSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSubscriptionSettings, - getSubscriptionSettings, - updateSubscriptionSettings, - listSubscriptionsSettings, - deleteSubscriptionSettings, - modifyAckDeadlineSettings, - acknowledgeSettings, - pullSettings, - modifyPushConfigSettings, - getSnapshotSettings, - listSnapshotsSettings, - createSnapshotSettings, - updateSnapshotSettings, - deleteSnapshotSettings, - seekSettings, - setIamPolicySettings, - getIamPolicySettings, - testIamPermissionsSettings); - initDefaults(this); - } - - protected Builder(SubscriberStubSettings settings) { - super(settings); - - createSubscriptionSettings = settings.createSubscriptionSettings.toBuilder(); - getSubscriptionSettings = settings.getSubscriptionSettings.toBuilder(); - updateSubscriptionSettings = settings.updateSubscriptionSettings.toBuilder(); - listSubscriptionsSettings = settings.listSubscriptionsSettings.toBuilder(); - deleteSubscriptionSettings = settings.deleteSubscriptionSettings.toBuilder(); - modifyAckDeadlineSettings = settings.modifyAckDeadlineSettings.toBuilder(); - acknowledgeSettings = settings.acknowledgeSettings.toBuilder(); - pullSettings = settings.pullSettings.toBuilder(); - streamingPullSettings = settings.streamingPullSettings.toBuilder(); - modifyPushConfigSettings = settings.modifyPushConfigSettings.toBuilder(); - getSnapshotSettings = settings.getSnapshotSettings.toBuilder(); - listSnapshotsSettings = settings.listSnapshotsSettings.toBuilder(); - createSnapshotSettings = settings.createSnapshotSettings.toBuilder(); - updateSnapshotSettings = settings.updateSnapshotSettings.toBuilder(); - deleteSnapshotSettings = settings.deleteSnapshotSettings.toBuilder(); - seekSettings = settings.seekSettings.toBuilder(); - setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); - getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); - testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSubscriptionSettings, - getSubscriptionSettings, - updateSubscriptionSettings, - listSubscriptionsSettings, - deleteSubscriptionSettings, - modifyAckDeadlineSettings, - acknowledgeSettings, - pullSettings, - modifyPushConfigSettings, - getSnapshotSettings, - listSnapshotsSettings, - createSnapshotSettings, - updateSnapshotSettings, - deleteSnapshotSettings, - seekSettings, - setIamPolicySettings, - getIamPolicySettings, - testIamPermissionsSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createSubscriptionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); - - builder - .getSubscriptionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); - - builder - .updateSubscriptionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); - - builder - .listSubscriptionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); - - builder - .deleteSubscriptionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); - - builder - .modifyAckDeadlineSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); - - builder - .acknowledgeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); - - builder - .pullSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); - - builder - .modifyPushConfigSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); - - builder - .getSnapshotSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); - - builder - .listSnapshotsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); - - builder - .createSnapshotSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); - - builder - .updateSnapshotSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); - - builder - .deleteSnapshotSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); - - builder - .seekSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); - - builder - .setIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); - - builder - .getIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); - - builder - .testIamPermissionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); - - return builder; - } - - /** - * 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) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to createSubscription. */ - public UnaryCallSettings.Builder createSubscriptionSettings() { - return createSubscriptionSettings; - } - - /** Returns the builder for the settings used for calls to getSubscription. */ - public UnaryCallSettings.Builder - getSubscriptionSettings() { - return getSubscriptionSettings; - } - - /** Returns the builder for the settings used for calls to updateSubscription. */ - public UnaryCallSettings.Builder - updateSubscriptionSettings() { - return updateSubscriptionSettings; - } - - /** Returns the builder for the settings used for calls to listSubscriptions. */ - public PagedCallSettings.Builder< - ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> - listSubscriptionsSettings() { - return listSubscriptionsSettings; - } - - /** Returns the builder for the settings used for calls to deleteSubscription. */ - public UnaryCallSettings.Builder - deleteSubscriptionSettings() { - return deleteSubscriptionSettings; - } - - /** Returns the builder for the settings used for calls to modifyAckDeadline. */ - public UnaryCallSettings.Builder modifyAckDeadlineSettings() { - return modifyAckDeadlineSettings; - } - - /** Returns the builder for the settings used for calls to acknowledge. */ - public UnaryCallSettings.Builder acknowledgeSettings() { - return acknowledgeSettings; - } - - /** Returns the builder for the settings used for calls to pull. */ - public UnaryCallSettings.Builder pullSettings() { - return pullSettings; - } - - /** Returns the builder for the settings used for calls to streamingPull. */ - public StreamingCallSettings.Builder - streamingPullSettings() { - return streamingPullSettings; - } - - /** Returns the builder for the settings used for calls to modifyPushConfig. */ - public UnaryCallSettings.Builder modifyPushConfigSettings() { - return modifyPushConfigSettings; - } - - /** Returns the builder for the settings used for calls to getSnapshot. */ - public UnaryCallSettings.Builder getSnapshotSettings() { - return getSnapshotSettings; - } - - /** Returns the builder for the settings used for calls to listSnapshots. */ - public PagedCallSettings.Builder< - ListSnapshotsRequest, ListSnapshotsResponse, ListSnapshotsPagedResponse> - listSnapshotsSettings() { - return listSnapshotsSettings; - } - - /** Returns the builder for the settings used for calls to createSnapshot. */ - public UnaryCallSettings.Builder createSnapshotSettings() { - return createSnapshotSettings; - } - - /** Returns the builder for the settings used for calls to updateSnapshot. */ - public UnaryCallSettings.Builder updateSnapshotSettings() { - return updateSnapshotSettings; - } - - /** Returns the builder for the settings used for calls to deleteSnapshot. */ - public UnaryCallSettings.Builder deleteSnapshotSettings() { - return deleteSnapshotSettings; - } - - /** Returns the builder for the settings used for calls to seek. */ - public UnaryCallSettings.Builder seekSettings() { - return seekSettings; - } - - /** Returns the builder for the settings used for calls to setIamPolicy. */ - public UnaryCallSettings.Builder setIamPolicySettings() { - return setIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to getIamPolicy. */ - public UnaryCallSettings.Builder getIamPolicySettings() { - return getIamPolicySettings; - } - - /** Returns the builder for the settings used for calls to testIamPermissions. */ - public UnaryCallSettings.Builder - testIamPermissionsSettings() { - return testIamPermissionsSettings; - } - - @Override - public SubscriberStubSettings build() throws IOException { - return new SubscriberStubSettings(this); - } - } -} diff --git a/google-cloud-pubsub/src/main/resources/META-INF/native-image/com.google.cloud.pubsub.v1/reflect-config.json b/google-cloud-pubsub/src/main/resources/META-INF/native-image/com.google.cloud.pubsub.v1/reflect-config.json deleted file mode 100644 index 8fd73b027..000000000 --- a/google-cloud-pubsub/src/main/resources/META-INF/native-image/com.google.cloud.pubsub.v1/reflect-config.json +++ /dev/null @@ -1,2603 +0,0 @@ -[ - { - "name": "com.google.api.ClientLibraryDestination", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.ClientLibraryOrganization", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.ClientLibrarySettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.ClientLibrarySettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.CommonLanguageSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.CommonLanguageSettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.CppSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.CppSettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.CustomHttpPattern", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.CustomHttpPattern$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.DotnetSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.DotnetSettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.FieldBehavior", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.GoSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.GoSettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.Http", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.Http$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.HttpRule", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.HttpRule$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.JavaSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.JavaSettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.LaunchStage", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.MethodSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.MethodSettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.MethodSettings$LongRunning", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.MethodSettings$LongRunning$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.NodeSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.NodeSettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.PhpSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.PhpSettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.Publishing", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.Publishing$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.PythonSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.PythonSettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.ResourceDescriptor", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.ResourceDescriptor$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.ResourceDescriptor$History", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.ResourceDescriptor$Style", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.ResourceReference", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.ResourceReference$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.RubySettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.api.RubySettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.AuditConfig", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.AuditConfig$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.AuditConfigDelta", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.AuditConfigDelta$Action", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.AuditConfigDelta$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.AuditLogConfig", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.AuditLogConfig$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.AuditLogConfig$LogType", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.Binding", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.Binding$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.BindingDelta", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.BindingDelta$Action", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.BindingDelta$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.GetIamPolicyRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.GetPolicyOptions", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.GetPolicyOptions$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.Policy", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.Policy$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.PolicyDelta", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.PolicyDelta$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.SetIamPolicyRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.TestIamPermissionsRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.TestIamPermissionsResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.iam.v1.TestIamPermissionsResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$EnumOptions", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FileOptions", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$MessageOptions", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$MethodOptions", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$OneofOptions", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.Duration", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.Duration$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.Empty", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.Empty$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.FieldMask", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.FieldMask$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.Timestamp", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.protobuf.Timestamp$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.AcknowledgeRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.AcknowledgeRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.BigQueryConfig", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.BigQueryConfig$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.BigQueryConfig$State", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CloudStorageConfig", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CloudStorageConfig$AvroConfig", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CloudStorageConfig$AvroConfig$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CloudStorageConfig$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CloudStorageConfig$State", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CloudStorageConfig$TextConfig", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CloudStorageConfig$TextConfig$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CommitSchemaRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CommitSchemaRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CreateSchemaRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CreateSchemaRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CreateSnapshotRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.CreateSnapshotRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeadLetterPolicy", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeadLetterPolicy$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeleteSchemaRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeleteSchemaRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeleteSchemaRevisionRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeleteSchemaRevisionRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeleteSnapshotRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeleteSnapshotRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeleteSubscriptionRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeleteSubscriptionRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeleteTopicRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DeleteTopicRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DetachSubscriptionRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DetachSubscriptionRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DetachSubscriptionResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.DetachSubscriptionResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Encoding", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ExpirationPolicy", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ExpirationPolicy$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.GetSchemaRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.GetSchemaRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.GetSnapshotRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.GetSnapshotRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.GetSubscriptionRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.GetSubscriptionRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.GetTopicRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.GetTopicRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSchemaRevisionsRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSchemaRevisionsRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSchemaRevisionsResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSchemaRevisionsResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSchemasRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSchemasRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSchemasResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSchemasResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSnapshotsRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSnapshotsRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSnapshotsResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSnapshotsResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSubscriptionsRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSubscriptionsRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSubscriptionsResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListSubscriptionsResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicSnapshotsRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicSnapshotsRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicSnapshotsResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicSnapshotsResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicSubscriptionsRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicSubscriptionsRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicSubscriptionsResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicSubscriptionsResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicsRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicsRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicsResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ListTopicsResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.MessageStoragePolicy", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.MessageStoragePolicy$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ModifyAckDeadlineRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ModifyAckDeadlineRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ModifyPushConfigRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ModifyPushConfigRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PublishRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PublishRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PublishResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PublishResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PubsubMessage", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PubsubMessage$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PullRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PullRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PullResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PullResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PushConfig", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PushConfig$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PushConfig$NoWrapper", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PushConfig$NoWrapper$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PushConfig$OidcToken", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PushConfig$OidcToken$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PushConfig$PubsubWrapper", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.PushConfig$PubsubWrapper$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ReceivedMessage", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ReceivedMessage$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.RetryPolicy", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.RetryPolicy$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.RollbackSchemaRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.RollbackSchemaRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Schema", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Schema$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Schema$Type", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.SchemaSettings", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.SchemaSettings$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.SchemaView", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.SeekRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.SeekRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.SeekResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.SeekResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Snapshot", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Snapshot$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.StreamingPullRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.StreamingPullRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.StreamingPullResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.StreamingPullResponse$AcknowledgeConfirmation", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.StreamingPullResponse$AcknowledgeConfirmation$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.StreamingPullResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.StreamingPullResponse$ModifyAckDeadlineConfirmation", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.StreamingPullResponse$ModifyAckDeadlineConfirmation$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.StreamingPullResponse$SubscriptionProperties", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.StreamingPullResponse$SubscriptionProperties$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Subscription", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Subscription$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Subscription$State", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Topic", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.Topic$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.UpdateSnapshotRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.UpdateSnapshotRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.UpdateSubscriptionRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.UpdateSubscriptionRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.UpdateTopicRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.UpdateTopicRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ValidateMessageRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ValidateMessageRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ValidateMessageResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ValidateMessageResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ValidateSchemaRequest", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ValidateSchemaRequest$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ValidateSchemaResponse", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.pubsub.v1.ValidateSchemaResponse$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.type.Expr", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - }, - { - "name": "com.google.type.Expr$Builder", - "queryAllDeclaredConstructors": true, - "queryAllPublicConstructors": true, - "queryAllDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredClasses": true, - "allPublicClasses": true - } -] \ No newline at end of file diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockIAMPolicy.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockIAMPolicy.java deleted file mode 100644 index c17e00ad2..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockIAMPolicy.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2023 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.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockIAMPolicy implements MockGrpcService { - private final MockIAMPolicyImpl serviceImpl; - - public MockIAMPolicy() { - serviceImpl = new MockIAMPolicyImpl(); - } - - @Override - public List 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/MockIAMPolicyImpl.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java deleted file mode 100644 index e18c2a7bc..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2023 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.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.AbstractMessage; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockIAMPolicyImpl extends IAMPolicyImplBase { - private List requests; - private Queue responses; - - public MockIAMPolicyImpl() { - 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 testIamPermissions( - TestIamPermissionsRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof TestIamPermissionsResponse) { - requests.add(request); - responseObserver.onNext(((TestIamPermissionsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - TestIamPermissionsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Policy) { - requests.add(request); - responseObserver.onNext(((Policy) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Policy.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Policy) { - requests.add(request); - responseObserver.onNext(((Policy) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Policy.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisher.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisher.java deleted file mode 100644 index 2a26cd59a..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisher.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2023 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.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockPublisher implements MockGrpcService { - private final MockPublisherImpl serviceImpl; - - public MockPublisher() { - serviceImpl = new MockPublisherImpl(); - } - - @Override - public List 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/MockPublisherImpl.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisherImpl.java deleted file mode 100644 index 47cf6f416..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisherImpl.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright 2023 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.DeleteTopicRequest; -import com.google.pubsub.v1.DetachSubscriptionRequest; -import com.google.pubsub.v1.DetachSubscriptionResponse; -import com.google.pubsub.v1.GetTopicRequest; -import com.google.pubsub.v1.ListTopicSnapshotsRequest; -import com.google.pubsub.v1.ListTopicSnapshotsResponse; -import com.google.pubsub.v1.ListTopicSubscriptionsRequest; -import com.google.pubsub.v1.ListTopicSubscriptionsResponse; -import com.google.pubsub.v1.ListTopicsRequest; -import com.google.pubsub.v1.ListTopicsResponse; -import com.google.pubsub.v1.PublishRequest; -import com.google.pubsub.v1.PublishResponse; -import com.google.pubsub.v1.PublisherGrpc.PublisherImplBase; -import com.google.pubsub.v1.Topic; -import com.google.pubsub.v1.UpdateTopicRequest; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockPublisherImpl extends PublisherImplBase { - private List requests; - private Queue responses; - - public MockPublisherImpl() { - 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 createTopic(Topic request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Topic) { - requests.add(request); - responseObserver.onNext(((Topic) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreateTopic, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Topic.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateTopic(UpdateTopicRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Topic) { - requests.add(request); - responseObserver.onNext(((Topic) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdateTopic, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Topic.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void publish(PublishRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PublishResponse) { - requests.add(request); - responseObserver.onNext(((PublishResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Publish, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PublishResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getTopic(GetTopicRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Topic) { - requests.add(request); - responseObserver.onNext(((Topic) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetTopic, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Topic.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listTopics( - ListTopicsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListTopicsResponse) { - requests.add(request); - responseObserver.onNext(((ListTopicsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListTopics, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListTopicsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listTopicSubscriptions( - ListTopicSubscriptionsRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListTopicSubscriptionsResponse) { - requests.add(request); - responseObserver.onNext(((ListTopicSubscriptionsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListTopicSubscriptions, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListTopicSubscriptionsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listTopicSnapshots( - ListTopicSnapshotsRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListTopicSnapshotsResponse) { - requests.add(request); - responseObserver.onNext(((ListTopicSnapshotsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListTopicSnapshots, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListTopicSnapshotsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteTopic(DeleteTopicRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method DeleteTopic, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void detachSubscription( - DetachSubscriptionRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof DetachSubscriptionResponse) { - requests.add(request); - responseObserver.onNext(((DetachSubscriptionResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DetachSubscription, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - DetachSubscriptionResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSchemaService.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSchemaService.java deleted file mode 100644 index 29559fa86..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSchemaService.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2023 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.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockSchemaService implements MockGrpcService { - private final MockSchemaServiceImpl serviceImpl; - - public MockSchemaService() { - serviceImpl = new MockSchemaServiceImpl(); - } - - @Override - public List 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 deleted file mode 100644 index 8510e1b77..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright 2023 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.CommitSchemaRequest; -import com.google.pubsub.v1.CreateSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRevisionRequest; -import com.google.pubsub.v1.GetSchemaRequest; -import com.google.pubsub.v1.ListSchemaRevisionsRequest; -import com.google.pubsub.v1.ListSchemaRevisionsResponse; -import com.google.pubsub.v1.ListSchemasRequest; -import com.google.pubsub.v1.ListSchemasResponse; -import com.google.pubsub.v1.RollbackSchemaRequest; -import com.google.pubsub.v1.Schema; -import com.google.pubsub.v1.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; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -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.poll(); - 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( - String.format( - "Unrecognized response type %s for method CreateSchema, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Schema.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getSchema(GetSchemaRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method GetSchema, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Schema.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listSchemas( - ListSchemasRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method ListSchemas, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListSchemasResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listSchemaRevisions( - ListSchemaRevisionsRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListSchemaRevisionsResponse) { - requests.add(request); - responseObserver.onNext(((ListSchemaRevisionsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListSchemaRevisions, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListSchemaRevisionsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void commitSchema(CommitSchemaRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method CommitSchema, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Schema.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void rollbackSchema( - RollbackSchemaRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method RollbackSchema, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Schema.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteSchemaRevision( - DeleteSchemaRevisionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method DeleteSchemaRevision, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Schema.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteSchema(DeleteSchemaRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method DeleteSchema, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void validateSchema( - ValidateSchemaRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method ValidateSchema, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ValidateSchemaResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void validateMessage( - ValidateMessageRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method ValidateMessage, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ValidateMessageResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriber.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriber.java deleted file mode 100644 index 13b54dd7a..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriber.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2023 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.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockSubscriber implements MockGrpcService { - private final MockSubscriberImpl serviceImpl; - - public MockSubscriber() { - serviceImpl = new MockSubscriberImpl(); - } - - @Override - public List 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/MockSubscriberImpl.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriberImpl.java deleted file mode 100644 index 389fc6561..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriberImpl.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Copyright 2023 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.AcknowledgeRequest; -import com.google.pubsub.v1.CreateSnapshotRequest; -import com.google.pubsub.v1.DeleteSnapshotRequest; -import com.google.pubsub.v1.DeleteSubscriptionRequest; -import com.google.pubsub.v1.GetSnapshotRequest; -import com.google.pubsub.v1.GetSubscriptionRequest; -import com.google.pubsub.v1.ListSnapshotsRequest; -import com.google.pubsub.v1.ListSnapshotsResponse; -import com.google.pubsub.v1.ListSubscriptionsRequest; -import com.google.pubsub.v1.ListSubscriptionsResponse; -import com.google.pubsub.v1.ModifyAckDeadlineRequest; -import com.google.pubsub.v1.ModifyPushConfigRequest; -import com.google.pubsub.v1.PullRequest; -import com.google.pubsub.v1.PullResponse; -import com.google.pubsub.v1.SeekRequest; -import com.google.pubsub.v1.SeekResponse; -import com.google.pubsub.v1.Snapshot; -import com.google.pubsub.v1.StreamingPullRequest; -import com.google.pubsub.v1.StreamingPullResponse; -import com.google.pubsub.v1.SubscriberGrpc.SubscriberImplBase; -import com.google.pubsub.v1.Subscription; -import com.google.pubsub.v1.UpdateSnapshotRequest; -import com.google.pubsub.v1.UpdateSubscriptionRequest; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockSubscriberImpl extends SubscriberImplBase { - private List requests; - private Queue responses; - - public MockSubscriberImpl() { - 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 createSubscription( - Subscription request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Subscription) { - requests.add(request); - responseObserver.onNext(((Subscription) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreateSubscription, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Subscription.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getSubscription( - GetSubscriptionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Subscription) { - requests.add(request); - responseObserver.onNext(((Subscription) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetSubscription, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Subscription.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateSubscription( - UpdateSubscriptionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Subscription) { - requests.add(request); - responseObserver.onNext(((Subscription) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdateSubscription, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Subscription.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listSubscriptions( - ListSubscriptionsRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListSubscriptionsResponse) { - requests.add(request); - responseObserver.onNext(((ListSubscriptionsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListSubscriptions, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListSubscriptionsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteSubscription( - DeleteSubscriptionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method DeleteSubscription, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void modifyAckDeadline( - ModifyAckDeadlineRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method ModifyAckDeadline, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void acknowledge(AcknowledgeRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method Acknowledge, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void pull(PullRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PullResponse) { - requests.add(request); - responseObserver.onNext(((PullResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Pull, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PullResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public StreamObserver streamingPull( - final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(StreamingPullRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof StreamingPullResponse) { - responseObserver.onNext(((StreamingPullResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method StreamingPull, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - StreamingPullResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } - - @Override - public void modifyPushConfig( - ModifyPushConfigRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method ModifyPushConfig, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getSnapshot(GetSnapshotRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Snapshot) { - requests.add(request); - responseObserver.onNext(((Snapshot) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetSnapshot, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Snapshot.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listSnapshots( - ListSnapshotsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListSnapshotsResponse) { - requests.add(request); - responseObserver.onNext(((ListSnapshotsResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListSnapshots, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListSnapshotsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void createSnapshot( - CreateSnapshotRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Snapshot) { - requests.add(request); - responseObserver.onNext(((Snapshot) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreateSnapshot, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Snapshot.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateSnapshot( - UpdateSnapshotRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Snapshot) { - requests.add(request); - responseObserver.onNext(((Snapshot) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdateSnapshot, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Snapshot.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteSnapshot( - DeleteSnapshotRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - 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( - String.format( - "Unrecognized response type %s for method DeleteSnapshot, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void seek(SeekRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof SeekResponse) { - requests.add(request); - responseObserver.onNext(((SeekResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Seek, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - SeekResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SchemaServiceClientHttpJsonTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SchemaServiceClientHttpJsonTest.java deleted file mode 100644 index 964b25a6e..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SchemaServiceClientHttpJsonTest.java +++ /dev/null @@ -1,1169 +0,0 @@ -/* - * Copyright 2023 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.ListSchemaRevisionsPagedResponse; -import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.cloud.pubsub.v1.stub.HttpJsonSchemaServiceStub; -import com.google.common.collect.Lists; -import com.google.iam.v1.AuditConfig; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.Timestamp; -import com.google.pubsub.v1.Encoding; -import com.google.pubsub.v1.ListSchemaRevisionsResponse; -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.ValidateSchemaResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class SchemaServiceClientHttpJsonTest { - private static MockHttpService mockService; - private static SchemaServiceClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonSchemaServiceStub.getMethodDescriptors(), - SchemaServiceSettings.getDefaultEndpoint()); - SchemaServiceSettings settings = - SchemaServiceSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - SchemaServiceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SchemaServiceClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createSchemaTest() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - ProjectName parent = ProjectName.of("[PROJECT]"); - Schema schema = Schema.newBuilder().build(); - String schemaId = "schemaId-697673060"; - - Schema actualResponse = client.createSchema(parent, schema, schemaId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSchemaExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProjectName parent = ProjectName.of("[PROJECT]"); - Schema schema = Schema.newBuilder().build(); - String schemaId = "schemaId-697673060"; - client.createSchema(parent, schema, schemaId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSchemaTest2() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-2353"; - Schema schema = Schema.newBuilder().build(); - String schemaId = "schemaId-697673060"; - - Schema actualResponse = client.createSchema(parent, schema, schemaId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSchemaExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-2353"; - Schema schema = Schema.newBuilder().build(); - String schemaId = "schemaId-697673060"; - client.createSchema(parent, schema, schemaId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSchemaTest() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - - Schema actualResponse = client.getSchema(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSchemaExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - client.getSchema(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSchemaTest2() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-5662/schemas/schema-5662"; - - Schema actualResponse = client.getSchema(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSchemaExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-5662/schemas/schema-5662"; - client.getSchema(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSchemasTest() throws Exception { - Schema responsesElement = Schema.newBuilder().build(); - ListSchemasResponse expectedResponse = - ListSchemasResponse.newBuilder() - .setNextPageToken("") - .addAllSchemas(Arrays.asList(responsesElement)) - .build(); - mockService.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 = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listSchemasExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProjectName parent = ProjectName.of("[PROJECT]"); - client.listSchemas(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSchemasTest2() throws Exception { - Schema responsesElement = Schema.newBuilder().build(); - ListSchemasResponse expectedResponse = - ListSchemasResponse.newBuilder() - .setNextPageToken("") - .addAllSchemas(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-2353"; - - 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 = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listSchemasExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-2353"; - client.listSchemas(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSchemaRevisionsTest() throws Exception { - Schema responsesElement = Schema.newBuilder().build(); - ListSchemaRevisionsResponse expectedResponse = - ListSchemaRevisionsResponse.newBuilder() - .setNextPageToken("") - .addAllSchemas(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - - ListSchemaRevisionsPagedResponse pagedListResponse = client.listSchemaRevisions(name); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSchemasList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listSchemaRevisionsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - client.listSchemaRevisions(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSchemaRevisionsTest2() throws Exception { - Schema responsesElement = Schema.newBuilder().build(); - ListSchemaRevisionsResponse expectedResponse = - ListSchemaRevisionsResponse.newBuilder() - .setNextPageToken("") - .addAllSchemas(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-5662/schemas/schema-5662"; - - ListSchemaRevisionsPagedResponse pagedListResponse = client.listSchemaRevisions(name); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSchemasList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listSchemaRevisionsExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-5662/schemas/schema-5662"; - client.listSchemaRevisions(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void commitSchemaTest() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - Schema schema = Schema.newBuilder().build(); - - Schema actualResponse = client.commitSchema(name, schema); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void commitSchemaExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - Schema schema = Schema.newBuilder().build(); - client.commitSchema(name, schema); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void commitSchemaTest2() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-5662/schemas/schema-5662"; - Schema schema = Schema.newBuilder().build(); - - Schema actualResponse = client.commitSchema(name, schema); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void commitSchemaExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-5662/schemas/schema-5662"; - Schema schema = Schema.newBuilder().build(); - client.commitSchema(name, schema); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void rollbackSchemaTest() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - String revisionId = "revisionId-1507445162"; - - Schema actualResponse = client.rollbackSchema(name, revisionId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void rollbackSchemaExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - String revisionId = "revisionId-1507445162"; - client.rollbackSchema(name, revisionId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void rollbackSchemaTest2() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-5662/schemas/schema-5662"; - String revisionId = "revisionId-1507445162"; - - Schema actualResponse = client.rollbackSchema(name, revisionId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void rollbackSchemaExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-5662/schemas/schema-5662"; - String revisionId = "revisionId-1507445162"; - client.rollbackSchema(name, revisionId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSchemaRevisionTest() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - String revisionId = "revisionId-1507445162"; - - Schema actualResponse = client.deleteSchemaRevision(name, revisionId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteSchemaRevisionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - String revisionId = "revisionId-1507445162"; - client.deleteSchemaRevision(name, revisionId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSchemaRevisionTest2() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-5662/schemas/schema-5662"; - String revisionId = "revisionId-1507445162"; - - Schema actualResponse = client.deleteSchemaRevision(name, revisionId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteSchemaRevisionExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-5662/schemas/schema-5662"; - String revisionId = "revisionId-1507445162"; - client.deleteSchemaRevision(name, revisionId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSchemaTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - - client.deleteSchema(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteSchemaExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - client.deleteSchema(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSchemaTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-5662/schemas/schema-5662"; - - client.deleteSchema(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteSchemaExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-5662/schemas/schema-5662"; - client.deleteSchema(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void validateSchemaTest() throws Exception { - ValidateSchemaResponse expectedResponse = ValidateSchemaResponse.newBuilder().build(); - mockService.addResponse(expectedResponse); - - ProjectName parent = ProjectName.of("[PROJECT]"); - Schema schema = Schema.newBuilder().build(); - - ValidateSchemaResponse actualResponse = client.validateSchema(parent, schema); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void validateSchemaExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.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 - public void validateSchemaTest2() throws Exception { - ValidateSchemaResponse expectedResponse = ValidateSchemaResponse.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-2353"; - Schema schema = Schema.newBuilder().build(); - - ValidateSchemaResponse actualResponse = client.validateSchema(parent, schema); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void validateSchemaExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-2353"; - Schema schema = Schema.newBuilder().build(); - client.validateSchema(parent, schema); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void validateMessageTest() throws Exception { - ValidateMessageResponse expectedResponse = ValidateMessageResponse.newBuilder().build(); - mockService.addResponse(expectedResponse); - - ValidateMessageRequest request = - ValidateMessageRequest.newBuilder() - .setParent(ProjectName.of("[PROJECT]").toString()) - .setMessage(ByteString.EMPTY) - .setEncoding(Encoding.forNumber(0)) - .build(); - - ValidateMessageResponse actualResponse = client.validateMessage(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void validateMessageExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ValidateMessageRequest request = - ValidateMessageRequest.newBuilder() - .setParent(ProjectName.of("[PROJECT]").toString()) - .setMessage(ByteString.EMPTY) - .setEncoding(Encoding.forNumber(0)) - .build(); - client.validateMessage(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockService.addResponse(expectedResponse); - - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Policy actualResponse = client.setIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.setIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockService.addResponse(expectedResponse); - - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - - Policy actualResponse = client.getIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - client.getIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - client.testIamPermissions(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/SchemaServiceClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java deleted file mode 100644 index 7d216444b..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java +++ /dev/null @@ -1,1074 +0,0 @@ -/* - * Copyright 2023 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.ListSchemaRevisionsPagedResponse; -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.iam.v1.AuditConfig; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.Timestamp; -import com.google.pubsub.v1.CommitSchemaRequest; -import com.google.pubsub.v1.CreateSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRequest; -import com.google.pubsub.v1.DeleteSchemaRevisionRequest; -import com.google.pubsub.v1.Encoding; -import com.google.pubsub.v1.GetSchemaRequest; -import com.google.pubsub.v1.ListSchemaRevisionsRequest; -import com.google.pubsub.v1.ListSchemaRevisionsResponse; -import com.google.pubsub.v1.ListSchemasRequest; -import com.google.pubsub.v1.ListSchemasResponse; -import com.google.pubsub.v1.ProjectName; -import com.google.pubsub.v1.RollbackSchemaRequest; -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.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class SchemaServiceClientTest { - private static MockIAMPolicy mockIAMPolicy; - private static MockSchemaService mockSchemaService; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private SchemaServiceClient client; - - @BeforeClass - public static void startStaticServer() { - mockSchemaService = new MockSchemaService(); - mockIAMPolicy = new MockIAMPolicy(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList(mockSchemaService, mockIAMPolicy)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - SchemaServiceSettings settings = - SchemaServiceSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SchemaServiceClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createSchemaTest() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockSchemaService.addResponse(expectedResponse); - - ProjectName parent = ProjectName.of("[PROJECT]"); - Schema schema = Schema.newBuilder().build(); - String schemaId = "schemaId-697673060"; - - 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.toString(), actualRequest.getParent()); - Assert.assertEquals(schema, actualRequest.getSchema()); - Assert.assertEquals(schemaId, actualRequest.getSchemaId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSchemaExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - ProjectName parent = ProjectName.of("[PROJECT]"); - Schema schema = Schema.newBuilder().build(); - String schemaId = "schemaId-697673060"; - client.createSchema(parent, schema, schemaId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSchemaTest2() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockSchemaService.addResponse(expectedResponse); - - String parent = "parent-995424086"; - Schema schema = Schema.newBuilder().build(); - String schemaId = "schemaId-697673060"; - - 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, actualRequest.getParent()); - Assert.assertEquals(schema, actualRequest.getSchema()); - Assert.assertEquals(schemaId, actualRequest.getSchemaId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSchemaExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - String parent = "parent-995424086"; - Schema schema = Schema.newBuilder().build(); - String schemaId = "schemaId-697673060"; - client.createSchema(parent, schema, schemaId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSchemaTest() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .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.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSchemaExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.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 - public void getSchemaTest2() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockSchemaService.addResponse(expectedResponse); - - String name = "name3373707"; - - 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, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSchemaExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - String name = "name3373707"; - client.getSchema(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSchemasTest() throws Exception { - Schema responsesElement = Schema.newBuilder().build(); - ListSchemasResponse expectedResponse = - ListSchemasResponse.newBuilder() - .setNextPageToken("") - .addAllSchemas(Arrays.asList(responsesElement)) - .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.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listSchemasExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.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 - public void listSchemasTest2() throws Exception { - Schema responsesElement = Schema.newBuilder().build(); - ListSchemasResponse expectedResponse = - ListSchemasResponse.newBuilder() - .setNextPageToken("") - .addAllSchemas(Arrays.asList(responsesElement)) - .build(); - mockSchemaService.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - 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, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listSchemasExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - String parent = "parent-995424086"; - client.listSchemas(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSchemaRevisionsTest() throws Exception { - Schema responsesElement = Schema.newBuilder().build(); - ListSchemaRevisionsResponse expectedResponse = - ListSchemaRevisionsResponse.newBuilder() - .setNextPageToken("") - .addAllSchemas(Arrays.asList(responsesElement)) - .build(); - mockSchemaService.addResponse(expectedResponse); - - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - - ListSchemaRevisionsPagedResponse pagedListResponse = client.listSchemaRevisions(name); - - 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()); - ListSchemaRevisionsRequest actualRequest = ((ListSchemaRevisionsRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listSchemaRevisionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - client.listSchemaRevisions(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSchemaRevisionsTest2() throws Exception { - Schema responsesElement = Schema.newBuilder().build(); - ListSchemaRevisionsResponse expectedResponse = - ListSchemaRevisionsResponse.newBuilder() - .setNextPageToken("") - .addAllSchemas(Arrays.asList(responsesElement)) - .build(); - mockSchemaService.addResponse(expectedResponse); - - String name = "name3373707"; - - ListSchemaRevisionsPagedResponse pagedListResponse = client.listSchemaRevisions(name); - - 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()); - ListSchemaRevisionsRequest actualRequest = ((ListSchemaRevisionsRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listSchemaRevisionsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - String name = "name3373707"; - client.listSchemaRevisions(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void commitSchemaTest() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockSchemaService.addResponse(expectedResponse); - - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - Schema schema = Schema.newBuilder().build(); - - Schema actualResponse = client.commitSchema(name, schema); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSchemaService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CommitSchemaRequest actualRequest = ((CommitSchemaRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertEquals(schema, actualRequest.getSchema()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void commitSchemaExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - Schema schema = Schema.newBuilder().build(); - client.commitSchema(name, schema); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void commitSchemaTest2() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockSchemaService.addResponse(expectedResponse); - - String name = "name3373707"; - Schema schema = Schema.newBuilder().build(); - - Schema actualResponse = client.commitSchema(name, schema); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSchemaService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CommitSchemaRequest actualRequest = ((CommitSchemaRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(schema, actualRequest.getSchema()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void commitSchemaExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - String name = "name3373707"; - Schema schema = Schema.newBuilder().build(); - client.commitSchema(name, schema); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void rollbackSchemaTest() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockSchemaService.addResponse(expectedResponse); - - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - String revisionId = "revisionId-1507445162"; - - Schema actualResponse = client.rollbackSchema(name, revisionId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSchemaService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RollbackSchemaRequest actualRequest = ((RollbackSchemaRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertEquals(revisionId, actualRequest.getRevisionId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void rollbackSchemaExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - String revisionId = "revisionId-1507445162"; - client.rollbackSchema(name, revisionId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void rollbackSchemaTest2() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockSchemaService.addResponse(expectedResponse); - - String name = "name3373707"; - String revisionId = "revisionId-1507445162"; - - Schema actualResponse = client.rollbackSchema(name, revisionId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSchemaService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RollbackSchemaRequest actualRequest = ((RollbackSchemaRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(revisionId, actualRequest.getRevisionId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void rollbackSchemaExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - String name = "name3373707"; - String revisionId = "revisionId-1507445162"; - client.rollbackSchema(name, revisionId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSchemaRevisionTest() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockSchemaService.addResponse(expectedResponse); - - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - String revisionId = "revisionId-1507445162"; - - Schema actualResponse = client.deleteSchemaRevision(name, revisionId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSchemaService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteSchemaRevisionRequest actualRequest = - ((DeleteSchemaRevisionRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertEquals(revisionId, actualRequest.getRevisionId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteSchemaRevisionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); - String revisionId = "revisionId-1507445162"; - client.deleteSchemaRevision(name, revisionId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSchemaRevisionTest2() throws Exception { - Schema expectedResponse = - Schema.newBuilder() - .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setDefinition("definition-1014418093") - .setRevisionId("revisionId-1507445162") - .setRevisionCreateTime(Timestamp.newBuilder().build()) - .build(); - mockSchemaService.addResponse(expectedResponse); - - String name = "name3373707"; - String revisionId = "revisionId-1507445162"; - - Schema actualResponse = client.deleteSchemaRevision(name, revisionId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSchemaService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteSchemaRevisionRequest actualRequest = - ((DeleteSchemaRevisionRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(revisionId, actualRequest.getRevisionId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteSchemaRevisionExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - String name = "name3373707"; - String revisionId = "revisionId-1507445162"; - client.deleteSchemaRevision(name, revisionId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSchemaTest() throws Exception { - 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.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteSchemaExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.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 - public void deleteSchemaTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSchemaService.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteSchema(name); - - List actualRequests = mockSchemaService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteSchemaRequest actualRequest = ((DeleteSchemaRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteSchemaExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - String name = "name3373707"; - client.deleteSchema(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void validateSchemaTest() throws Exception { - 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.toString(), actualRequest.getParent()); - Assert.assertEquals(schema, actualRequest.getSchema()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void validateSchemaExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.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 - public void validateSchemaTest2() throws Exception { - ValidateSchemaResponse expectedResponse = ValidateSchemaResponse.newBuilder().build(); - mockSchemaService.addResponse(expectedResponse); - - String parent = "parent-995424086"; - 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, actualRequest.getParent()); - Assert.assertEquals(schema, actualRequest.getSchema()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void validateSchemaExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - String parent = "parent-995424086"; - Schema schema = Schema.newBuilder().build(); - client.validateSchema(parent, schema); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void validateMessageTest() throws Exception { - ValidateMessageResponse expectedResponse = ValidateMessageResponse.newBuilder().build(); - mockSchemaService.addResponse(expectedResponse); - - ValidateMessageRequest request = - ValidateMessageRequest.newBuilder() - .setParent(ProjectName.of("[PROJECT]").toString()) - .setMessage(ByteString.EMPTY) - .setEncoding(Encoding.forNumber(0)) - .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(request.getParent(), actualRequest.getParent()); - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getSchema(), actualRequest.getSchema()); - Assert.assertEquals(request.getMessage(), actualRequest.getMessage()); - Assert.assertEquals(request.getEncoding(), actualRequest.getEncoding()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void validateMessageExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSchemaService.addException(exception); - - try { - ValidateMessageRequest request = - ValidateMessageRequest.newBuilder() - .setParent(ProjectName.of("[PROJECT]").toString()) - .setMessage(ByteString.EMPTY) - .setEncoding(Encoding.forNumber(0)) - .build(); - client.validateMessage(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockIAMPolicy.addResponse(expectedResponse); - - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Policy actualResponse = client.setIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.setIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockIAMPolicy.addResponse(expectedResponse); - - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - - Policy actualResponse = client.getIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - client.getIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockIAMPolicy.addResponse(expectedResponse); - - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - client.testIamPermissions(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/SubscriptionAdminClientHttpJsonTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientHttpJsonTest.java deleted file mode 100644 index 433d1aa6c..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientHttpJsonTest.java +++ /dev/null @@ -1,1962 +0,0 @@ -/* - * Copyright 2023 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.SubscriptionAdminClient.ListSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.cloud.pubsub.v1.stub.HttpJsonSubscriberStub; -import com.google.common.collect.Lists; -import com.google.iam.v1.AuditConfig; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.ByteString; -import com.google.protobuf.Duration; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.Timestamp; -import com.google.pubsub.v1.BigQueryConfig; -import com.google.pubsub.v1.CloudStorageConfig; -import com.google.pubsub.v1.DeadLetterPolicy; -import com.google.pubsub.v1.ExpirationPolicy; -import com.google.pubsub.v1.ListSnapshotsResponse; -import com.google.pubsub.v1.ListSubscriptionsResponse; -import com.google.pubsub.v1.ProjectName; -import com.google.pubsub.v1.PullResponse; -import com.google.pubsub.v1.PushConfig; -import com.google.pubsub.v1.ReceivedMessage; -import com.google.pubsub.v1.RetryPolicy; -import com.google.pubsub.v1.SchemaName; -import com.google.pubsub.v1.SeekRequest; -import com.google.pubsub.v1.SeekResponse; -import com.google.pubsub.v1.Snapshot; -import com.google.pubsub.v1.SnapshotName; -import com.google.pubsub.v1.Subscription; -import com.google.pubsub.v1.SubscriptionName; -import com.google.pubsub.v1.TopicName; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class SubscriptionAdminClientHttpJsonTest { - private static MockHttpService mockService; - private static SubscriptionAdminClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonSubscriberStub.getMethodDescriptors(), - SubscriptionAdminSettings.getDefaultEndpoint()); - SubscriptionAdminSettings settings = - SubscriptionAdminSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - SubscriptionAdminSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SubscriptionAdminClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createSubscriptionTest() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - - Subscription actualResponse = - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSubscriptionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSubscriptionTest2() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - String topic = "topic110546223"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - - Subscription actualResponse = - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSubscriptionExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - String topic = "topic110546223"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSubscriptionTest3() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-7298/subscriptions/subscription-7298"; - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - - Subscription actualResponse = - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSubscriptionExceptionTest3() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-7298/subscriptions/subscription-7298"; - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSubscriptionTest4() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-7298/subscriptions/subscription-7298"; - String topic = "topic110546223"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - - Subscription actualResponse = - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSubscriptionExceptionTest4() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-7298/subscriptions/subscription-7298"; - String topic = "topic110546223"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSubscriptionTest() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - - Subscription actualResponse = client.getSubscription(subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSubscriptionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - client.getSubscription(subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSubscriptionTest2() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - - Subscription actualResponse = client.getSubscription(subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSubscriptionExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - client.getSubscription(subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateSubscriptionTest() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - Subscription subscription = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - Subscription actualResponse = client.updateSubscription(subscription, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateSubscriptionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Subscription subscription = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateSubscription(subscription, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSubscriptionsTest() throws Exception { - Subscription responsesElement = Subscription.newBuilder().build(); - ListSubscriptionsResponse expectedResponse = - ListSubscriptionsResponse.newBuilder() - .setNextPageToken("") - .addAllSubscriptions(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ProjectName project = ProjectName.of("[PROJECT]"); - - ListSubscriptionsPagedResponse pagedListResponse = client.listSubscriptions(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listSubscriptionsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProjectName project = ProjectName.of("[PROJECT]"); - client.listSubscriptions(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSubscriptionsTest2() throws Exception { - Subscription responsesElement = Subscription.newBuilder().build(); - ListSubscriptionsResponse expectedResponse = - ListSubscriptionsResponse.newBuilder() - .setNextPageToken("") - .addAllSubscriptions(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String project = "projects/project-7934"; - - ListSubscriptionsPagedResponse pagedListResponse = client.listSubscriptions(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listSubscriptionsExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String project = "projects/project-7934"; - client.listSubscriptions(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSubscriptionTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - - client.deleteSubscription(subscription); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteSubscriptionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - client.deleteSubscription(subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSubscriptionTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - - client.deleteSubscription(subscription); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteSubscriptionExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - client.deleteSubscription(subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void modifyAckDeadlineTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - List ackIds = new ArrayList<>(); - int ackDeadlineSeconds = 2135351438; - - client.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void modifyAckDeadlineExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - List ackIds = new ArrayList<>(); - int ackDeadlineSeconds = 2135351438; - client.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void modifyAckDeadlineTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - List ackIds = new ArrayList<>(); - int ackDeadlineSeconds = 2135351438; - - client.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void modifyAckDeadlineExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - List ackIds = new ArrayList<>(); - int ackDeadlineSeconds = 2135351438; - client.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void acknowledgeTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - List ackIds = new ArrayList<>(); - - client.acknowledge(subscription, ackIds); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void acknowledgeExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - List ackIds = new ArrayList<>(); - client.acknowledge(subscription, ackIds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void acknowledgeTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - List ackIds = new ArrayList<>(); - - client.acknowledge(subscription, ackIds); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void acknowledgeExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - List ackIds = new ArrayList<>(); - client.acknowledge(subscription, ackIds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pullTest() throws Exception { - PullResponse expectedResponse = - PullResponse.newBuilder().addAllReceivedMessages(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - int maxMessages = 496131527; - - PullResponse actualResponse = client.pull(subscription, maxMessages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void pullExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - int maxMessages = 496131527; - client.pull(subscription, maxMessages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pullTest2() throws Exception { - PullResponse expectedResponse = - PullResponse.newBuilder().addAllReceivedMessages(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - int maxMessages = 496131527; - - PullResponse actualResponse = client.pull(subscription, maxMessages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void pullExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - int maxMessages = 496131527; - client.pull(subscription, maxMessages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pullTest3() throws Exception { - PullResponse expectedResponse = - PullResponse.newBuilder().addAllReceivedMessages(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - boolean returnImmediately = true; - int maxMessages = 496131527; - - PullResponse actualResponse = client.pull(subscription, returnImmediately, maxMessages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void pullExceptionTest3() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - boolean returnImmediately = true; - int maxMessages = 496131527; - client.pull(subscription, returnImmediately, maxMessages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pullTest4() throws Exception { - PullResponse expectedResponse = - PullResponse.newBuilder().addAllReceivedMessages(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - boolean returnImmediately = true; - int maxMessages = 496131527; - - PullResponse actualResponse = client.pull(subscription, returnImmediately, maxMessages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void pullExceptionTest4() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - boolean returnImmediately = true; - int maxMessages = 496131527; - client.pull(subscription, returnImmediately, maxMessages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void streamingPullUnsupportedMethodTest() throws Exception { - // The streamingPull() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } - - @Test - public void modifyPushConfigTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - - client.modifyPushConfig(subscription, pushConfig); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void modifyPushConfigExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - client.modifyPushConfig(subscription, pushConfig); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void modifyPushConfigTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - - client.modifyPushConfig(subscription, pushConfig); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void modifyPushConfigExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String subscription = "projects/project-1980/subscriptions/subscription-1980"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - client.modifyPushConfig(subscription, pushConfig); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSnapshotTest() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockService.addResponse(expectedResponse); - - SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - - Snapshot actualResponse = client.getSnapshot(snapshot); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSnapshotExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - client.getSnapshot(snapshot); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSnapshotTest2() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockService.addResponse(expectedResponse); - - String snapshot = "projects/project-2020/snapshots/snapshot-2020"; - - Snapshot actualResponse = client.getSnapshot(snapshot); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSnapshotExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String snapshot = "projects/project-2020/snapshots/snapshot-2020"; - client.getSnapshot(snapshot); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSnapshotsTest() throws Exception { - Snapshot responsesElement = Snapshot.newBuilder().build(); - ListSnapshotsResponse expectedResponse = - ListSnapshotsResponse.newBuilder() - .setNextPageToken("") - .addAllSnapshots(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ProjectName project = ProjectName.of("[PROJECT]"); - - ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listSnapshotsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProjectName project = ProjectName.of("[PROJECT]"); - client.listSnapshots(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSnapshotsTest2() throws Exception { - Snapshot responsesElement = Snapshot.newBuilder().build(); - ListSnapshotsResponse expectedResponse = - ListSnapshotsResponse.newBuilder() - .setNextPageToken("") - .addAllSnapshots(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String project = "projects/project-7934"; - - ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listSnapshotsExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String project = "projects/project-7934"; - client.listSnapshots(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSnapshotTest() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockService.addResponse(expectedResponse); - - SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - - Snapshot actualResponse = client.createSnapshot(name, subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSnapshotExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - client.createSnapshot(name, subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSnapshotTest2() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockService.addResponse(expectedResponse); - - SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - String subscription = "subscription341203229"; - - Snapshot actualResponse = client.createSnapshot(name, subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSnapshotExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - String subscription = "subscription341203229"; - client.createSnapshot(name, subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSnapshotTest3() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-4389/snapshots/snapshot-4389"; - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - - Snapshot actualResponse = client.createSnapshot(name, subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSnapshotExceptionTest3() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-4389/snapshots/snapshot-4389"; - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - client.createSnapshot(name, subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSnapshotTest4() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-4389/snapshots/snapshot-4389"; - String subscription = "subscription341203229"; - - Snapshot actualResponse = client.createSnapshot(name, subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSnapshotExceptionTest4() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-4389/snapshots/snapshot-4389"; - String subscription = "subscription341203229"; - client.createSnapshot(name, subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateSnapshotTest() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockService.addResponse(expectedResponse); - - Snapshot snapshot = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - Snapshot actualResponse = client.updateSnapshot(snapshot, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateSnapshotExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Snapshot snapshot = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateSnapshot(snapshot, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSnapshotTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - - client.deleteSnapshot(snapshot); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteSnapshotExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - client.deleteSnapshot(snapshot); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSnapshotTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String snapshot = "projects/project-2020/snapshots/snapshot-2020"; - - client.deleteSnapshot(snapshot); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteSnapshotExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String snapshot = "projects/project-2020/snapshots/snapshot-2020"; - client.deleteSnapshot(snapshot); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void seekTest() throws Exception { - SeekResponse expectedResponse = SeekResponse.newBuilder().build(); - mockService.addResponse(expectedResponse); - - SeekRequest request = - SeekRequest.newBuilder() - .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .build(); - - SeekResponse actualResponse = client.seek(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void seekExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SeekRequest request = - SeekRequest.newBuilder() - .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .build(); - client.seek(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockService.addResponse(expectedResponse); - - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Policy actualResponse = client.setIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.setIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockService.addResponse(expectedResponse); - - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - - Policy actualResponse = client.getIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - client.getIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - client.testIamPermissions(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 deleted file mode 100644 index c636cdcd3..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java +++ /dev/null @@ -1,1829 +0,0 @@ -/* - * Copyright 2023 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.SubscriptionAdminClient.ListSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPagedResponse; - -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.grpc.testing.MockStreamObserver; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.common.collect.Lists; -import com.google.iam.v1.AuditConfig; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.ByteString; -import com.google.protobuf.Duration; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.Timestamp; -import com.google.pubsub.v1.AcknowledgeRequest; -import com.google.pubsub.v1.BigQueryConfig; -import com.google.pubsub.v1.CloudStorageConfig; -import com.google.pubsub.v1.CreateSnapshotRequest; -import com.google.pubsub.v1.DeadLetterPolicy; -import com.google.pubsub.v1.DeleteSnapshotRequest; -import com.google.pubsub.v1.DeleteSubscriptionRequest; -import com.google.pubsub.v1.ExpirationPolicy; -import com.google.pubsub.v1.GetSnapshotRequest; -import com.google.pubsub.v1.GetSubscriptionRequest; -import com.google.pubsub.v1.ListSnapshotsRequest; -import com.google.pubsub.v1.ListSnapshotsResponse; -import com.google.pubsub.v1.ListSubscriptionsRequest; -import com.google.pubsub.v1.ListSubscriptionsResponse; -import com.google.pubsub.v1.ModifyAckDeadlineRequest; -import com.google.pubsub.v1.ModifyPushConfigRequest; -import com.google.pubsub.v1.ProjectName; -import com.google.pubsub.v1.PullRequest; -import com.google.pubsub.v1.PullResponse; -import com.google.pubsub.v1.PushConfig; -import com.google.pubsub.v1.ReceivedMessage; -import com.google.pubsub.v1.RetryPolicy; -import com.google.pubsub.v1.SchemaName; -import com.google.pubsub.v1.SeekRequest; -import com.google.pubsub.v1.SeekResponse; -import com.google.pubsub.v1.Snapshot; -import com.google.pubsub.v1.SnapshotName; -import com.google.pubsub.v1.StreamingPullRequest; -import com.google.pubsub.v1.StreamingPullResponse; -import com.google.pubsub.v1.Subscription; -import com.google.pubsub.v1.SubscriptionName; -import com.google.pubsub.v1.TopicName; -import com.google.pubsub.v1.UpdateSnapshotRequest; -import com.google.pubsub.v1.UpdateSubscriptionRequest; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class SubscriptionAdminClientTest { - private static MockIAMPolicy mockIAMPolicy; - private static MockServiceHelper mockServiceHelper; - private static MockSubscriber mockSubscriber; - private LocalChannelProvider channelProvider; - private SubscriptionAdminClient client; - - @BeforeClass - public static void startStaticServer() { - mockSubscriber = new MockSubscriber(); - mockIAMPolicy = new MockIAMPolicy(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList(mockSubscriber, mockIAMPolicy)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - SubscriptionAdminSettings settings = - SubscriptionAdminSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SubscriptionAdminClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createSubscriptionTest() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - - Subscription actualResponse = - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - Subscription actualRequest = ((Subscription) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertEquals(topic.toString(), actualRequest.getTopic()); - Assert.assertEquals(pushConfig, actualRequest.getPushConfig()); - Assert.assertEquals(ackDeadlineSeconds, actualRequest.getAckDeadlineSeconds()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSubscriptionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSubscriptionTest2() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - String topic = "topic110546223"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - - Subscription actualResponse = - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - Subscription actualRequest = ((Subscription) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertEquals(topic, actualRequest.getTopic()); - Assert.assertEquals(pushConfig, actualRequest.getPushConfig()); - Assert.assertEquals(ackDeadlineSeconds, actualRequest.getAckDeadlineSeconds()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSubscriptionExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - String topic = "topic110546223"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSubscriptionTest3() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - String name = "name3373707"; - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - - Subscription actualResponse = - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - Subscription actualRequest = ((Subscription) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(topic.toString(), actualRequest.getTopic()); - Assert.assertEquals(pushConfig, actualRequest.getPushConfig()); - Assert.assertEquals(ackDeadlineSeconds, actualRequest.getAckDeadlineSeconds()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSubscriptionExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String name = "name3373707"; - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSubscriptionTest4() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - String name = "name3373707"; - String topic = "topic110546223"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - - Subscription actualResponse = - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - Subscription actualRequest = ((Subscription) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(topic, actualRequest.getTopic()); - Assert.assertEquals(pushConfig, actualRequest.getPushConfig()); - Assert.assertEquals(ackDeadlineSeconds, actualRequest.getAckDeadlineSeconds()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSubscriptionExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String name = "name3373707"; - String topic = "topic110546223"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - int ackDeadlineSeconds = 2135351438; - client.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSubscriptionTest() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - - Subscription actualResponse = client.getSubscription(subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetSubscriptionRequest actualRequest = ((GetSubscriptionRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription.toString(), actualRequest.getSubscription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSubscriptionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - client.getSubscription(subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSubscriptionTest2() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - String subscription = "subscription341203229"; - - Subscription actualResponse = client.getSubscription(subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetSubscriptionRequest actualRequest = ((GetSubscriptionRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription, actualRequest.getSubscription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSubscriptionExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String subscription = "subscription341203229"; - client.getSubscription(subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateSubscriptionTest() throws Exception { - Subscription expectedResponse = - Subscription.newBuilder() - .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setPushConfig(PushConfig.newBuilder().build()) - .setBigqueryConfig(BigQueryConfig.newBuilder().build()) - .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) - .setAckDeadlineSeconds(2135351438) - .setRetainAckedMessages(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .putAllLabels(new HashMap()) - .setEnableMessageOrdering(true) - .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) - .setFilter("filter-1274492040") - .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) - .setRetryPolicy(RetryPolicy.newBuilder().build()) - .setDetached(true) - .setEnableExactlyOnceDelivery(true) - .setTopicMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - Subscription subscription = Subscription.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - Subscription actualResponse = client.updateSubscription(subscription, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateSubscriptionRequest actualRequest = ((UpdateSubscriptionRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription, actualRequest.getSubscription()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateSubscriptionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - Subscription subscription = Subscription.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateSubscription(subscription, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSubscriptionsTest() throws Exception { - Subscription responsesElement = Subscription.newBuilder().build(); - ListSubscriptionsResponse expectedResponse = - ListSubscriptionsResponse.newBuilder() - .setNextPageToken("") - .addAllSubscriptions(Arrays.asList(responsesElement)) - .build(); - mockSubscriber.addResponse(expectedResponse); - - ProjectName project = ProjectName.of("[PROJECT]"); - - ListSubscriptionsPagedResponse pagedListResponse = client.listSubscriptions(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListSubscriptionsRequest actualRequest = ((ListSubscriptionsRequest) actualRequests.get(0)); - - Assert.assertEquals(project.toString(), actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listSubscriptionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - ProjectName project = ProjectName.of("[PROJECT]"); - client.listSubscriptions(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSubscriptionsTest2() throws Exception { - Subscription responsesElement = Subscription.newBuilder().build(); - ListSubscriptionsResponse expectedResponse = - ListSubscriptionsResponse.newBuilder() - .setNextPageToken("") - .addAllSubscriptions(Arrays.asList(responsesElement)) - .build(); - mockSubscriber.addResponse(expectedResponse); - - String project = "project-309310695"; - - ListSubscriptionsPagedResponse pagedListResponse = client.listSubscriptions(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListSubscriptionsRequest actualRequest = ((ListSubscriptionsRequest) actualRequests.get(0)); - - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listSubscriptionsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String project = "project-309310695"; - client.listSubscriptions(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSubscriptionTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - - client.deleteSubscription(subscription); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteSubscriptionRequest actualRequest = ((DeleteSubscriptionRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription.toString(), actualRequest.getSubscription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteSubscriptionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - client.deleteSubscription(subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSubscriptionTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - String subscription = "subscription341203229"; - - client.deleteSubscription(subscription); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteSubscriptionRequest actualRequest = ((DeleteSubscriptionRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription, actualRequest.getSubscription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteSubscriptionExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String subscription = "subscription341203229"; - client.deleteSubscription(subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void modifyAckDeadlineTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - List ackIds = new ArrayList<>(); - int ackDeadlineSeconds = 2135351438; - - client.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ModifyAckDeadlineRequest actualRequest = ((ModifyAckDeadlineRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription.toString(), actualRequest.getSubscription()); - Assert.assertEquals(ackIds, actualRequest.getAckIdsList()); - Assert.assertEquals(ackDeadlineSeconds, actualRequest.getAckDeadlineSeconds()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void modifyAckDeadlineExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - List ackIds = new ArrayList<>(); - int ackDeadlineSeconds = 2135351438; - client.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void modifyAckDeadlineTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - String subscription = "subscription341203229"; - List ackIds = new ArrayList<>(); - int ackDeadlineSeconds = 2135351438; - - client.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ModifyAckDeadlineRequest actualRequest = ((ModifyAckDeadlineRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription, actualRequest.getSubscription()); - Assert.assertEquals(ackIds, actualRequest.getAckIdsList()); - Assert.assertEquals(ackDeadlineSeconds, actualRequest.getAckDeadlineSeconds()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void modifyAckDeadlineExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String subscription = "subscription341203229"; - List ackIds = new ArrayList<>(); - int ackDeadlineSeconds = 2135351438; - client.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void acknowledgeTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - List ackIds = new ArrayList<>(); - - client.acknowledge(subscription, ackIds); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AcknowledgeRequest actualRequest = ((AcknowledgeRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription.toString(), actualRequest.getSubscription()); - Assert.assertEquals(ackIds, actualRequest.getAckIdsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void acknowledgeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - List ackIds = new ArrayList<>(); - client.acknowledge(subscription, ackIds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void acknowledgeTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - String subscription = "subscription341203229"; - List ackIds = new ArrayList<>(); - - client.acknowledge(subscription, ackIds); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AcknowledgeRequest actualRequest = ((AcknowledgeRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription, actualRequest.getSubscription()); - Assert.assertEquals(ackIds, actualRequest.getAckIdsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void acknowledgeExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String subscription = "subscription341203229"; - List ackIds = new ArrayList<>(); - client.acknowledge(subscription, ackIds); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pullTest() throws Exception { - PullResponse expectedResponse = - PullResponse.newBuilder().addAllReceivedMessages(new ArrayList()).build(); - mockSubscriber.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - int maxMessages = 496131527; - - PullResponse actualResponse = client.pull(subscription, maxMessages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PullRequest actualRequest = ((PullRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription.toString(), actualRequest.getSubscription()); - Assert.assertEquals(maxMessages, actualRequest.getMaxMessages()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void pullExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - int maxMessages = 496131527; - client.pull(subscription, maxMessages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pullTest2() throws Exception { - PullResponse expectedResponse = - PullResponse.newBuilder().addAllReceivedMessages(new ArrayList()).build(); - mockSubscriber.addResponse(expectedResponse); - - String subscription = "subscription341203229"; - int maxMessages = 496131527; - - PullResponse actualResponse = client.pull(subscription, maxMessages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PullRequest actualRequest = ((PullRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription, actualRequest.getSubscription()); - Assert.assertEquals(maxMessages, actualRequest.getMaxMessages()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void pullExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String subscription = "subscription341203229"; - int maxMessages = 496131527; - client.pull(subscription, maxMessages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pullTest3() throws Exception { - PullResponse expectedResponse = - PullResponse.newBuilder().addAllReceivedMessages(new ArrayList()).build(); - mockSubscriber.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - boolean returnImmediately = true; - int maxMessages = 496131527; - - PullResponse actualResponse = client.pull(subscription, returnImmediately, maxMessages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PullRequest actualRequest = ((PullRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription.toString(), actualRequest.getSubscription()); - Assert.assertEquals(returnImmediately, actualRequest.getReturnImmediately()); - Assert.assertEquals(maxMessages, actualRequest.getMaxMessages()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void pullExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - boolean returnImmediately = true; - int maxMessages = 496131527; - client.pull(subscription, returnImmediately, maxMessages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pullTest4() throws Exception { - PullResponse expectedResponse = - PullResponse.newBuilder().addAllReceivedMessages(new ArrayList()).build(); - mockSubscriber.addResponse(expectedResponse); - - String subscription = "subscription341203229"; - boolean returnImmediately = true; - int maxMessages = 496131527; - - PullResponse actualResponse = client.pull(subscription, returnImmediately, maxMessages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PullRequest actualRequest = ((PullRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription, actualRequest.getSubscription()); - Assert.assertEquals(returnImmediately, actualRequest.getReturnImmediately()); - Assert.assertEquals(maxMessages, actualRequest.getMaxMessages()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void pullExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String subscription = "subscription341203229"; - boolean returnImmediately = true; - int maxMessages = 496131527; - client.pull(subscription, returnImmediately, maxMessages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void streamingPullTest() throws Exception { - StreamingPullResponse expectedResponse = - StreamingPullResponse.newBuilder() - .addAllReceivedMessages(new ArrayList()) - .setAcknowledgeConfirmation( - StreamingPullResponse.AcknowledgeConfirmation.newBuilder().build()) - .setModifyAckDeadlineConfirmation( - StreamingPullResponse.ModifyAckDeadlineConfirmation.newBuilder().build()) - .setSubscriptionProperties( - StreamingPullResponse.SubscriptionProperties.newBuilder().build()) - .build(); - mockSubscriber.addResponse(expectedResponse); - StreamingPullRequest request = - StreamingPullRequest.newBuilder() - .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .addAllAckIds(new ArrayList()) - .addAllModifyDeadlineSeconds(new ArrayList()) - .addAllModifyDeadlineAckIds(new ArrayList()) - .setStreamAckDeadlineSeconds(1875467245) - .setClientId("clientId908408390") - .setMaxOutstandingMessages(-1315266996) - .setMaxOutstandingBytes(-2103098517) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.streamingPullCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void streamingPullExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - StreamingPullRequest request = - StreamingPullRequest.newBuilder() - .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .addAllAckIds(new ArrayList()) - .addAllModifyDeadlineSeconds(new ArrayList()) - .addAllModifyDeadlineAckIds(new ArrayList()) - .setStreamAckDeadlineSeconds(1875467245) - .setClientId("clientId908408390") - .setMaxOutstandingMessages(-1315266996) - .setMaxOutstandingBytes(-2103098517) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.streamingPullCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void modifyPushConfigTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - - client.modifyPushConfig(subscription, pushConfig); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ModifyPushConfigRequest actualRequest = ((ModifyPushConfigRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription.toString(), actualRequest.getSubscription()); - Assert.assertEquals(pushConfig, actualRequest.getPushConfig()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void modifyPushConfigExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - PushConfig pushConfig = PushConfig.newBuilder().build(); - client.modifyPushConfig(subscription, pushConfig); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void modifyPushConfigTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - String subscription = "subscription341203229"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - - client.modifyPushConfig(subscription, pushConfig); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ModifyPushConfigRequest actualRequest = ((ModifyPushConfigRequest) actualRequests.get(0)); - - Assert.assertEquals(subscription, actualRequest.getSubscription()); - Assert.assertEquals(pushConfig, actualRequest.getPushConfig()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void modifyPushConfigExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String subscription = "subscription341203229"; - PushConfig pushConfig = PushConfig.newBuilder().build(); - client.modifyPushConfig(subscription, pushConfig); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSnapshotTest() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - - Snapshot actualResponse = client.getSnapshot(snapshot); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetSnapshotRequest actualRequest = ((GetSnapshotRequest) actualRequests.get(0)); - - Assert.assertEquals(snapshot.toString(), actualRequest.getSnapshot()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSnapshotExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - client.getSnapshot(snapshot); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSnapshotTest2() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - String snapshot = "snapshot284874180"; - - Snapshot actualResponse = client.getSnapshot(snapshot); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetSnapshotRequest actualRequest = ((GetSnapshotRequest) actualRequests.get(0)); - - Assert.assertEquals(snapshot, actualRequest.getSnapshot()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSnapshotExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String snapshot = "snapshot284874180"; - client.getSnapshot(snapshot); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSnapshotsTest() throws Exception { - Snapshot responsesElement = Snapshot.newBuilder().build(); - ListSnapshotsResponse expectedResponse = - ListSnapshotsResponse.newBuilder() - .setNextPageToken("") - .addAllSnapshots(Arrays.asList(responsesElement)) - .build(); - mockSubscriber.addResponse(expectedResponse); - - ProjectName project = ProjectName.of("[PROJECT]"); - - ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListSnapshotsRequest actualRequest = ((ListSnapshotsRequest) actualRequests.get(0)); - - Assert.assertEquals(project.toString(), actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listSnapshotsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - ProjectName project = ProjectName.of("[PROJECT]"); - client.listSnapshots(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSnapshotsTest2() throws Exception { - Snapshot responsesElement = Snapshot.newBuilder().build(); - ListSnapshotsResponse expectedResponse = - ListSnapshotsResponse.newBuilder() - .setNextPageToken("") - .addAllSnapshots(Arrays.asList(responsesElement)) - .build(); - mockSubscriber.addResponse(expectedResponse); - - String project = "project-309310695"; - - ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListSnapshotsRequest actualRequest = ((ListSnapshotsRequest) actualRequests.get(0)); - - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listSnapshotsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String project = "project-309310695"; - client.listSnapshots(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSnapshotTest() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - - Snapshot actualResponse = client.createSnapshot(name, subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateSnapshotRequest actualRequest = ((CreateSnapshotRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertEquals(subscription.toString(), actualRequest.getSubscription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSnapshotExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - client.createSnapshot(name, subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSnapshotTest2() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - String subscription = "subscription341203229"; - - Snapshot actualResponse = client.createSnapshot(name, subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateSnapshotRequest actualRequest = ((CreateSnapshotRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertEquals(subscription, actualRequest.getSubscription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSnapshotExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - String subscription = "subscription341203229"; - client.createSnapshot(name, subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSnapshotTest3() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - String name = "name3373707"; - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - - Snapshot actualResponse = client.createSnapshot(name, subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateSnapshotRequest actualRequest = ((CreateSnapshotRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(subscription.toString(), actualRequest.getSubscription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSnapshotExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String name = "name3373707"; - SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - client.createSnapshot(name, subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createSnapshotTest4() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - String name = "name3373707"; - String subscription = "subscription341203229"; - - Snapshot actualResponse = client.createSnapshot(name, subscription); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateSnapshotRequest actualRequest = ((CreateSnapshotRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(subscription, actualRequest.getSubscription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSnapshotExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String name = "name3373707"; - String subscription = "subscription341203229"; - client.createSnapshot(name, subscription); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateSnapshotTest() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() - .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) - .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .build(); - mockSubscriber.addResponse(expectedResponse); - - Snapshot snapshot = Snapshot.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - Snapshot actualResponse = client.updateSnapshot(snapshot, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateSnapshotRequest actualRequest = ((UpdateSnapshotRequest) actualRequests.get(0)); - - Assert.assertEquals(snapshot, actualRequest.getSnapshot()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateSnapshotExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - Snapshot snapshot = Snapshot.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateSnapshot(snapshot, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSnapshotTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - - client.deleteSnapshot(snapshot); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteSnapshotRequest actualRequest = ((DeleteSnapshotRequest) actualRequests.get(0)); - - Assert.assertEquals(snapshot.toString(), actualRequest.getSnapshot()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteSnapshotExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); - client.deleteSnapshot(snapshot); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSnapshotTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - String snapshot = "snapshot284874180"; - - client.deleteSnapshot(snapshot); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteSnapshotRequest actualRequest = ((DeleteSnapshotRequest) actualRequests.get(0)); - - Assert.assertEquals(snapshot, actualRequest.getSnapshot()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteSnapshotExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - String snapshot = "snapshot284874180"; - client.deleteSnapshot(snapshot); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void seekTest() throws Exception { - SeekResponse expectedResponse = SeekResponse.newBuilder().build(); - mockSubscriber.addResponse(expectedResponse); - - SeekRequest request = - SeekRequest.newBuilder() - .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .build(); - - SeekResponse actualResponse = client.seek(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSubscriber.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SeekRequest actualRequest = ((SeekRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getSubscription(), actualRequest.getSubscription()); - Assert.assertEquals(request.getTime(), actualRequest.getTime()); - Assert.assertEquals(request.getSnapshot(), actualRequest.getSnapshot()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void seekExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSubscriber.addException(exception); - - try { - SeekRequest request = - SeekRequest.newBuilder() - .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .build(); - client.seek(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockIAMPolicy.addResponse(expectedResponse); - - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Policy actualResponse = client.setIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.setIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockIAMPolicy.addResponse(expectedResponse); - - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - - Policy actualResponse = client.getIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - client.getIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockIAMPolicy.addResponse(expectedResponse); - - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - client.testIamPermissions(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/TopicAdminClientHttpJsonTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientHttpJsonTest.java deleted file mode 100644 index c18152b5d..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientHttpJsonTest.java +++ /dev/null @@ -1,1053 +0,0 @@ -/* - * Copyright 2023 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.TopicAdminClient.ListTopicSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.cloud.pubsub.v1.stub.HttpJsonPublisherStub; -import com.google.common.collect.Lists; -import com.google.iam.v1.AuditConfig; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.ByteString; -import com.google.protobuf.Duration; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.pubsub.v1.DetachSubscriptionRequest; -import com.google.pubsub.v1.DetachSubscriptionResponse; -import com.google.pubsub.v1.ListTopicSnapshotsResponse; -import com.google.pubsub.v1.ListTopicSubscriptionsResponse; -import com.google.pubsub.v1.ListTopicsResponse; -import com.google.pubsub.v1.MessageStoragePolicy; -import com.google.pubsub.v1.ProjectName; -import com.google.pubsub.v1.PublishResponse; -import com.google.pubsub.v1.PubsubMessage; -import com.google.pubsub.v1.SchemaName; -import com.google.pubsub.v1.SchemaSettings; -import com.google.pubsub.v1.SubscriptionName; -import com.google.pubsub.v1.Topic; -import com.google.pubsub.v1.TopicName; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class TopicAdminClientHttpJsonTest { - private static MockHttpService mockService; - private static TopicAdminClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonPublisherStub.getMethodDescriptors(), TopicAdminSettings.getDefaultEndpoint()); - TopicAdminSettings settings = - TopicAdminSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - TopicAdminSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = TopicAdminClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createTopicTest() throws Exception { - Topic expectedResponse = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - - Topic actualResponse = client.createTopic(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createTopicExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - client.createTopic(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createTopicTest2() throws Exception { - Topic expectedResponse = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-7550/topics/topic-7550"; - - Topic actualResponse = client.createTopic(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createTopicExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-7550/topics/topic-7550"; - client.createTopic(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateTopicTest() throws Exception { - Topic expectedResponse = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - Topic topic = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - Topic actualResponse = client.updateTopic(topic, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateTopicExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Topic topic = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateTopic(topic, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void publishTest() throws Exception { - PublishResponse expectedResponse = - PublishResponse.newBuilder().addAllMessageIds(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - List messages = new ArrayList<>(); - - PublishResponse actualResponse = client.publish(topic, messages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void publishExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - List messages = new ArrayList<>(); - client.publish(topic, messages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void publishTest2() throws Exception { - PublishResponse expectedResponse = - PublishResponse.newBuilder().addAllMessageIds(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - String topic = "projects/project-2486/topics/topic-2486"; - List messages = new ArrayList<>(); - - PublishResponse actualResponse = client.publish(topic, messages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void publishExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String topic = "projects/project-2486/topics/topic-2486"; - List messages = new ArrayList<>(); - client.publish(topic, messages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getTopicTest() throws Exception { - Topic expectedResponse = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - - Topic actualResponse = client.getTopic(topic); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getTopicExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - client.getTopic(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getTopicTest2() throws Exception { - Topic expectedResponse = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String topic = "projects/project-2486/topics/topic-2486"; - - Topic actualResponse = client.getTopic(topic); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getTopicExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String topic = "projects/project-2486/topics/topic-2486"; - client.getTopic(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicsTest() throws Exception { - Topic responsesElement = Topic.newBuilder().build(); - ListTopicsResponse expectedResponse = - ListTopicsResponse.newBuilder() - .setNextPageToken("") - .addAllTopics(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ProjectName project = ProjectName.of("[PROJECT]"); - - ListTopicsPagedResponse pagedListResponse = client.listTopics(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getTopicsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listTopicsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProjectName project = ProjectName.of("[PROJECT]"); - client.listTopics(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicsTest2() throws Exception { - Topic responsesElement = Topic.newBuilder().build(); - ListTopicsResponse expectedResponse = - ListTopicsResponse.newBuilder() - .setNextPageToken("") - .addAllTopics(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String project = "projects/project-7934"; - - ListTopicsPagedResponse pagedListResponse = client.listTopics(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getTopicsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listTopicsExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String project = "projects/project-7934"; - client.listTopics(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicSubscriptionsTest() throws Exception { - String responsesElement = "responsesElement-318365110"; - ListTopicSubscriptionsResponse expectedResponse = - ListTopicSubscriptionsResponse.newBuilder() - .setNextPageToken("") - .addAllSubscriptions(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - - ListTopicSubscriptionsPagedResponse pagedListResponse = client.listTopicSubscriptions(topic); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listTopicSubscriptionsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - client.listTopicSubscriptions(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicSubscriptionsTest2() throws Exception { - String responsesElement = "responsesElement-318365110"; - ListTopicSubscriptionsResponse expectedResponse = - ListTopicSubscriptionsResponse.newBuilder() - .setNextPageToken("") - .addAllSubscriptions(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String topic = "projects/project-2486/topics/topic-2486"; - - ListTopicSubscriptionsPagedResponse pagedListResponse = client.listTopicSubscriptions(topic); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listTopicSubscriptionsExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String topic = "projects/project-2486/topics/topic-2486"; - client.listTopicSubscriptions(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicSnapshotsTest() throws Exception { - String responsesElement = "responsesElement-318365110"; - ListTopicSnapshotsResponse expectedResponse = - ListTopicSnapshotsResponse.newBuilder() - .setNextPageToken("") - .addAllSnapshots(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - - ListTopicSnapshotsPagedResponse pagedListResponse = client.listTopicSnapshots(topic); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listTopicSnapshotsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - client.listTopicSnapshots(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicSnapshotsTest2() throws Exception { - String responsesElement = "responsesElement-318365110"; - ListTopicSnapshotsResponse expectedResponse = - ListTopicSnapshotsResponse.newBuilder() - .setNextPageToken("") - .addAllSnapshots(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String topic = "projects/project-2486/topics/topic-2486"; - - ListTopicSnapshotsPagedResponse pagedListResponse = client.listTopicSnapshots(topic); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listTopicSnapshotsExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String topic = "projects/project-2486/topics/topic-2486"; - client.listTopicSnapshots(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteTopicTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - - client.deleteTopic(topic); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteTopicExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - client.deleteTopic(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteTopicTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String topic = "projects/project-2486/topics/topic-2486"; - - client.deleteTopic(topic); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteTopicExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String topic = "projects/project-2486/topics/topic-2486"; - client.deleteTopic(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void detachSubscriptionTest() throws Exception { - DetachSubscriptionResponse expectedResponse = DetachSubscriptionResponse.newBuilder().build(); - mockService.addResponse(expectedResponse); - - DetachSubscriptionRequest request = - DetachSubscriptionRequest.newBuilder() - .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .build(); - - DetachSubscriptionResponse actualResponse = client.detachSubscription(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void detachSubscriptionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - DetachSubscriptionRequest request = - DetachSubscriptionRequest.newBuilder() - .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .build(); - client.detachSubscription(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockService.addResponse(expectedResponse); - - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Policy actualResponse = client.setIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.setIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockService.addResponse(expectedResponse); - - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - - Policy actualResponse = client.getIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - client.getIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - client.testIamPermissions(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/TopicAdminClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java deleted file mode 100644 index 1693f7e40..000000000 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java +++ /dev/null @@ -1,944 +0,0 @@ -/* - * Copyright 2023 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.TopicAdminClient.ListTopicSnapshotsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; -import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; - -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.iam.v1.AuditConfig; -import com.google.iam.v1.Binding; -import com.google.iam.v1.GetIamPolicyRequest; -import com.google.iam.v1.GetPolicyOptions; -import com.google.iam.v1.Policy; -import com.google.iam.v1.SetIamPolicyRequest; -import com.google.iam.v1.TestIamPermissionsRequest; -import com.google.iam.v1.TestIamPermissionsResponse; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.ByteString; -import com.google.protobuf.Duration; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.pubsub.v1.DeleteTopicRequest; -import com.google.pubsub.v1.DetachSubscriptionRequest; -import com.google.pubsub.v1.DetachSubscriptionResponse; -import com.google.pubsub.v1.GetTopicRequest; -import com.google.pubsub.v1.ListTopicSnapshotsRequest; -import com.google.pubsub.v1.ListTopicSnapshotsResponse; -import com.google.pubsub.v1.ListTopicSubscriptionsRequest; -import com.google.pubsub.v1.ListTopicSubscriptionsResponse; -import com.google.pubsub.v1.ListTopicsRequest; -import com.google.pubsub.v1.ListTopicsResponse; -import com.google.pubsub.v1.MessageStoragePolicy; -import com.google.pubsub.v1.ProjectName; -import com.google.pubsub.v1.PublishRequest; -import com.google.pubsub.v1.PublishResponse; -import com.google.pubsub.v1.PubsubMessage; -import com.google.pubsub.v1.SchemaName; -import com.google.pubsub.v1.SchemaSettings; -import com.google.pubsub.v1.SubscriptionName; -import com.google.pubsub.v1.Topic; -import com.google.pubsub.v1.TopicName; -import com.google.pubsub.v1.UpdateTopicRequest; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class TopicAdminClientTest { - private static MockIAMPolicy mockIAMPolicy; - private static MockPublisher mockPublisher; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private TopicAdminClient client; - - @BeforeClass - public static void startStaticServer() { - mockPublisher = new MockPublisher(); - mockIAMPolicy = new MockIAMPolicy(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList(mockPublisher, mockIAMPolicy)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - TopicAdminSettings settings = - TopicAdminSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = TopicAdminClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createTopicTest() throws Exception { - Topic expectedResponse = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockPublisher.addResponse(expectedResponse); - - TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - - Topic actualResponse = client.createTopic(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - Topic actualRequest = ((Topic) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createTopicExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - client.createTopic(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createTopicTest2() throws Exception { - Topic expectedResponse = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockPublisher.addResponse(expectedResponse); - - String name = "name3373707"; - - Topic actualResponse = client.createTopic(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - Topic actualRequest = ((Topic) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createTopicExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - String name = "name3373707"; - client.createTopic(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateTopicTest() throws Exception { - Topic expectedResponse = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockPublisher.addResponse(expectedResponse); - - Topic topic = Topic.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - Topic actualResponse = client.updateTopic(topic, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateTopicRequest actualRequest = ((UpdateTopicRequest) actualRequests.get(0)); - - Assert.assertEquals(topic, actualRequest.getTopic()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateTopicExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - Topic topic = Topic.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateTopic(topic, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void publishTest() throws Exception { - PublishResponse expectedResponse = - PublishResponse.newBuilder().addAllMessageIds(new ArrayList()).build(); - mockPublisher.addResponse(expectedResponse); - - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - List messages = new ArrayList<>(); - - PublishResponse actualResponse = client.publish(topic, messages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PublishRequest actualRequest = ((PublishRequest) actualRequests.get(0)); - - Assert.assertEquals(topic.toString(), actualRequest.getTopic()); - Assert.assertEquals(messages, actualRequest.getMessagesList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void publishExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - List messages = new ArrayList<>(); - client.publish(topic, messages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void publishTest2() throws Exception { - PublishResponse expectedResponse = - PublishResponse.newBuilder().addAllMessageIds(new ArrayList()).build(); - mockPublisher.addResponse(expectedResponse); - - String topic = "topic110546223"; - List messages = new ArrayList<>(); - - PublishResponse actualResponse = client.publish(topic, messages); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PublishRequest actualRequest = ((PublishRequest) actualRequests.get(0)); - - Assert.assertEquals(topic, actualRequest.getTopic()); - Assert.assertEquals(messages, actualRequest.getMessagesList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void publishExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - String topic = "topic110546223"; - List messages = new ArrayList<>(); - client.publish(topic, messages); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getTopicTest() throws Exception { - Topic expectedResponse = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockPublisher.addResponse(expectedResponse); - - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - - Topic actualResponse = client.getTopic(topic); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetTopicRequest actualRequest = ((GetTopicRequest) actualRequests.get(0)); - - Assert.assertEquals(topic.toString(), actualRequest.getTopic()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getTopicExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - client.getTopic(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getTopicTest2() throws Exception { - Topic expectedResponse = - Topic.newBuilder() - .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) - .putAllLabels(new HashMap()) - .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) - .setKmsKeyName("kmsKeyName412586233") - .setSchemaSettings(SchemaSettings.newBuilder().build()) - .setSatisfiesPzs(true) - .setMessageRetentionDuration(Duration.newBuilder().build()) - .build(); - mockPublisher.addResponse(expectedResponse); - - String topic = "topic110546223"; - - Topic actualResponse = client.getTopic(topic); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetTopicRequest actualRequest = ((GetTopicRequest) actualRequests.get(0)); - - Assert.assertEquals(topic, actualRequest.getTopic()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getTopicExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - String topic = "topic110546223"; - client.getTopic(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicsTest() throws Exception { - Topic responsesElement = Topic.newBuilder().build(); - ListTopicsResponse expectedResponse = - ListTopicsResponse.newBuilder() - .setNextPageToken("") - .addAllTopics(Arrays.asList(responsesElement)) - .build(); - mockPublisher.addResponse(expectedResponse); - - ProjectName project = ProjectName.of("[PROJECT]"); - - ListTopicsPagedResponse pagedListResponse = client.listTopics(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getTopicsList().get(0), resources.get(0)); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListTopicsRequest actualRequest = ((ListTopicsRequest) actualRequests.get(0)); - - Assert.assertEquals(project.toString(), actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listTopicsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - ProjectName project = ProjectName.of("[PROJECT]"); - client.listTopics(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicsTest2() throws Exception { - Topic responsesElement = Topic.newBuilder().build(); - ListTopicsResponse expectedResponse = - ListTopicsResponse.newBuilder() - .setNextPageToken("") - .addAllTopics(Arrays.asList(responsesElement)) - .build(); - mockPublisher.addResponse(expectedResponse); - - String project = "project-309310695"; - - ListTopicsPagedResponse pagedListResponse = client.listTopics(project); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getTopicsList().get(0), resources.get(0)); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListTopicsRequest actualRequest = ((ListTopicsRequest) actualRequests.get(0)); - - Assert.assertEquals(project, actualRequest.getProject()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listTopicsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - String project = "project-309310695"; - client.listTopics(project); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicSubscriptionsTest() throws Exception { - String responsesElement = "responsesElement-318365110"; - ListTopicSubscriptionsResponse expectedResponse = - ListTopicSubscriptionsResponse.newBuilder() - .setNextPageToken("") - .addAllSubscriptions(Arrays.asList(responsesElement)) - .build(); - mockPublisher.addResponse(expectedResponse); - - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - - ListTopicSubscriptionsPagedResponse pagedListResponse = client.listTopicSubscriptions(topic); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListTopicSubscriptionsRequest actualRequest = - ((ListTopicSubscriptionsRequest) actualRequests.get(0)); - - Assert.assertEquals(topic.toString(), actualRequest.getTopic()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listTopicSubscriptionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - client.listTopicSubscriptions(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicSubscriptionsTest2() throws Exception { - String responsesElement = "responsesElement-318365110"; - ListTopicSubscriptionsResponse expectedResponse = - ListTopicSubscriptionsResponse.newBuilder() - .setNextPageToken("") - .addAllSubscriptions(Arrays.asList(responsesElement)) - .build(); - mockPublisher.addResponse(expectedResponse); - - String topic = "topic110546223"; - - ListTopicSubscriptionsPagedResponse pagedListResponse = client.listTopicSubscriptions(topic); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSubscriptionsList().get(0), resources.get(0)); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListTopicSubscriptionsRequest actualRequest = - ((ListTopicSubscriptionsRequest) actualRequests.get(0)); - - Assert.assertEquals(topic, actualRequest.getTopic()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listTopicSubscriptionsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - String topic = "topic110546223"; - client.listTopicSubscriptions(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicSnapshotsTest() throws Exception { - String responsesElement = "responsesElement-318365110"; - ListTopicSnapshotsResponse expectedResponse = - ListTopicSnapshotsResponse.newBuilder() - .setNextPageToken("") - .addAllSnapshots(Arrays.asList(responsesElement)) - .build(); - mockPublisher.addResponse(expectedResponse); - - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - - ListTopicSnapshotsPagedResponse pagedListResponse = client.listTopicSnapshots(topic); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListTopicSnapshotsRequest actualRequest = ((ListTopicSnapshotsRequest) actualRequests.get(0)); - - Assert.assertEquals(topic.toString(), actualRequest.getTopic()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listTopicSnapshotsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - client.listTopicSnapshots(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTopicSnapshotsTest2() throws Exception { - String responsesElement = "responsesElement-318365110"; - ListTopicSnapshotsResponse expectedResponse = - ListTopicSnapshotsResponse.newBuilder() - .setNextPageToken("") - .addAllSnapshots(Arrays.asList(responsesElement)) - .build(); - mockPublisher.addResponse(expectedResponse); - - String topic = "topic110546223"; - - ListTopicSnapshotsPagedResponse pagedListResponse = client.listTopicSnapshots(topic); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListTopicSnapshotsRequest actualRequest = ((ListTopicSnapshotsRequest) actualRequests.get(0)); - - Assert.assertEquals(topic, actualRequest.getTopic()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listTopicSnapshotsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - String topic = "topic110546223"; - client.listTopicSnapshots(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteTopicTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockPublisher.addResponse(expectedResponse); - - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - - client.deleteTopic(topic); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteTopicRequest actualRequest = ((DeleteTopicRequest) actualRequests.get(0)); - - Assert.assertEquals(topic.toString(), actualRequest.getTopic()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteTopicExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); - client.deleteTopic(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteTopicTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockPublisher.addResponse(expectedResponse); - - String topic = "topic110546223"; - - client.deleteTopic(topic); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteTopicRequest actualRequest = ((DeleteTopicRequest) actualRequests.get(0)); - - Assert.assertEquals(topic, actualRequest.getTopic()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteTopicExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - String topic = "topic110546223"; - client.deleteTopic(topic); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void detachSubscriptionTest() throws Exception { - DetachSubscriptionResponse expectedResponse = DetachSubscriptionResponse.newBuilder().build(); - mockPublisher.addResponse(expectedResponse); - - DetachSubscriptionRequest request = - DetachSubscriptionRequest.newBuilder() - .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .build(); - - DetachSubscriptionResponse actualResponse = client.detachSubscription(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPublisher.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DetachSubscriptionRequest actualRequest = ((DetachSubscriptionRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getSubscription(), actualRequest.getSubscription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void detachSubscriptionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPublisher.addException(exception); - - try { - DetachSubscriptionRequest request = - DetachSubscriptionRequest.newBuilder() - .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) - .build(); - client.detachSubscription(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockIAMPolicy.addResponse(expectedResponse); - - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Policy actualResponse = client.setIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void setIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setPolicy(Policy.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.setIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .addAllAuditConfigs(new ArrayList()) - .setEtag(ByteString.EMPTY) - .build(); - mockIAMPolicy.addResponse(expectedResponse); - - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - - Policy actualResponse = client.getIamPolicy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getIamPolicyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .setOptions(GetPolicyOptions.newBuilder().build()) - .build(); - client.getIamPolicy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); - mockIAMPolicy.addResponse(expectedResponse); - - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - - TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMPolicy.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResource(), actualRequest.getResource()); - Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void testIamPermissionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIAMPolicy.addException(exception); - - try { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) - .addAllPermissions(new ArrayList()) - .build(); - client.testIamPermissions(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} 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 deleted file mode 100644 index 020bf6f9d..000000000 --- a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java +++ /dev/null @@ -1,1313 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * The service that an application uses to manipulate topics, and to send
- * messages to a topic.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/pubsub/v1/pubsub.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class PublisherGrpc { - - private PublisherGrpc() {} - - public static final java.lang.String SERVICE_NAME = "google.pubsub.v1.Publisher"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.Topic, com.google.pubsub.v1.Topic> - getCreateTopicMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateTopic", - requestType = com.google.pubsub.v1.Topic.class, - responseType = com.google.pubsub.v1.Topic.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor - getCreateTopicMethod() { - io.grpc.MethodDescriptor - getCreateTopicMethod; - if ((getCreateTopicMethod = PublisherGrpc.getCreateTopicMethod) == null) { - synchronized (PublisherGrpc.class) { - if ((getCreateTopicMethod = PublisherGrpc.getCreateTopicMethod) == null) { - PublisherGrpc.getCreateTopicMethod = - getCreateTopicMethod = - io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateTopic")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Topic.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Topic.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("CreateTopic")) - .build(); - } - } - } - return getCreateTopicMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.UpdateTopicRequest, com.google.pubsub.v1.Topic> - getUpdateTopicMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateTopic", - requestType = com.google.pubsub.v1.UpdateTopicRequest.class, - responseType = com.google.pubsub.v1.Topic.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.UpdateTopicRequest, com.google.pubsub.v1.Topic> - getUpdateTopicMethod() { - io.grpc.MethodDescriptor - getUpdateTopicMethod; - if ((getUpdateTopicMethod = PublisherGrpc.getUpdateTopicMethod) == null) { - synchronized (PublisherGrpc.class) { - if ((getUpdateTopicMethod = PublisherGrpc.getUpdateTopicMethod) == null) { - PublisherGrpc.getUpdateTopicMethod = - getUpdateTopicMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateTopic")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.UpdateTopicRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Topic.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("UpdateTopic")) - .build(); - } - } - } - return getUpdateTopicMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.PublishRequest, com.google.pubsub.v1.PublishResponse> - getPublishMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Publish", - requestType = com.google.pubsub.v1.PublishRequest.class, - responseType = com.google.pubsub.v1.PublishResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.PublishRequest, com.google.pubsub.v1.PublishResponse> - getPublishMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.PublishRequest, com.google.pubsub.v1.PublishResponse> - getPublishMethod; - if ((getPublishMethod = PublisherGrpc.getPublishMethod) == null) { - synchronized (PublisherGrpc.class) { - if ((getPublishMethod = PublisherGrpc.getPublishMethod) == null) { - PublisherGrpc.getPublishMethod = - getPublishMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Publish")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.PublishRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.PublishResponse.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("Publish")) - .build(); - } - } - } - return getPublishMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic> - getGetTopicMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetTopic", - requestType = com.google.pubsub.v1.GetTopicRequest.class, - responseType = com.google.pubsub.v1.Topic.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic> - getGetTopicMethod() { - io.grpc.MethodDescriptor - getGetTopicMethod; - if ((getGetTopicMethod = PublisherGrpc.getGetTopicMethod) == null) { - synchronized (PublisherGrpc.class) { - if ((getGetTopicMethod = PublisherGrpc.getGetTopicMethod) == null) { - PublisherGrpc.getGetTopicMethod = - getGetTopicMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTopic")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.GetTopicRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Topic.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("GetTopic")) - .build(); - } - } - } - return getGetTopicMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListTopicsRequest, com.google.pubsub.v1.ListTopicsResponse> - getListTopicsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListTopics", - requestType = com.google.pubsub.v1.ListTopicsRequest.class, - responseType = com.google.pubsub.v1.ListTopicsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListTopicsRequest, com.google.pubsub.v1.ListTopicsResponse> - getListTopicsMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListTopicsRequest, com.google.pubsub.v1.ListTopicsResponse> - getListTopicsMethod; - if ((getListTopicsMethod = PublisherGrpc.getListTopicsMethod) == null) { - synchronized (PublisherGrpc.class) { - if ((getListTopicsMethod = PublisherGrpc.getListTopicsMethod) == null) { - PublisherGrpc.getListTopicsMethod = - getListTopicsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTopics")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicsResponse.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("ListTopics")) - .build(); - } - } - } - return getListTopicsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListTopicSubscriptionsRequest, - com.google.pubsub.v1.ListTopicSubscriptionsResponse> - getListTopicSubscriptionsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListTopicSubscriptions", - requestType = com.google.pubsub.v1.ListTopicSubscriptionsRequest.class, - responseType = com.google.pubsub.v1.ListTopicSubscriptionsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListTopicSubscriptionsRequest, - com.google.pubsub.v1.ListTopicSubscriptionsResponse> - getListTopicSubscriptionsMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListTopicSubscriptionsRequest, - com.google.pubsub.v1.ListTopicSubscriptionsResponse> - getListTopicSubscriptionsMethod; - if ((getListTopicSubscriptionsMethod = PublisherGrpc.getListTopicSubscriptionsMethod) == null) { - synchronized (PublisherGrpc.class) { - if ((getListTopicSubscriptionsMethod = PublisherGrpc.getListTopicSubscriptionsMethod) - == null) { - PublisherGrpc.getListTopicSubscriptionsMethod = - getListTopicSubscriptionsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "ListTopicSubscriptions")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicSubscriptionsRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicSubscriptionsResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new PublisherMethodDescriptorSupplier("ListTopicSubscriptions")) - .build(); - } - } - } - return getListTopicSubscriptionsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListTopicSnapshotsRequest, - com.google.pubsub.v1.ListTopicSnapshotsResponse> - getListTopicSnapshotsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListTopicSnapshots", - requestType = com.google.pubsub.v1.ListTopicSnapshotsRequest.class, - responseType = com.google.pubsub.v1.ListTopicSnapshotsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListTopicSnapshotsRequest, - com.google.pubsub.v1.ListTopicSnapshotsResponse> - getListTopicSnapshotsMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListTopicSnapshotsRequest, - com.google.pubsub.v1.ListTopicSnapshotsResponse> - getListTopicSnapshotsMethod; - if ((getListTopicSnapshotsMethod = PublisherGrpc.getListTopicSnapshotsMethod) == null) { - synchronized (PublisherGrpc.class) { - if ((getListTopicSnapshotsMethod = PublisherGrpc.getListTopicSnapshotsMethod) == null) { - PublisherGrpc.getListTopicSnapshotsMethod = - getListTopicSnapshotsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTopicSnapshots")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicSnapshotsRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicSnapshotsResponse.getDefaultInstance())) - .setSchemaDescriptor( - new PublisherMethodDescriptorSupplier("ListTopicSnapshots")) - .build(); - } - } - } - return getListTopicSnapshotsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.DeleteTopicRequest, com.google.protobuf.Empty> - getDeleteTopicMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteTopic", - requestType = com.google.pubsub.v1.DeleteTopicRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.DeleteTopicRequest, com.google.protobuf.Empty> - getDeleteTopicMethod() { - io.grpc.MethodDescriptor - getDeleteTopicMethod; - if ((getDeleteTopicMethod = PublisherGrpc.getDeleteTopicMethod) == null) { - synchronized (PublisherGrpc.class) { - if ((getDeleteTopicMethod = PublisherGrpc.getDeleteTopicMethod) == null) { - PublisherGrpc.getDeleteTopicMethod = - getDeleteTopicMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTopic")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.DeleteTopicRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("DeleteTopic")) - .build(); - } - } - } - return getDeleteTopicMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.DetachSubscriptionRequest, - com.google.pubsub.v1.DetachSubscriptionResponse> - getDetachSubscriptionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DetachSubscription", - requestType = com.google.pubsub.v1.DetachSubscriptionRequest.class, - responseType = com.google.pubsub.v1.DetachSubscriptionResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.DetachSubscriptionRequest, - com.google.pubsub.v1.DetachSubscriptionResponse> - getDetachSubscriptionMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.DetachSubscriptionRequest, - com.google.pubsub.v1.DetachSubscriptionResponse> - getDetachSubscriptionMethod; - if ((getDetachSubscriptionMethod = PublisherGrpc.getDetachSubscriptionMethod) == null) { - synchronized (PublisherGrpc.class) { - if ((getDetachSubscriptionMethod = PublisherGrpc.getDetachSubscriptionMethod) == null) { - PublisherGrpc.getDetachSubscriptionMethod = - getDetachSubscriptionMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DetachSubscription")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.DetachSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.DetachSubscriptionResponse.getDefaultInstance())) - .setSchemaDescriptor( - new PublisherMethodDescriptorSupplier("DetachSubscription")) - .build(); - } - } - } - return getDetachSubscriptionMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static PublisherStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PublisherStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PublisherStub(channel, callOptions); - } - }; - return PublisherStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static PublisherBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PublisherBlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PublisherBlockingStub(channel, callOptions); - } - }; - return PublisherBlockingStub.newStub(factory, channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static PublisherFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PublisherFutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PublisherFutureStub(channel, callOptions); - } - }; - return PublisherFutureStub.newStub(factory, channel); - } - - /** - * - * - *
-   * The service that an application uses to manipulate topics, and to send
-   * messages to a topic.
-   * 
- */ - public interface AsyncService { - - /** - * - * - *
-     * Creates the given topic with the given name. See the [resource name rules]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * 
- */ - default void createTopic( - com.google.pubsub.v1.Topic request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreateTopicMethod(), responseObserver); - } - - /** - * - * - *
-     * Updates an existing topic. Note that certain properties of a
-     * topic are not modifiable.
-     * 
- */ - default void updateTopic( - com.google.pubsub.v1.UpdateTopicRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getUpdateTopicMethod(), responseObserver); - } - - /** - * - * - *
-     * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
-     * does not exist.
-     * 
- */ - default void publish( - com.google.pubsub.v1.PublishRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPublishMethod(), responseObserver); - } - - /** - * - * - *
-     * Gets the configuration of a topic.
-     * 
- */ - default void getTopic( - com.google.pubsub.v1.GetTopicRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTopicMethod(), responseObserver); - } - - /** - * - * - *
-     * Lists matching topics.
-     * 
- */ - default void listTopics( - com.google.pubsub.v1.ListTopicsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTopicsMethod(), responseObserver); - } - - /** - * - * - *
-     * Lists the names of the attached subscriptions on this topic.
-     * 
- */ - default void listTopicSubscriptions( - com.google.pubsub.v1.ListTopicSubscriptionsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListTopicSubscriptionsMethod(), responseObserver); - } - - /** - * - * - *
-     * Lists the names of the snapshots on this topic. 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.
-     * 
- */ - default void listTopicSnapshots( - com.google.pubsub.v1.ListTopicSnapshotsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListTopicSnapshotsMethod(), responseObserver); - } - - /** - * - * - *
-     * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
-     * does not exist. After a topic is deleted, a new topic may be created with
-     * the same name; this is an entirely new topic with none of the old
-     * configuration or subscriptions. Existing subscriptions to this topic are
-     * not deleted, but their `topic` field is set to `_deleted-topic_`.
-     * 
- */ - default void deleteTopic( - com.google.pubsub.v1.DeleteTopicRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteTopicMethod(), responseObserver); - } - - /** - * - * - *
-     * Detaches a subscription from this topic. All messages retained in the
-     * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
-     * will return FAILED_PRECONDITION. If the subscription is a push
-     * subscription, pushes to the endpoint will stop.
-     * 
- */ - default void detachSubscription( - com.google.pubsub.v1.DetachSubscriptionRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDetachSubscriptionMethod(), responseObserver); - } - } - - /** - * Base class for the server implementation of the service Publisher. - * - *
-   * The service that an application uses to manipulate topics, and to send
-   * messages to a topic.
-   * 
- */ - public abstract static class PublisherImplBase implements io.grpc.BindableService, AsyncService { - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return PublisherGrpc.bindService(this); - } - } - - /** - * A stub to allow clients to do asynchronous rpc calls to service Publisher. - * - *
-   * The service that an application uses to manipulate topics, and to send
-   * messages to a topic.
-   * 
- */ - public static final class PublisherStub extends io.grpc.stub.AbstractAsyncStub { - private PublisherStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PublisherStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PublisherStub(channel, callOptions); - } - - /** - * - * - *
-     * Creates the given topic with the given name. See the [resource name rules]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * 
- */ - public void createTopic( - com.google.pubsub.v1.Topic request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateTopicMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Updates an existing topic. Note that certain properties of a
-     * topic are not modifiable.
-     * 
- */ - public void updateTopic( - com.google.pubsub.v1.UpdateTopicRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateTopicMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
-     * does not exist.
-     * 
- */ - public void publish( - com.google.pubsub.v1.PublishRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPublishMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Gets the configuration of a topic.
-     * 
- */ - public void getTopic( - com.google.pubsub.v1.GetTopicRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetTopicMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Lists matching topics.
-     * 
- */ - public void listTopics( - com.google.pubsub.v1.ListTopicsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListTopicsMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Lists the names of the attached subscriptions on this topic.
-     * 
- */ - public void listTopicSubscriptions( - com.google.pubsub.v1.ListTopicSubscriptionsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListTopicSubscriptionsMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Lists the names of the snapshots on this topic. 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.
-     * 
- */ - public void listTopicSnapshots( - com.google.pubsub.v1.ListTopicSnapshotsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListTopicSnapshotsMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
-     * does not exist. After a topic is deleted, a new topic may be created with
-     * the same name; this is an entirely new topic with none of the old
-     * configuration or subscriptions. Existing subscriptions to this topic are
-     * not deleted, but their `topic` field is set to `_deleted-topic_`.
-     * 
- */ - public void deleteTopic( - com.google.pubsub.v1.DeleteTopicRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteTopicMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Detaches a subscription from this topic. All messages retained in the
-     * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
-     * will return FAILED_PRECONDITION. If the subscription is a push
-     * subscription, pushes to the endpoint will stop.
-     * 
- */ - public void detachSubscription( - com.google.pubsub.v1.DetachSubscriptionRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDetachSubscriptionMethod(), getCallOptions()), - request, - responseObserver); - } - } - - /** - * A stub to allow clients to do synchronous rpc calls to service Publisher. - * - *
-   * The service that an application uses to manipulate topics, and to send
-   * messages to a topic.
-   * 
- */ - public static final class PublisherBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private PublisherBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PublisherBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PublisherBlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * Creates the given topic with the given name. See the [resource name rules]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * 
- */ - public com.google.pubsub.v1.Topic createTopic(com.google.pubsub.v1.Topic request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateTopicMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Updates an existing topic. Note that certain properties of a
-     * topic are not modifiable.
-     * 
- */ - public com.google.pubsub.v1.Topic updateTopic(com.google.pubsub.v1.UpdateTopicRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateTopicMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
-     * does not exist.
-     * 
- */ - public com.google.pubsub.v1.PublishResponse publish( - com.google.pubsub.v1.PublishRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPublishMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Gets the configuration of a topic.
-     * 
- */ - public com.google.pubsub.v1.Topic getTopic(com.google.pubsub.v1.GetTopicRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetTopicMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Lists matching topics.
-     * 
- */ - public com.google.pubsub.v1.ListTopicsResponse listTopics( - com.google.pubsub.v1.ListTopicsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListTopicsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Lists the names of the attached subscriptions on this topic.
-     * 
- */ - public com.google.pubsub.v1.ListTopicSubscriptionsResponse listTopicSubscriptions( - com.google.pubsub.v1.ListTopicSubscriptionsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListTopicSubscriptionsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Lists the names of the snapshots on this topic. 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.
-     * 
- */ - public com.google.pubsub.v1.ListTopicSnapshotsResponse listTopicSnapshots( - com.google.pubsub.v1.ListTopicSnapshotsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListTopicSnapshotsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
-     * does not exist. After a topic is deleted, a new topic may be created with
-     * the same name; this is an entirely new topic with none of the old
-     * configuration or subscriptions. Existing subscriptions to this topic are
-     * not deleted, but their `topic` field is set to `_deleted-topic_`.
-     * 
- */ - public com.google.protobuf.Empty deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteTopicMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Detaches a subscription from this topic. All messages retained in the
-     * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
-     * will return FAILED_PRECONDITION. If the subscription is a push
-     * subscription, pushes to the endpoint will stop.
-     * 
- */ - public com.google.pubsub.v1.DetachSubscriptionResponse detachSubscription( - com.google.pubsub.v1.DetachSubscriptionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDetachSubscriptionMethod(), getCallOptions(), request); - } - } - - /** - * A stub to allow clients to do ListenableFuture-style rpc calls to service Publisher. - * - *
-   * The service that an application uses to manipulate topics, and to send
-   * messages to a topic.
-   * 
- */ - public static final class PublisherFutureStub - extends io.grpc.stub.AbstractFutureStub { - private PublisherFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PublisherFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PublisherFutureStub(channel, callOptions); - } - - /** - * - * - *
-     * Creates the given topic with the given name. See the [resource name rules]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - createTopic(com.google.pubsub.v1.Topic request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateTopicMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Updates an existing topic. Note that certain properties of a
-     * topic are not modifiable.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - updateTopic(com.google.pubsub.v1.UpdateTopicRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateTopicMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
-     * does not exist.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - publish(com.google.pubsub.v1.PublishRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPublishMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Gets the configuration of a topic.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture getTopic( - com.google.pubsub.v1.GetTopicRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetTopicMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Lists matching topics.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.pubsub.v1.ListTopicsResponse> - listTopics(com.google.pubsub.v1.ListTopicsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListTopicsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Lists the names of the attached subscriptions on this topic.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.pubsub.v1.ListTopicSubscriptionsResponse> - listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListTopicSubscriptionsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Lists the names of the snapshots on this topic. 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.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.pubsub.v1.ListTopicSnapshotsResponse> - listTopicSnapshots(com.google.pubsub.v1.ListTopicSnapshotsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListTopicSnapshotsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
-     * does not exist. After a topic is deleted, a new topic may be created with
-     * the same name; this is an entirely new topic with none of the old
-     * configuration or subscriptions. Existing subscriptions to this topic are
-     * not deleted, but their `topic` field is set to `_deleted-topic_`.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteTopicMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Detaches a subscription from this topic. All messages retained in the
-     * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
-     * will return FAILED_PRECONDITION. If the subscription is a push
-     * subscription, pushes to the endpoint will stop.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.pubsub.v1.DetachSubscriptionResponse> - detachSubscription(com.google.pubsub.v1.DetachSubscriptionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDetachSubscriptionMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_CREATE_TOPIC = 0; - private static final int METHODID_UPDATE_TOPIC = 1; - private static final int METHODID_PUBLISH = 2; - private static final int METHODID_GET_TOPIC = 3; - private static final int METHODID_LIST_TOPICS = 4; - private static final int METHODID_LIST_TOPIC_SUBSCRIPTIONS = 5; - private static final int METHODID_LIST_TOPIC_SNAPSHOTS = 6; - private static final int METHODID_DELETE_TOPIC = 7; - private static final int METHODID_DETACH_SUBSCRIPTION = 8; - - 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 AsyncService serviceImpl; - private final int methodId; - - MethodHandlers(AsyncService 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_TOPIC: - serviceImpl.createTopic( - (com.google.pubsub.v1.Topic) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_TOPIC: - serviceImpl.updateTopic( - (com.google.pubsub.v1.UpdateTopicRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PUBLISH: - serviceImpl.publish( - (com.google.pubsub.v1.PublishRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_TOPIC: - serviceImpl.getTopic( - (com.google.pubsub.v1.GetTopicRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_TOPICS: - serviceImpl.listTopics( - (com.google.pubsub.v1.ListTopicsRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_LIST_TOPIC_SUBSCRIPTIONS: - serviceImpl.listTopicSubscriptions( - (com.google.pubsub.v1.ListTopicSubscriptionsRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_LIST_TOPIC_SNAPSHOTS: - serviceImpl.listTopicSnapshots( - (com.google.pubsub.v1.ListTopicSnapshotsRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_DELETE_TOPIC: - serviceImpl.deleteTopic( - (com.google.pubsub.v1.DeleteTopicRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DETACH_SUBSCRIPTION: - serviceImpl.detachSubscription( - (com.google.pubsub.v1.DetachSubscriptionRequest) 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(); - } - } - } - - public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateTopicMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers( - service, METHODID_CREATE_TOPIC))) - .addMethod( - getUpdateTopicMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.UpdateTopicRequest, com.google.pubsub.v1.Topic>( - service, METHODID_UPDATE_TOPIC))) - .addMethod( - getPublishMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.PublishRequest, com.google.pubsub.v1.PublishResponse>( - service, METHODID_PUBLISH))) - .addMethod( - getGetTopicMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic>( - service, METHODID_GET_TOPIC))) - .addMethod( - getListTopicsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ListTopicsRequest, - com.google.pubsub.v1.ListTopicsResponse>(service, METHODID_LIST_TOPICS))) - .addMethod( - getListTopicSubscriptionsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ListTopicSubscriptionsRequest, - com.google.pubsub.v1.ListTopicSubscriptionsResponse>( - service, METHODID_LIST_TOPIC_SUBSCRIPTIONS))) - .addMethod( - getListTopicSnapshotsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ListTopicSnapshotsRequest, - com.google.pubsub.v1.ListTopicSnapshotsResponse>( - service, METHODID_LIST_TOPIC_SNAPSHOTS))) - .addMethod( - getDeleteTopicMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.DeleteTopicRequest, com.google.protobuf.Empty>( - service, METHODID_DELETE_TOPIC))) - .addMethod( - getDetachSubscriptionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.DetachSubscriptionRequest, - com.google.pubsub.v1.DetachSubscriptionResponse>( - service, METHODID_DETACH_SUBSCRIPTION))) - .build(); - } - - private abstract static class PublisherBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - PublisherBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.pubsub.v1.PubsubProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Publisher"); - } - } - - private static final class PublisherFileDescriptorSupplier - extends PublisherBaseDescriptorSupplier { - PublisherFileDescriptorSupplier() {} - } - - private static final class PublisherMethodDescriptorSupplier - extends PublisherBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final java.lang.String methodName; - - PublisherMethodDescriptorSupplier(java.lang.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 (PublisherGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new PublisherFileDescriptorSupplier()) - .addMethod(getCreateTopicMethod()) - .addMethod(getUpdateTopicMethod()) - .addMethod(getPublishMethod()) - .addMethod(getGetTopicMethod()) - .addMethod(getListTopicsMethod()) - .addMethod(getListTopicSubscriptionsMethod()) - .addMethod(getListTopicSnapshotsMethod()) - .addMethod(getDeleteTopicMethod()) - .addMethod(getDetachSubscriptionMethod()) - .build(); - } - } - } - return result; - } -} 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 deleted file mode 100644 index 3b11ea3dc..000000000 --- a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java +++ /dev/null @@ -1,1377 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Service for doing schema-related operations.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/pubsub/v1/schema.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class SchemaServiceGrpc { - - private SchemaServiceGrpc() {} - - public static final java.lang.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.ListSchemaRevisionsRequest, - com.google.pubsub.v1.ListSchemaRevisionsResponse> - getListSchemaRevisionsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListSchemaRevisions", - requestType = com.google.pubsub.v1.ListSchemaRevisionsRequest.class, - responseType = com.google.pubsub.v1.ListSchemaRevisionsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListSchemaRevisionsRequest, - com.google.pubsub.v1.ListSchemaRevisionsResponse> - getListSchemaRevisionsMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListSchemaRevisionsRequest, - com.google.pubsub.v1.ListSchemaRevisionsResponse> - getListSchemaRevisionsMethod; - if ((getListSchemaRevisionsMethod = SchemaServiceGrpc.getListSchemaRevisionsMethod) == null) { - synchronized (SchemaServiceGrpc.class) { - if ((getListSchemaRevisionsMethod = SchemaServiceGrpc.getListSchemaRevisionsMethod) - == null) { - SchemaServiceGrpc.getListSchemaRevisionsMethod = - getListSchemaRevisionsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "ListSchemaRevisions")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListSchemaRevisionsRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListSchemaRevisionsResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new SchemaServiceMethodDescriptorSupplier("ListSchemaRevisions")) - .build(); - } - } - } - return getListSchemaRevisionsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.CommitSchemaRequest, com.google.pubsub.v1.Schema> - getCommitSchemaMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CommitSchema", - requestType = com.google.pubsub.v1.CommitSchemaRequest.class, - responseType = com.google.pubsub.v1.Schema.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.CommitSchemaRequest, com.google.pubsub.v1.Schema> - getCommitSchemaMethod() { - io.grpc.MethodDescriptor - getCommitSchemaMethod; - if ((getCommitSchemaMethod = SchemaServiceGrpc.getCommitSchemaMethod) == null) { - synchronized (SchemaServiceGrpc.class) { - if ((getCommitSchemaMethod = SchemaServiceGrpc.getCommitSchemaMethod) == null) { - SchemaServiceGrpc.getCommitSchemaMethod = - getCommitSchemaMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CommitSchema")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.CommitSchemaRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Schema.getDefaultInstance())) - .setSchemaDescriptor( - new SchemaServiceMethodDescriptorSupplier("CommitSchema")) - .build(); - } - } - } - return getCommitSchemaMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.RollbackSchemaRequest, com.google.pubsub.v1.Schema> - getRollbackSchemaMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "RollbackSchema", - requestType = com.google.pubsub.v1.RollbackSchemaRequest.class, - responseType = com.google.pubsub.v1.Schema.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.RollbackSchemaRequest, com.google.pubsub.v1.Schema> - getRollbackSchemaMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.RollbackSchemaRequest, com.google.pubsub.v1.Schema> - getRollbackSchemaMethod; - if ((getRollbackSchemaMethod = SchemaServiceGrpc.getRollbackSchemaMethod) == null) { - synchronized (SchemaServiceGrpc.class) { - if ((getRollbackSchemaMethod = SchemaServiceGrpc.getRollbackSchemaMethod) == null) { - SchemaServiceGrpc.getRollbackSchemaMethod = - getRollbackSchemaMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RollbackSchema")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.RollbackSchemaRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Schema.getDefaultInstance())) - .setSchemaDescriptor( - new SchemaServiceMethodDescriptorSupplier("RollbackSchema")) - .build(); - } - } - } - return getRollbackSchemaMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.DeleteSchemaRevisionRequest, com.google.pubsub.v1.Schema> - getDeleteSchemaRevisionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteSchemaRevision", - requestType = com.google.pubsub.v1.DeleteSchemaRevisionRequest.class, - responseType = com.google.pubsub.v1.Schema.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.DeleteSchemaRevisionRequest, com.google.pubsub.v1.Schema> - getDeleteSchemaRevisionMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.DeleteSchemaRevisionRequest, com.google.pubsub.v1.Schema> - getDeleteSchemaRevisionMethod; - if ((getDeleteSchemaRevisionMethod = SchemaServiceGrpc.getDeleteSchemaRevisionMethod) == null) { - synchronized (SchemaServiceGrpc.class) { - if ((getDeleteSchemaRevisionMethod = SchemaServiceGrpc.getDeleteSchemaRevisionMethod) - == null) { - SchemaServiceGrpc.getDeleteSchemaRevisionMethod = - getDeleteSchemaRevisionMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "DeleteSchemaRevision")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.DeleteSchemaRevisionRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Schema.getDefaultInstance())) - .setSchemaDescriptor( - new SchemaServiceMethodDescriptorSupplier("DeleteSchemaRevision")) - .build(); - } - } - } - return getDeleteSchemaRevisionMethod; - } - - 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); - } - - /** - * - * - *
-   * Service for doing schema-related operations.
-   * 
- */ - public interface AsyncService { - - /** - * - * - *
-     * Creates a schema.
-     * 
- */ - default void createSchema( - com.google.pubsub.v1.CreateSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreateSchemaMethod(), responseObserver); - } - - /** - * - * - *
-     * Gets a schema.
-     * 
- */ - default void getSchema( - com.google.pubsub.v1.GetSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSchemaMethod(), responseObserver); - } - - /** - * - * - *
-     * Lists schemas in a project.
-     * 
- */ - default void listSchemas( - com.google.pubsub.v1.ListSchemasRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListSchemasMethod(), responseObserver); - } - - /** - * - * - *
-     * Lists all schema revisions for the named schema.
-     * 
- */ - default void listSchemaRevisions( - com.google.pubsub.v1.ListSchemaRevisionsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListSchemaRevisionsMethod(), responseObserver); - } - - /** - * - * - *
-     * Commits a new schema revision to an existing schema.
-     * 
- */ - default void commitSchema( - com.google.pubsub.v1.CommitSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCommitSchemaMethod(), responseObserver); - } - - /** - * - * - *
-     * Creates a new schema revision that is a copy of the provided revision_id.
-     * 
- */ - default void rollbackSchema( - com.google.pubsub.v1.RollbackSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getRollbackSchemaMethod(), responseObserver); - } - - /** - * - * - *
-     * Deletes a specific schema revision.
-     * 
- */ - default void deleteSchemaRevision( - com.google.pubsub.v1.DeleteSchemaRevisionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteSchemaRevisionMethod(), responseObserver); - } - - /** - * - * - *
-     * Deletes a schema.
-     * 
- */ - default void deleteSchema( - com.google.pubsub.v1.DeleteSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteSchemaMethod(), responseObserver); - } - - /** - * - * - *
-     * Validates a schema.
-     * 
- */ - default void validateSchema( - com.google.pubsub.v1.ValidateSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getValidateSchemaMethod(), responseObserver); - } - - /** - * - * - *
-     * Validates a message against a schema.
-     * 
- */ - default void validateMessage( - com.google.pubsub.v1.ValidateMessageRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getValidateMessageMethod(), responseObserver); - } - } - - /** - * Base class for the server implementation of the service SchemaService. - * - *
-   * Service for doing schema-related operations.
-   * 
- */ - public abstract static class SchemaServiceImplBase - implements io.grpc.BindableService, AsyncService { - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return SchemaServiceGrpc.bindService(this); - } - } - - /** - * A stub to allow clients to do asynchronous rpc calls to service SchemaService. - * - *
-   * Service for doing schema-related operations.
-   * 
- */ - 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) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateSchemaMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Gets a schema.
-     * 
- */ - public void getSchema( - com.google.pubsub.v1.GetSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.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) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListSchemasMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Lists all schema revisions for the named schema.
-     * 
- */ - public void listSchemaRevisions( - com.google.pubsub.v1.ListSchemaRevisionsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListSchemaRevisionsMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Commits a new schema revision to an existing schema.
-     * 
- */ - public void commitSchema( - com.google.pubsub.v1.CommitSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCommitSchemaMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Creates a new schema revision that is a copy of the provided revision_id.
-     * 
- */ - public void rollbackSchema( - com.google.pubsub.v1.RollbackSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRollbackSchemaMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Deletes a specific schema revision.
-     * 
- */ - public void deleteSchemaRevision( - com.google.pubsub.v1.DeleteSchemaRevisionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteSchemaRevisionMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Deletes a schema.
-     * 
- */ - public void deleteSchema( - com.google.pubsub.v1.DeleteSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteSchemaMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Validates a schema.
-     * 
- */ - public void validateSchema( - com.google.pubsub.v1.ValidateSchemaRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.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) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getValidateMessageMethod(), getCallOptions()), - request, - responseObserver); - } - } - - /** - * A stub to allow clients to do synchronous rpc calls to service SchemaService. - * - *
-   * Service for doing schema-related operations.
-   * 
- */ - 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 io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateSchemaMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Gets a schema.
-     * 
- */ - public com.google.pubsub.v1.Schema getSchema(com.google.pubsub.v1.GetSchemaRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetSchemaMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Lists schemas in a project.
-     * 
- */ - public com.google.pubsub.v1.ListSchemasResponse listSchemas( - com.google.pubsub.v1.ListSchemasRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListSchemasMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Lists all schema revisions for the named schema.
-     * 
- */ - public com.google.pubsub.v1.ListSchemaRevisionsResponse listSchemaRevisions( - com.google.pubsub.v1.ListSchemaRevisionsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListSchemaRevisionsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Commits a new schema revision to an existing schema.
-     * 
- */ - public com.google.pubsub.v1.Schema commitSchema( - com.google.pubsub.v1.CommitSchemaRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCommitSchemaMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Creates a new schema revision that is a copy of the provided revision_id.
-     * 
- */ - public com.google.pubsub.v1.Schema rollbackSchema( - com.google.pubsub.v1.RollbackSchemaRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRollbackSchemaMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Deletes a specific schema revision.
-     * 
- */ - public com.google.pubsub.v1.Schema deleteSchemaRevision( - com.google.pubsub.v1.DeleteSchemaRevisionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteSchemaRevisionMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Deletes a schema.
-     * 
- */ - public com.google.protobuf.Empty deleteSchema( - com.google.pubsub.v1.DeleteSchemaRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteSchemaMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Validates a schema.
-     * 
- */ - public com.google.pubsub.v1.ValidateSchemaResponse validateSchema( - com.google.pubsub.v1.ValidateSchemaRequest request) { - return io.grpc.stub.ClientCalls.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 io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getValidateMessageMethod(), getCallOptions(), request); - } - } - - /** - * A stub to allow clients to do ListenableFuture-style rpc calls to service SchemaService. - * - *
-   * Service for doing schema-related operations.
-   * 
- */ - 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 io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateSchemaMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Gets a schema.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - getSchema(com.google.pubsub.v1.GetSchemaRequest request) { - return io.grpc.stub.ClientCalls.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 io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListSchemasMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Lists all schema revisions for the named schema.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.pubsub.v1.ListSchemaRevisionsResponse> - listSchemaRevisions(com.google.pubsub.v1.ListSchemaRevisionsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListSchemaRevisionsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Commits a new schema revision to an existing schema.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - commitSchema(com.google.pubsub.v1.CommitSchemaRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCommitSchemaMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Creates a new schema revision that is a copy of the provided revision_id.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - rollbackSchema(com.google.pubsub.v1.RollbackSchemaRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRollbackSchemaMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Deletes a specific schema revision.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteSchemaRevision(com.google.pubsub.v1.DeleteSchemaRevisionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteSchemaRevisionMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Deletes a schema.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteSchema(com.google.pubsub.v1.DeleteSchemaRequest request) { - return io.grpc.stub.ClientCalls.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 io.grpc.stub.ClientCalls.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 io.grpc.stub.ClientCalls.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_LIST_SCHEMA_REVISIONS = 3; - private static final int METHODID_COMMIT_SCHEMA = 4; - private static final int METHODID_ROLLBACK_SCHEMA = 5; - private static final int METHODID_DELETE_SCHEMA_REVISION = 6; - private static final int METHODID_DELETE_SCHEMA = 7; - private static final int METHODID_VALIDATE_SCHEMA = 8; - private static final int METHODID_VALIDATE_MESSAGE = 9; - - 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 AsyncService serviceImpl; - private final int methodId; - - MethodHandlers(AsyncService 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_LIST_SCHEMA_REVISIONS: - serviceImpl.listSchemaRevisions( - (com.google.pubsub.v1.ListSchemaRevisionsRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_COMMIT_SCHEMA: - serviceImpl.commitSchema( - (com.google.pubsub.v1.CommitSchemaRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ROLLBACK_SCHEMA: - serviceImpl.rollbackSchema( - (com.google.pubsub.v1.RollbackSchemaRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_SCHEMA_REVISION: - serviceImpl.deleteSchemaRevision( - (com.google.pubsub.v1.DeleteSchemaRevisionRequest) 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(); - } - } - } - - public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateSchemaMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.CreateSchemaRequest, com.google.pubsub.v1.Schema>( - service, METHODID_CREATE_SCHEMA))) - .addMethod( - getGetSchemaMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.GetSchemaRequest, com.google.pubsub.v1.Schema>( - service, METHODID_GET_SCHEMA))) - .addMethod( - getListSchemasMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ListSchemasRequest, - com.google.pubsub.v1.ListSchemasResponse>(service, METHODID_LIST_SCHEMAS))) - .addMethod( - getListSchemaRevisionsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ListSchemaRevisionsRequest, - com.google.pubsub.v1.ListSchemaRevisionsResponse>( - service, METHODID_LIST_SCHEMA_REVISIONS))) - .addMethod( - getCommitSchemaMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.CommitSchemaRequest, com.google.pubsub.v1.Schema>( - service, METHODID_COMMIT_SCHEMA))) - .addMethod( - getRollbackSchemaMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.RollbackSchemaRequest, com.google.pubsub.v1.Schema>( - service, METHODID_ROLLBACK_SCHEMA))) - .addMethod( - getDeleteSchemaRevisionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.DeleteSchemaRevisionRequest, com.google.pubsub.v1.Schema>( - service, METHODID_DELETE_SCHEMA_REVISION))) - .addMethod( - getDeleteSchemaMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.DeleteSchemaRequest, com.google.protobuf.Empty>( - service, METHODID_DELETE_SCHEMA))) - .addMethod( - getValidateSchemaMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ValidateSchemaRequest, - com.google.pubsub.v1.ValidateSchemaResponse>( - service, METHODID_VALIDATE_SCHEMA))) - .addMethod( - getValidateMessageMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ValidateMessageRequest, - com.google.pubsub.v1.ValidateMessageResponse>( - service, METHODID_VALIDATE_MESSAGE))) - .build(); - } - - 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 java.lang.String methodName; - - SchemaServiceMethodDescriptorSupplier(java.lang.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(getListSchemaRevisionsMethod()) - .addMethod(getCommitSchemaMethod()) - .addMethod(getRollbackSchemaMethod()) - .addMethod(getDeleteSchemaRevisionMethod()) - .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 deleted file mode 100644 index c90e438e8..000000000 --- a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java +++ /dev/null @@ -1,2270 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * The service that an application uses to manipulate subscriptions and to
- * consume messages from a subscription via the `Pull` method or by
- * establishing a bi-directional stream using the `StreamingPull` method.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/pubsub/v1/pubsub.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class SubscriberGrpc { - - private SubscriberGrpc() {} - - public static final java.lang.String SERVICE_NAME = "google.pubsub.v1.Subscriber"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.Subscription, com.google.pubsub.v1.Subscription> - getCreateSubscriptionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateSubscription", - requestType = com.google.pubsub.v1.Subscription.class, - responseType = com.google.pubsub.v1.Subscription.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.Subscription, com.google.pubsub.v1.Subscription> - getCreateSubscriptionMethod() { - io.grpc.MethodDescriptor - getCreateSubscriptionMethod; - if ((getCreateSubscriptionMethod = SubscriberGrpc.getCreateSubscriptionMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getCreateSubscriptionMethod = SubscriberGrpc.getCreateSubscriptionMethod) == null) { - SubscriberGrpc.getCreateSubscriptionMethod = - getCreateSubscriptionMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSubscription")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Subscription.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Subscription.getDefaultInstance())) - .setSchemaDescriptor( - new SubscriberMethodDescriptorSupplier("CreateSubscription")) - .build(); - } - } - } - return getCreateSubscriptionMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.GetSubscriptionRequest, com.google.pubsub.v1.Subscription> - getGetSubscriptionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetSubscription", - requestType = com.google.pubsub.v1.GetSubscriptionRequest.class, - responseType = com.google.pubsub.v1.Subscription.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.GetSubscriptionRequest, com.google.pubsub.v1.Subscription> - getGetSubscriptionMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.GetSubscriptionRequest, com.google.pubsub.v1.Subscription> - getGetSubscriptionMethod; - if ((getGetSubscriptionMethod = SubscriberGrpc.getGetSubscriptionMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getGetSubscriptionMethod = SubscriberGrpc.getGetSubscriptionMethod) == null) { - SubscriberGrpc.getGetSubscriptionMethod = - getGetSubscriptionMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSubscription")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.GetSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Subscription.getDefaultInstance())) - .setSchemaDescriptor( - new SubscriberMethodDescriptorSupplier("GetSubscription")) - .build(); - } - } - } - return getGetSubscriptionMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.UpdateSubscriptionRequest, com.google.pubsub.v1.Subscription> - getUpdateSubscriptionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateSubscription", - requestType = com.google.pubsub.v1.UpdateSubscriptionRequest.class, - responseType = com.google.pubsub.v1.Subscription.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.UpdateSubscriptionRequest, com.google.pubsub.v1.Subscription> - getUpdateSubscriptionMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.UpdateSubscriptionRequest, com.google.pubsub.v1.Subscription> - getUpdateSubscriptionMethod; - if ((getUpdateSubscriptionMethod = SubscriberGrpc.getUpdateSubscriptionMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getUpdateSubscriptionMethod = SubscriberGrpc.getUpdateSubscriptionMethod) == null) { - SubscriberGrpc.getUpdateSubscriptionMethod = - getUpdateSubscriptionMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSubscription")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.UpdateSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Subscription.getDefaultInstance())) - .setSchemaDescriptor( - new SubscriberMethodDescriptorSupplier("UpdateSubscription")) - .build(); - } - } - } - return getUpdateSubscriptionMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListSubscriptionsRequest, - com.google.pubsub.v1.ListSubscriptionsResponse> - getListSubscriptionsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListSubscriptions", - requestType = com.google.pubsub.v1.ListSubscriptionsRequest.class, - responseType = com.google.pubsub.v1.ListSubscriptionsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListSubscriptionsRequest, - com.google.pubsub.v1.ListSubscriptionsResponse> - getListSubscriptionsMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListSubscriptionsRequest, - com.google.pubsub.v1.ListSubscriptionsResponse> - getListSubscriptionsMethod; - if ((getListSubscriptionsMethod = SubscriberGrpc.getListSubscriptionsMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getListSubscriptionsMethod = SubscriberGrpc.getListSubscriptionsMethod) == null) { - SubscriberGrpc.getListSubscriptionsMethod = - getListSubscriptionsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSubscriptions")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListSubscriptionsRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListSubscriptionsResponse.getDefaultInstance())) - .setSchemaDescriptor( - new SubscriberMethodDescriptorSupplier("ListSubscriptions")) - .build(); - } - } - } - return getListSubscriptionsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.DeleteSubscriptionRequest, com.google.protobuf.Empty> - getDeleteSubscriptionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteSubscription", - requestType = com.google.pubsub.v1.DeleteSubscriptionRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.DeleteSubscriptionRequest, com.google.protobuf.Empty> - getDeleteSubscriptionMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.DeleteSubscriptionRequest, com.google.protobuf.Empty> - getDeleteSubscriptionMethod; - if ((getDeleteSubscriptionMethod = SubscriberGrpc.getDeleteSubscriptionMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getDeleteSubscriptionMethod = SubscriberGrpc.getDeleteSubscriptionMethod) == null) { - SubscriberGrpc.getDeleteSubscriptionMethod = - getDeleteSubscriptionMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSubscription")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.DeleteSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor( - new SubscriberMethodDescriptorSupplier("DeleteSubscription")) - .build(); - } - } - } - return getDeleteSubscriptionMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.ModifyAckDeadlineRequest, com.google.protobuf.Empty> - getModifyAckDeadlineMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ModifyAckDeadline", - requestType = com.google.pubsub.v1.ModifyAckDeadlineRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.ModifyAckDeadlineRequest, com.google.protobuf.Empty> - getModifyAckDeadlineMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.ModifyAckDeadlineRequest, com.google.protobuf.Empty> - getModifyAckDeadlineMethod; - if ((getModifyAckDeadlineMethod = SubscriberGrpc.getModifyAckDeadlineMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getModifyAckDeadlineMethod = SubscriberGrpc.getModifyAckDeadlineMethod) == null) { - SubscriberGrpc.getModifyAckDeadlineMethod = - getModifyAckDeadlineMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ModifyAckDeadline")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ModifyAckDeadlineRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor( - new SubscriberMethodDescriptorSupplier("ModifyAckDeadline")) - .build(); - } - } - } - return getModifyAckDeadlineMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.AcknowledgeRequest, com.google.protobuf.Empty> - getAcknowledgeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Acknowledge", - requestType = com.google.pubsub.v1.AcknowledgeRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.AcknowledgeRequest, com.google.protobuf.Empty> - getAcknowledgeMethod() { - io.grpc.MethodDescriptor - getAcknowledgeMethod; - if ((getAcknowledgeMethod = SubscriberGrpc.getAcknowledgeMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getAcknowledgeMethod = SubscriberGrpc.getAcknowledgeMethod) == null) { - SubscriberGrpc.getAcknowledgeMethod = - getAcknowledgeMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Acknowledge")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("Acknowledge")) - .build(); - } - } - } - return getAcknowledgeMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.PullRequest, com.google.pubsub.v1.PullResponse> - getPullMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Pull", - requestType = com.google.pubsub.v1.PullRequest.class, - responseType = com.google.pubsub.v1.PullResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.PullRequest, com.google.pubsub.v1.PullResponse> - getPullMethod() { - io.grpc.MethodDescriptor - getPullMethod; - if ((getPullMethod = SubscriberGrpc.getPullMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getPullMethod = SubscriberGrpc.getPullMethod) == null) { - SubscriberGrpc.getPullMethod = - getPullMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Pull")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.PullRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.PullResponse.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("Pull")) - .build(); - } - } - } - return getPullMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.StreamingPullRequest, com.google.pubsub.v1.StreamingPullResponse> - getStreamingPullMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamingPull", - requestType = com.google.pubsub.v1.StreamingPullRequest.class, - responseType = com.google.pubsub.v1.StreamingPullResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.StreamingPullRequest, com.google.pubsub.v1.StreamingPullResponse> - getStreamingPullMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.StreamingPullRequest, com.google.pubsub.v1.StreamingPullResponse> - getStreamingPullMethod; - if ((getStreamingPullMethod = SubscriberGrpc.getStreamingPullMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getStreamingPullMethod = SubscriberGrpc.getStreamingPullMethod) == null) { - SubscriberGrpc.getStreamingPullMethod = - getStreamingPullMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingPull")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.StreamingPullRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.StreamingPullResponse.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("StreamingPull")) - .build(); - } - } - } - return getStreamingPullMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.ModifyPushConfigRequest, com.google.protobuf.Empty> - getModifyPushConfigMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ModifyPushConfig", - requestType = com.google.pubsub.v1.ModifyPushConfigRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.ModifyPushConfigRequest, com.google.protobuf.Empty> - getModifyPushConfigMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.ModifyPushConfigRequest, com.google.protobuf.Empty> - getModifyPushConfigMethod; - if ((getModifyPushConfigMethod = SubscriberGrpc.getModifyPushConfigMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getModifyPushConfigMethod = SubscriberGrpc.getModifyPushConfigMethod) == null) { - SubscriberGrpc.getModifyPushConfigMethod = - getModifyPushConfigMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ModifyPushConfig")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ModifyPushConfigRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor( - new SubscriberMethodDescriptorSupplier("ModifyPushConfig")) - .build(); - } - } - } - return getModifyPushConfigMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.GetSnapshotRequest, com.google.pubsub.v1.Snapshot> - getGetSnapshotMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetSnapshot", - requestType = com.google.pubsub.v1.GetSnapshotRequest.class, - responseType = com.google.pubsub.v1.Snapshot.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.GetSnapshotRequest, com.google.pubsub.v1.Snapshot> - getGetSnapshotMethod() { - io.grpc.MethodDescriptor - getGetSnapshotMethod; - if ((getGetSnapshotMethod = SubscriberGrpc.getGetSnapshotMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getGetSnapshotMethod = SubscriberGrpc.getGetSnapshotMethod) == null) { - SubscriberGrpc.getGetSnapshotMethod = - getGetSnapshotMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSnapshot")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.GetSnapshotRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Snapshot.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("GetSnapshot")) - .build(); - } - } - } - return getGetSnapshotMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListSnapshotsRequest, com.google.pubsub.v1.ListSnapshotsResponse> - getListSnapshotsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListSnapshots", - requestType = com.google.pubsub.v1.ListSnapshotsRequest.class, - responseType = com.google.pubsub.v1.ListSnapshotsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListSnapshotsRequest, com.google.pubsub.v1.ListSnapshotsResponse> - getListSnapshotsMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.ListSnapshotsRequest, com.google.pubsub.v1.ListSnapshotsResponse> - getListSnapshotsMethod; - if ((getListSnapshotsMethod = SubscriberGrpc.getListSnapshotsMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getListSnapshotsMethod = SubscriberGrpc.getListSnapshotsMethod) == null) { - SubscriberGrpc.getListSnapshotsMethod = - getListSnapshotsMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSnapshots")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListSnapshotsRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListSnapshotsResponse.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("ListSnapshots")) - .build(); - } - } - } - return getListSnapshotsMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.CreateSnapshotRequest, com.google.pubsub.v1.Snapshot> - getCreateSnapshotMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateSnapshot", - requestType = com.google.pubsub.v1.CreateSnapshotRequest.class, - responseType = com.google.pubsub.v1.Snapshot.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.CreateSnapshotRequest, com.google.pubsub.v1.Snapshot> - getCreateSnapshotMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.CreateSnapshotRequest, com.google.pubsub.v1.Snapshot> - getCreateSnapshotMethod; - if ((getCreateSnapshotMethod = SubscriberGrpc.getCreateSnapshotMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getCreateSnapshotMethod = SubscriberGrpc.getCreateSnapshotMethod) == null) { - SubscriberGrpc.getCreateSnapshotMethod = - getCreateSnapshotMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSnapshot")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.CreateSnapshotRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Snapshot.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("CreateSnapshot")) - .build(); - } - } - } - return getCreateSnapshotMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.UpdateSnapshotRequest, com.google.pubsub.v1.Snapshot> - getUpdateSnapshotMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateSnapshot", - requestType = com.google.pubsub.v1.UpdateSnapshotRequest.class, - responseType = com.google.pubsub.v1.Snapshot.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.UpdateSnapshotRequest, com.google.pubsub.v1.Snapshot> - getUpdateSnapshotMethod() { - io.grpc.MethodDescriptor< - com.google.pubsub.v1.UpdateSnapshotRequest, com.google.pubsub.v1.Snapshot> - getUpdateSnapshotMethod; - if ((getUpdateSnapshotMethod = SubscriberGrpc.getUpdateSnapshotMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getUpdateSnapshotMethod = SubscriberGrpc.getUpdateSnapshotMethod) == null) { - SubscriberGrpc.getUpdateSnapshotMethod = - getUpdateSnapshotMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSnapshot")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.UpdateSnapshotRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Snapshot.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("UpdateSnapshot")) - .build(); - } - } - } - return getUpdateSnapshotMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.DeleteSnapshotRequest, com.google.protobuf.Empty> - getDeleteSnapshotMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteSnapshot", - requestType = com.google.pubsub.v1.DeleteSnapshotRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.DeleteSnapshotRequest, com.google.protobuf.Empty> - getDeleteSnapshotMethod() { - io.grpc.MethodDescriptor - getDeleteSnapshotMethod; - if ((getDeleteSnapshotMethod = SubscriberGrpc.getDeleteSnapshotMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getDeleteSnapshotMethod = SubscriberGrpc.getDeleteSnapshotMethod) == null) { - SubscriberGrpc.getDeleteSnapshotMethod = - getDeleteSnapshotMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSnapshot")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.DeleteSnapshotRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("DeleteSnapshot")) - .build(); - } - } - } - return getDeleteSnapshotMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.pubsub.v1.SeekRequest, com.google.pubsub.v1.SeekResponse> - getSeekMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Seek", - requestType = com.google.pubsub.v1.SeekRequest.class, - responseType = com.google.pubsub.v1.SeekResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.pubsub.v1.SeekRequest, com.google.pubsub.v1.SeekResponse> - getSeekMethod() { - io.grpc.MethodDescriptor - getSeekMethod; - if ((getSeekMethod = SubscriberGrpc.getSeekMethod) == null) { - synchronized (SubscriberGrpc.class) { - if ((getSeekMethod = SubscriberGrpc.getSeekMethod) == null) { - SubscriberGrpc.getSeekMethod = - getSeekMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Seek")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.SeekRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.SeekResponse.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("Seek")) - .build(); - } - } - } - return getSeekMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static SubscriberStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SubscriberStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SubscriberStub(channel, callOptions); - } - }; - return SubscriberStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static SubscriberBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SubscriberBlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SubscriberBlockingStub(channel, callOptions); - } - }; - return SubscriberBlockingStub.newStub(factory, channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static SubscriberFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SubscriberFutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SubscriberFutureStub(channel, callOptions); - } - }; - return SubscriberFutureStub.newStub(factory, channel); - } - - /** - * - * - *
-   * The service that an application uses to manipulate subscriptions and to
-   * consume messages from a subscription via the `Pull` method or by
-   * establishing a bi-directional stream using the `StreamingPull` method.
-   * 
- */ - public interface AsyncService { - - /** - * - * - *
-     * Creates a subscription to a given topic. See the [resource name rules]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * If the subscription already exists, returns `ALREADY_EXISTS`.
-     * If the corresponding topic doesn't exist, returns `NOT_FOUND`.
-     * If the name is not provided in the request, the server will assign a random
-     * name for this subscription on the same project as the topic, conforming
-     * to the [resource name format]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
-     * generated name is populated in the returned Subscription object. Note that
-     * for REST API requests, you must specify a name in the request.
-     * 
- */ - default void createSubscription( - com.google.pubsub.v1.Subscription request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreateSubscriptionMethod(), responseObserver); - } - - /** - * - * - *
-     * Gets the configuration details of a subscription.
-     * 
- */ - default void getSubscription( - com.google.pubsub.v1.GetSubscriptionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getGetSubscriptionMethod(), responseObserver); - } - - /** - * - * - *
-     * Updates an existing subscription. Note that certain properties of a
-     * subscription, such as its topic, are not modifiable.
-     * 
- */ - default void updateSubscription( - com.google.pubsub.v1.UpdateSubscriptionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getUpdateSubscriptionMethod(), responseObserver); - } - - /** - * - * - *
-     * Lists matching subscriptions.
-     * 
- */ - default void listSubscriptions( - com.google.pubsub.v1.ListSubscriptionsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListSubscriptionsMethod(), responseObserver); - } - - /** - * - * - *
-     * Deletes an existing subscription. All messages retained in the subscription
-     * are immediately dropped. Calls to `Pull` after deletion will return
-     * `NOT_FOUND`. After a subscription is deleted, a new one may be created with
-     * the same name, but the new one has no association with the old
-     * subscription or its topic unless the same topic is specified.
-     * 
- */ - default void deleteSubscription( - com.google.pubsub.v1.DeleteSubscriptionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteSubscriptionMethod(), responseObserver); - } - - /** - * - * - *
-     * Modifies the ack deadline for a specific message. This method is useful
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted. Note that this does not modify the
-     * subscription-level `ackDeadlineSeconds` used for subsequent messages.
-     * 
- */ - default void modifyAckDeadline( - com.google.pubsub.v1.ModifyAckDeadlineRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getModifyAckDeadlineMethod(), responseObserver); - } - - /** - * - * - *
-     * Acknowledges the messages associated with the `ack_ids` in the
-     * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
-     * from the subscription.
-     * Acknowledging a message whose ack deadline has expired may succeed,
-     * but such a message may be redelivered later. Acknowledging a message more
-     * than once will not result in an error.
-     * 
- */ - default void acknowledge( - com.google.pubsub.v1.AcknowledgeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getAcknowledgeMethod(), responseObserver); - } - - /** - * - * - *
-     * Pulls messages from the server.
-     * 
- */ - default void pull( - com.google.pubsub.v1.PullRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPullMethod(), responseObserver); - } - - /** - * - * - *
-     * Establishes a stream with the server, which sends messages down to the
-     * client. The client streams acknowledgements and ack deadline modifications
-     * back to the server. The server will close the stream and return the status
-     * on any error. The server may close the stream with status `UNAVAILABLE` to
-     * reassign server-side resources, in which case, the client should
-     * re-establish the stream. Flow control can be achieved by configuring the
-     * underlying RPC channel.
-     * 
- */ - default io.grpc.stub.StreamObserver streamingPull( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( - getStreamingPullMethod(), responseObserver); - } - - /** - * - * - *
-     * Modifies the `PushConfig` for a specified subscription.
-     * This may be used to change a push subscription to a pull one (signified by
-     * an empty `PushConfig`) or vice versa, or change the endpoint URL and other
-     * attributes of a push subscription. Messages will accumulate for delivery
-     * continuously through the call regardless of changes to the `PushConfig`.
-     * 
- */ - default void modifyPushConfig( - com.google.pubsub.v1.ModifyPushConfigRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getModifyPushConfigMethod(), responseObserver); - } - - /** - * - * - *
-     * Gets the configuration details of a snapshot. 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.
-     * 
- */ - default void getSnapshot( - com.google.pubsub.v1.GetSnapshotRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getGetSnapshotMethod(), responseObserver); - } - - /** - * - * - *
-     * Lists the existing snapshots. 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.
-     * 
- */ - default void listSnapshots( - com.google.pubsub.v1.ListSnapshotsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListSnapshotsMethod(), responseObserver); - } - - /** - * - * - *
-     * Creates a snapshot from the requested subscription. 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.
-     * If the snapshot already exists, returns `ALREADY_EXISTS`.
-     * If the requested subscription doesn't exist, returns `NOT_FOUND`.
-     * If the backlog in the subscription is too old -- and the resulting snapshot
-     * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.
-     * See also the `Snapshot.expire_time` field. If the name is not provided in
-     * the request, the server will assign a random
-     * name for this snapshot on the same project as the subscription, conforming
-     * to the [resource name format]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
-     * generated name is populated in the returned Snapshot object. Note that for
-     * REST API requests, you must specify a name in the request.
-     * 
- */ - default void createSnapshot( - com.google.pubsub.v1.CreateSnapshotRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreateSnapshotMethod(), responseObserver); - } - - /** - * - * - *
-     * Updates an existing snapshot. 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.
-     * 
- */ - default void updateSnapshot( - com.google.pubsub.v1.UpdateSnapshotRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getUpdateSnapshotMethod(), responseObserver); - } - - /** - * - * - *
-     * Removes an existing snapshot. 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.
-     * When the snapshot is deleted, all messages retained in the snapshot
-     * are immediately dropped. After a snapshot is deleted, a new one may be
-     * created with the same name, but the new one has no association with the old
-     * snapshot or its subscription, unless the same subscription is specified.
-     * 
- */ - default void deleteSnapshot( - com.google.pubsub.v1.DeleteSnapshotRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeleteSnapshotMethod(), responseObserver); - } - - /** - * - * - *
-     * 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 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.
-     * 
- */ - default void seek( - com.google.pubsub.v1.SeekRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSeekMethod(), responseObserver); - } - } - - /** - * Base class for the server implementation of the service Subscriber. - * - *
-   * The service that an application uses to manipulate subscriptions and to
-   * consume messages from a subscription via the `Pull` method or by
-   * establishing a bi-directional stream using the `StreamingPull` method.
-   * 
- */ - public abstract static class SubscriberImplBase implements io.grpc.BindableService, AsyncService { - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return SubscriberGrpc.bindService(this); - } - } - - /** - * A stub to allow clients to do asynchronous rpc calls to service Subscriber. - * - *
-   * The service that an application uses to manipulate subscriptions and to
-   * consume messages from a subscription via the `Pull` method or by
-   * establishing a bi-directional stream using the `StreamingPull` method.
-   * 
- */ - public static final class SubscriberStub extends io.grpc.stub.AbstractAsyncStub { - private SubscriberStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SubscriberStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SubscriberStub(channel, callOptions); - } - - /** - * - * - *
-     * Creates a subscription to a given topic. See the [resource name rules]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * If the subscription already exists, returns `ALREADY_EXISTS`.
-     * If the corresponding topic doesn't exist, returns `NOT_FOUND`.
-     * If the name is not provided in the request, the server will assign a random
-     * name for this subscription on the same project as the topic, conforming
-     * to the [resource name format]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
-     * generated name is populated in the returned Subscription object. Note that
-     * for REST API requests, you must specify a name in the request.
-     * 
- */ - public void createSubscription( - com.google.pubsub.v1.Subscription request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateSubscriptionMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Gets the configuration details of a subscription.
-     * 
- */ - public void getSubscription( - com.google.pubsub.v1.GetSubscriptionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetSubscriptionMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Updates an existing subscription. Note that certain properties of a
-     * subscription, such as its topic, are not modifiable.
-     * 
- */ - public void updateSubscription( - com.google.pubsub.v1.UpdateSubscriptionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateSubscriptionMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Lists matching subscriptions.
-     * 
- */ - public void listSubscriptions( - com.google.pubsub.v1.ListSubscriptionsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListSubscriptionsMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Deletes an existing subscription. All messages retained in the subscription
-     * are immediately dropped. Calls to `Pull` after deletion will return
-     * `NOT_FOUND`. After a subscription is deleted, a new one may be created with
-     * the same name, but the new one has no association with the old
-     * subscription or its topic unless the same topic is specified.
-     * 
- */ - public void deleteSubscription( - com.google.pubsub.v1.DeleteSubscriptionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteSubscriptionMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Modifies the ack deadline for a specific message. This method is useful
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted. Note that this does not modify the
-     * subscription-level `ackDeadlineSeconds` used for subsequent messages.
-     * 
- */ - public void modifyAckDeadline( - com.google.pubsub.v1.ModifyAckDeadlineRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getModifyAckDeadlineMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Acknowledges the messages associated with the `ack_ids` in the
-     * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
-     * from the subscription.
-     * Acknowledging a message whose ack deadline has expired may succeed,
-     * but such a message may be redelivered later. Acknowledging a message more
-     * than once will not result in an error.
-     * 
- */ - public void acknowledge( - com.google.pubsub.v1.AcknowledgeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAcknowledgeMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Pulls messages from the server.
-     * 
- */ - public void pull( - com.google.pubsub.v1.PullRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPullMethod(), getCallOptions()), request, responseObserver); - } - - /** - * - * - *
-     * Establishes a stream with the server, which sends messages down to the
-     * client. The client streams acknowledgements and ack deadline modifications
-     * back to the server. The server will close the stream and return the status
-     * on any error. The server may close the stream with status `UNAVAILABLE` to
-     * reassign server-side resources, in which case, the client should
-     * re-establish the stream. Flow control can be achieved by configuring the
-     * underlying RPC channel.
-     * 
- */ - public io.grpc.stub.StreamObserver streamingPull( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( - getChannel().newCall(getStreamingPullMethod(), getCallOptions()), responseObserver); - } - - /** - * - * - *
-     * Modifies the `PushConfig` for a specified subscription.
-     * This may be used to change a push subscription to a pull one (signified by
-     * an empty `PushConfig`) or vice versa, or change the endpoint URL and other
-     * attributes of a push subscription. Messages will accumulate for delivery
-     * continuously through the call regardless of changes to the `PushConfig`.
-     * 
- */ - public void modifyPushConfig( - com.google.pubsub.v1.ModifyPushConfigRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getModifyPushConfigMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Gets the configuration details of a snapshot. 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.
-     * 
- */ - public void getSnapshot( - com.google.pubsub.v1.GetSnapshotRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetSnapshotMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Lists the existing snapshots. 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.
-     * 
- */ - public void listSnapshots( - com.google.pubsub.v1.ListSnapshotsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListSnapshotsMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Creates a snapshot from the requested subscription. 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.
-     * If the snapshot already exists, returns `ALREADY_EXISTS`.
-     * If the requested subscription doesn't exist, returns `NOT_FOUND`.
-     * If the backlog in the subscription is too old -- and the resulting snapshot
-     * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.
-     * See also the `Snapshot.expire_time` field. If the name is not provided in
-     * the request, the server will assign a random
-     * name for this snapshot on the same project as the subscription, conforming
-     * to the [resource name format]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
-     * generated name is populated in the returned Snapshot object. Note that for
-     * REST API requests, you must specify a name in the request.
-     * 
- */ - public void createSnapshot( - com.google.pubsub.v1.CreateSnapshotRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateSnapshotMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Updates an existing snapshot. 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.
-     * 
- */ - public void updateSnapshot( - com.google.pubsub.v1.UpdateSnapshotRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateSnapshotMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Removes an existing snapshot. 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.
-     * When the snapshot is deleted, all messages retained in the snapshot
-     * are immediately dropped. After a snapshot is deleted, a new one may be
-     * created with the same name, but the new one has no association with the old
-     * snapshot or its subscription, unless the same subscription is specified.
-     * 
- */ - public void deleteSnapshot( - com.google.pubsub.v1.DeleteSnapshotRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteSnapshotMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * 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 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.
-     * 
- */ - public void seek( - com.google.pubsub.v1.SeekRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getSeekMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - * A stub to allow clients to do synchronous rpc calls to service Subscriber. - * - *
-   * The service that an application uses to manipulate subscriptions and to
-   * consume messages from a subscription via the `Pull` method or by
-   * establishing a bi-directional stream using the `StreamingPull` method.
-   * 
- */ - public static final class SubscriberBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private SubscriberBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SubscriberBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SubscriberBlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * Creates a subscription to a given topic. See the [resource name rules]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * If the subscription already exists, returns `ALREADY_EXISTS`.
-     * If the corresponding topic doesn't exist, returns `NOT_FOUND`.
-     * If the name is not provided in the request, the server will assign a random
-     * name for this subscription on the same project as the topic, conforming
-     * to the [resource name format]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
-     * generated name is populated in the returned Subscription object. Note that
-     * for REST API requests, you must specify a name in the request.
-     * 
- */ - public com.google.pubsub.v1.Subscription createSubscription( - com.google.pubsub.v1.Subscription request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateSubscriptionMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Gets the configuration details of a subscription.
-     * 
- */ - public com.google.pubsub.v1.Subscription getSubscription( - com.google.pubsub.v1.GetSubscriptionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetSubscriptionMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Updates an existing subscription. Note that certain properties of a
-     * subscription, such as its topic, are not modifiable.
-     * 
- */ - public com.google.pubsub.v1.Subscription updateSubscription( - com.google.pubsub.v1.UpdateSubscriptionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateSubscriptionMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Lists matching subscriptions.
-     * 
- */ - public com.google.pubsub.v1.ListSubscriptionsResponse listSubscriptions( - com.google.pubsub.v1.ListSubscriptionsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListSubscriptionsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Deletes an existing subscription. All messages retained in the subscription
-     * are immediately dropped. Calls to `Pull` after deletion will return
-     * `NOT_FOUND`. After a subscription is deleted, a new one may be created with
-     * the same name, but the new one has no association with the old
-     * subscription or its topic unless the same topic is specified.
-     * 
- */ - public com.google.protobuf.Empty deleteSubscription( - com.google.pubsub.v1.DeleteSubscriptionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteSubscriptionMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Modifies the ack deadline for a specific message. This method is useful
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted. Note that this does not modify the
-     * subscription-level `ackDeadlineSeconds` used for subsequent messages.
-     * 
- */ - public com.google.protobuf.Empty modifyAckDeadline( - com.google.pubsub.v1.ModifyAckDeadlineRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getModifyAckDeadlineMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Acknowledges the messages associated with the `ack_ids` in the
-     * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
-     * from the subscription.
-     * Acknowledging a message whose ack deadline has expired may succeed,
-     * but such a message may be redelivered later. Acknowledging a message more
-     * than once will not result in an error.
-     * 
- */ - public com.google.protobuf.Empty acknowledge(com.google.pubsub.v1.AcknowledgeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAcknowledgeMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Pulls messages from the server.
-     * 
- */ - public com.google.pubsub.v1.PullResponse pull(com.google.pubsub.v1.PullRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPullMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Modifies the `PushConfig` for a specified subscription.
-     * This may be used to change a push subscription to a pull one (signified by
-     * an empty `PushConfig`) or vice versa, or change the endpoint URL and other
-     * attributes of a push subscription. Messages will accumulate for delivery
-     * continuously through the call regardless of changes to the `PushConfig`.
-     * 
- */ - public com.google.protobuf.Empty modifyPushConfig( - com.google.pubsub.v1.ModifyPushConfigRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getModifyPushConfigMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Gets the configuration details of a snapshot. 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.
-     * 
- */ - public com.google.pubsub.v1.Snapshot getSnapshot( - com.google.pubsub.v1.GetSnapshotRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetSnapshotMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Lists the existing snapshots. 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.
-     * 
- */ - public com.google.pubsub.v1.ListSnapshotsResponse listSnapshots( - com.google.pubsub.v1.ListSnapshotsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListSnapshotsMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Creates a snapshot from the requested subscription. 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.
-     * If the snapshot already exists, returns `ALREADY_EXISTS`.
-     * If the requested subscription doesn't exist, returns `NOT_FOUND`.
-     * If the backlog in the subscription is too old -- and the resulting snapshot
-     * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.
-     * See also the `Snapshot.expire_time` field. If the name is not provided in
-     * the request, the server will assign a random
-     * name for this snapshot on the same project as the subscription, conforming
-     * to the [resource name format]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
-     * generated name is populated in the returned Snapshot object. Note that for
-     * REST API requests, you must specify a name in the request.
-     * 
- */ - public com.google.pubsub.v1.Snapshot createSnapshot( - com.google.pubsub.v1.CreateSnapshotRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateSnapshotMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Updates an existing snapshot. 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.
-     * 
- */ - public com.google.pubsub.v1.Snapshot updateSnapshot( - com.google.pubsub.v1.UpdateSnapshotRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateSnapshotMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Removes an existing snapshot. 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.
-     * When the snapshot is deleted, all messages retained in the snapshot
-     * are immediately dropped. After a snapshot is deleted, a new one may be
-     * created with the same name, but the new one has no association with the old
-     * snapshot or its subscription, unless the same subscription is specified.
-     * 
- */ - public com.google.protobuf.Empty deleteSnapshot( - com.google.pubsub.v1.DeleteSnapshotRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteSnapshotMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * 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 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.
-     * 
- */ - public com.google.pubsub.v1.SeekResponse seek(com.google.pubsub.v1.SeekRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getSeekMethod(), getCallOptions(), request); - } - } - - /** - * A stub to allow clients to do ListenableFuture-style rpc calls to service Subscriber. - * - *
-   * The service that an application uses to manipulate subscriptions and to
-   * consume messages from a subscription via the `Pull` method or by
-   * establishing a bi-directional stream using the `StreamingPull` method.
-   * 
- */ - public static final class SubscriberFutureStub - extends io.grpc.stub.AbstractFutureStub { - private SubscriberFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SubscriberFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SubscriberFutureStub(channel, callOptions); - } - - /** - * - * - *
-     * Creates a subscription to a given topic. See the [resource name rules]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * If the subscription already exists, returns `ALREADY_EXISTS`.
-     * If the corresponding topic doesn't exist, returns `NOT_FOUND`.
-     * If the name is not provided in the request, the server will assign a random
-     * name for this subscription on the same project as the topic, conforming
-     * to the [resource name format]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
-     * generated name is populated in the returned Subscription object. Note that
-     * for REST API requests, you must specify a name in the request.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - createSubscription(com.google.pubsub.v1.Subscription request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateSubscriptionMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Gets the configuration details of a subscription.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - getSubscription(com.google.pubsub.v1.GetSubscriptionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetSubscriptionMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Updates an existing subscription. Note that certain properties of a
-     * subscription, such as its topic, are not modifiable.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - updateSubscription(com.google.pubsub.v1.UpdateSubscriptionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateSubscriptionMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Lists matching subscriptions.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.pubsub.v1.ListSubscriptionsResponse> - listSubscriptions(com.google.pubsub.v1.ListSubscriptionsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListSubscriptionsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Deletes an existing subscription. All messages retained in the subscription
-     * are immediately dropped. Calls to `Pull` after deletion will return
-     * `NOT_FOUND`. After a subscription is deleted, a new one may be created with
-     * the same name, but the new one has no association with the old
-     * subscription or its topic unless the same topic is specified.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteSubscription(com.google.pubsub.v1.DeleteSubscriptionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteSubscriptionMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Modifies the ack deadline for a specific message. This method is useful
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted. Note that this does not modify the
-     * subscription-level `ackDeadlineSeconds` used for subsequent messages.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - modifyAckDeadline(com.google.pubsub.v1.ModifyAckDeadlineRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getModifyAckDeadlineMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Acknowledges the messages associated with the `ack_ids` in the
-     * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
-     * from the subscription.
-     * Acknowledging a message whose ack deadline has expired may succeed,
-     * but such a message may be redelivered later. Acknowledging a message more
-     * than once will not result in an error.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - acknowledge(com.google.pubsub.v1.AcknowledgeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAcknowledgeMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Pulls messages from the server.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - pull(com.google.pubsub.v1.PullRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPullMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Modifies the `PushConfig` for a specified subscription.
-     * This may be used to change a push subscription to a pull one (signified by
-     * an empty `PushConfig`) or vice versa, or change the endpoint URL and other
-     * attributes of a push subscription. Messages will accumulate for delivery
-     * continuously through the call regardless of changes to the `PushConfig`.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - modifyPushConfig(com.google.pubsub.v1.ModifyPushConfigRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getModifyPushConfigMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Gets the configuration details of a snapshot. 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.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - getSnapshot(com.google.pubsub.v1.GetSnapshotRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetSnapshotMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Lists the existing snapshots. 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.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.pubsub.v1.ListSnapshotsResponse> - listSnapshots(com.google.pubsub.v1.ListSnapshotsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListSnapshotsMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Creates a snapshot from the requested subscription. 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.
-     * If the snapshot already exists, returns `ALREADY_EXISTS`.
-     * If the requested subscription doesn't exist, returns `NOT_FOUND`.
-     * If the backlog in the subscription is too old -- and the resulting snapshot
-     * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.
-     * See also the `Snapshot.expire_time` field. If the name is not provided in
-     * the request, the server will assign a random
-     * name for this snapshot on the same project as the subscription, conforming
-     * to the [resource name format]
-     * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
-     * generated name is populated in the returned Snapshot object. Note that for
-     * REST API requests, you must specify a name in the request.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - createSnapshot(com.google.pubsub.v1.CreateSnapshotRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateSnapshotMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Updates an existing snapshot. 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.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - updateSnapshot(com.google.pubsub.v1.UpdateSnapshotRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateSnapshotMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Removes an existing snapshot. 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.
-     * When the snapshot is deleted, all messages retained in the snapshot
-     * are immediately dropped. After a snapshot is deleted, a new one may be
-     * created with the same name, but the new one has no association with the old
-     * snapshot or its subscription, unless the same subscription is specified.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deleteSnapshot(com.google.pubsub.v1.DeleteSnapshotRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteSnapshotMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * 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 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.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - seek(com.google.pubsub.v1.SeekRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getSeekMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_CREATE_SUBSCRIPTION = 0; - private static final int METHODID_GET_SUBSCRIPTION = 1; - private static final int METHODID_UPDATE_SUBSCRIPTION = 2; - private static final int METHODID_LIST_SUBSCRIPTIONS = 3; - private static final int METHODID_DELETE_SUBSCRIPTION = 4; - private static final int METHODID_MODIFY_ACK_DEADLINE = 5; - private static final int METHODID_ACKNOWLEDGE = 6; - private static final int METHODID_PULL = 7; - private static final int METHODID_MODIFY_PUSH_CONFIG = 8; - private static final int METHODID_GET_SNAPSHOT = 9; - private static final int METHODID_LIST_SNAPSHOTS = 10; - private static final int METHODID_CREATE_SNAPSHOT = 11; - private static final int METHODID_UPDATE_SNAPSHOT = 12; - private static final int METHODID_DELETE_SNAPSHOT = 13; - private static final int METHODID_SEEK = 14; - private static final int METHODID_STREAMING_PULL = 15; - - 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 AsyncService serviceImpl; - private final int methodId; - - MethodHandlers(AsyncService 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_SUBSCRIPTION: - serviceImpl.createSubscription( - (com.google.pubsub.v1.Subscription) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_SUBSCRIPTION: - serviceImpl.getSubscription( - (com.google.pubsub.v1.GetSubscriptionRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_SUBSCRIPTION: - serviceImpl.updateSubscription( - (com.google.pubsub.v1.UpdateSubscriptionRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_SUBSCRIPTIONS: - serviceImpl.listSubscriptions( - (com.google.pubsub.v1.ListSubscriptionsRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_DELETE_SUBSCRIPTION: - serviceImpl.deleteSubscription( - (com.google.pubsub.v1.DeleteSubscriptionRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_MODIFY_ACK_DEADLINE: - serviceImpl.modifyAckDeadline( - (com.google.pubsub.v1.ModifyAckDeadlineRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ACKNOWLEDGE: - serviceImpl.acknowledge( - (com.google.pubsub.v1.AcknowledgeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PULL: - serviceImpl.pull( - (com.google.pubsub.v1.PullRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_MODIFY_PUSH_CONFIG: - serviceImpl.modifyPushConfig( - (com.google.pubsub.v1.ModifyPushConfigRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_SNAPSHOT: - serviceImpl.getSnapshot( - (com.google.pubsub.v1.GetSnapshotRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_SNAPSHOTS: - serviceImpl.listSnapshots( - (com.google.pubsub.v1.ListSnapshotsRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; - case METHODID_CREATE_SNAPSHOT: - serviceImpl.createSnapshot( - (com.google.pubsub.v1.CreateSnapshotRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_SNAPSHOT: - serviceImpl.updateSnapshot( - (com.google.pubsub.v1.UpdateSnapshotRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_SNAPSHOT: - serviceImpl.deleteSnapshot( - (com.google.pubsub.v1.DeleteSnapshotRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_SEEK: - serviceImpl.seek( - (com.google.pubsub.v1.SeekRequest) 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) { - case METHODID_STREAMING_PULL: - return (io.grpc.stub.StreamObserver) - serviceImpl.streamingPull( - (io.grpc.stub.StreamObserver) - responseObserver); - default: - throw new AssertionError(); - } - } - } - - public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateSubscriptionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.Subscription, com.google.pubsub.v1.Subscription>( - service, METHODID_CREATE_SUBSCRIPTION))) - .addMethod( - getGetSubscriptionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.GetSubscriptionRequest, com.google.pubsub.v1.Subscription>( - service, METHODID_GET_SUBSCRIPTION))) - .addMethod( - getUpdateSubscriptionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.UpdateSubscriptionRequest, - com.google.pubsub.v1.Subscription>(service, METHODID_UPDATE_SUBSCRIPTION))) - .addMethod( - getListSubscriptionsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ListSubscriptionsRequest, - com.google.pubsub.v1.ListSubscriptionsResponse>( - service, METHODID_LIST_SUBSCRIPTIONS))) - .addMethod( - getDeleteSubscriptionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.DeleteSubscriptionRequest, com.google.protobuf.Empty>( - service, METHODID_DELETE_SUBSCRIPTION))) - .addMethod( - getModifyAckDeadlineMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ModifyAckDeadlineRequest, com.google.protobuf.Empty>( - service, METHODID_MODIFY_ACK_DEADLINE))) - .addMethod( - getAcknowledgeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.AcknowledgeRequest, com.google.protobuf.Empty>( - service, METHODID_ACKNOWLEDGE))) - .addMethod( - getPullMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.PullRequest, com.google.pubsub.v1.PullResponse>( - service, METHODID_PULL))) - .addMethod( - getStreamingPullMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - com.google.pubsub.v1.StreamingPullRequest, - com.google.pubsub.v1.StreamingPullResponse>(service, METHODID_STREAMING_PULL))) - .addMethod( - getModifyPushConfigMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ModifyPushConfigRequest, com.google.protobuf.Empty>( - service, METHODID_MODIFY_PUSH_CONFIG))) - .addMethod( - getGetSnapshotMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.GetSnapshotRequest, com.google.pubsub.v1.Snapshot>( - service, METHODID_GET_SNAPSHOT))) - .addMethod( - getListSnapshotsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ListSnapshotsRequest, - com.google.pubsub.v1.ListSnapshotsResponse>(service, METHODID_LIST_SNAPSHOTS))) - .addMethod( - getCreateSnapshotMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.CreateSnapshotRequest, com.google.pubsub.v1.Snapshot>( - service, METHODID_CREATE_SNAPSHOT))) - .addMethod( - getUpdateSnapshotMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.UpdateSnapshotRequest, com.google.pubsub.v1.Snapshot>( - service, METHODID_UPDATE_SNAPSHOT))) - .addMethod( - getDeleteSnapshotMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.DeleteSnapshotRequest, com.google.protobuf.Empty>( - service, METHODID_DELETE_SNAPSHOT))) - .addMethod( - getSeekMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.SeekRequest, com.google.pubsub.v1.SeekResponse>( - service, METHODID_SEEK))) - .build(); - } - - private abstract static class SubscriberBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - SubscriberBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.pubsub.v1.PubsubProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Subscriber"); - } - } - - private static final class SubscriberFileDescriptorSupplier - extends SubscriberBaseDescriptorSupplier { - SubscriberFileDescriptorSupplier() {} - } - - private static final class SubscriberMethodDescriptorSupplier - extends SubscriberBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final java.lang.String methodName; - - SubscriberMethodDescriptorSupplier(java.lang.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 (SubscriberGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new SubscriberFileDescriptorSupplier()) - .addMethod(getCreateSubscriptionMethod()) - .addMethod(getGetSubscriptionMethod()) - .addMethod(getUpdateSubscriptionMethod()) - .addMethod(getListSubscriptionsMethod()) - .addMethod(getDeleteSubscriptionMethod()) - .addMethod(getModifyAckDeadlineMethod()) - .addMethod(getAcknowledgeMethod()) - .addMethod(getPullMethod()) - .addMethod(getStreamingPullMethod()) - .addMethod(getModifyPushConfigMethod()) - .addMethod(getGetSnapshotMethod()) - .addMethod(getListSnapshotsMethod()) - .addMethod(getCreateSnapshotMethod()) - .addMethod(getUpdateSnapshotMethod()) - .addMethod(getDeleteSnapshotMethod()) - .addMethod(getSeekMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java deleted file mode 100644 index ad61b3fa8..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java +++ /dev/null @@ -1,946 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the Acknowledge method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.AcknowledgeRequest} - */ -public final class AcknowledgeRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.AcknowledgeRequest) - AcknowledgeRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use AcknowledgeRequest.newBuilder() to construct. - private AcknowledgeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AcknowledgeRequest() { - subscription_ = ""; - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AcknowledgeRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_AcknowledgeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.AcknowledgeRequest.class, - com.google.pubsub.v1.AcknowledgeRequest.Builder.class); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object subscription_ = ""; - /** - * - * - *
-   * Required. The subscription whose message is being acknowledged.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - @java.lang.Override - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - 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(); - subscription_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The subscription whose message is being acknowledged.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ACK_IDS_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList ackIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-   * Required. The acknowledgment ID for the messages being acknowledged that
-   * was returned by the Pub/Sub system in the `Pull` response. Must not be
-   * empty.
-   * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return A list containing the ackIds. - */ - public com.google.protobuf.ProtocolStringList getAckIdsList() { - return ackIds_; - } - /** - * - * - *
-   * Required. The acknowledgment ID for the messages being acknowledged that
-   * was returned by the Pub/Sub system in the `Pull` response. Must not be
-   * empty.
-   * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The count of ackIds. - */ - public int getAckIdsCount() { - return ackIds_.size(); - } - /** - * - * - *
-   * Required. The acknowledgment ID for the messages being acknowledged that
-   * was returned by the Pub/Sub system in the `Pull` response. Must not be
-   * empty.
-   * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - public java.lang.String getAckIds(int index) { - return ackIds_.get(index); - } - /** - * - * - *
-   * Required. The acknowledgment ID for the messages being acknowledged that
-   * was returned by the Pub/Sub system in the `Pull` response. Must not be
-   * empty.
-   * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - public com.google.protobuf.ByteString getAckIdsBytes(int index) { - return ackIds_.getByteString(index); - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); - } - for (int i = 0; i < ackIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ackIds_.getRaw(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_); - } - { - int dataSize = 0; - for (int i = 0; i < ackIds_.size(); i++) { - dataSize += computeStringSizeNoTag(ackIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getAckIdsList().size(); - } - size += getUnknownFields().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.AcknowledgeRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.AcknowledgeRequest other = (com.google.pubsub.v1.AcknowledgeRequest) obj; - - if (!getSubscription().equals(other.getSubscription())) return false; - if (!getAckIdsList().equals(other.getAckIdsList())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - if (getAckIdsCount() > 0) { - hash = (37 * hash) + ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getAckIdsList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.AcknowledgeRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.AcknowledgeRequest 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.AcknowledgeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.AcknowledgeRequest 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.AcknowledgeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.AcknowledgeRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.AcknowledgeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.AcknowledgeRequest 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.AcknowledgeRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.AcknowledgeRequest 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.AcknowledgeRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.AcknowledgeRequest 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.AcknowledgeRequest 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 Acknowledge method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.AcknowledgeRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.AcknowledgeRequest) - com.google.pubsub.v1.AcknowledgeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_AcknowledgeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.AcknowledgeRequest.class, - com.google.pubsub.v1.AcknowledgeRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.AcknowledgeRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscription_ = ""; - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.AcknowledgeRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.AcknowledgeRequest build() { - com.google.pubsub.v1.AcknowledgeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.AcknowledgeRequest buildPartial() { - com.google.pubsub.v1.AcknowledgeRequest result = - new com.google.pubsub.v1.AcknowledgeRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.AcknowledgeRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.subscription_ = subscription_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - ackIds_.makeImmutable(); - result.ackIds_ = ackIds_; - } - } - - @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.AcknowledgeRequest) { - return mergeFrom((com.google.pubsub.v1.AcknowledgeRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.AcknowledgeRequest other) { - if (other == com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance()) return this; - if (!other.getSubscription().isEmpty()) { - subscription_ = other.subscription_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.ackIds_.isEmpty()) { - if (ackIds_.isEmpty()) { - ackIds_ = other.ackIds_; - bitField0_ |= 0x00000002; - } else { - ensureAckIdsIsMutable(); - ackIds_.addAll(other.ackIds_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - subscription_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureAckIdsIsMutable(); - ackIds_.add(s); - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object subscription_ = ""; - /** - * - * - *
-     * Required. The subscription whose message is being acknowledged.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The subscription whose message is being acknowledged.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The subscription whose message is being acknowledged.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription whose message is being acknowledged.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSubscription() { - subscription_ = getDefaultInstance().getSubscription(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription whose message is being acknowledged.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringArrayList ackIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureAckIdsIsMutable() { - if (!ackIds_.isModifiable()) { - ackIds_ = new com.google.protobuf.LazyStringArrayList(ackIds_); - } - bitField0_ |= 0x00000002; - } - /** - * - * - *
-     * Required. The acknowledgment ID for the messages being acknowledged that
-     * was returned by the Pub/Sub system in the `Pull` response. Must not be
-     * empty.
-     * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return A list containing the ackIds. - */ - public com.google.protobuf.ProtocolStringList getAckIdsList() { - ackIds_.makeImmutable(); - return ackIds_; - } - /** - * - * - *
-     * Required. The acknowledgment ID for the messages being acknowledged that
-     * was returned by the Pub/Sub system in the `Pull` response. Must not be
-     * empty.
-     * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The count of ackIds. - */ - public int getAckIdsCount() { - return ackIds_.size(); - } - /** - * - * - *
-     * Required. The acknowledgment ID for the messages being acknowledged that
-     * was returned by the Pub/Sub system in the `Pull` response. Must not be
-     * empty.
-     * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - public java.lang.String getAckIds(int index) { - return ackIds_.get(index); - } - /** - * - * - *
-     * Required. The acknowledgment ID for the messages being acknowledged that
-     * was returned by the Pub/Sub system in the `Pull` response. Must not be
-     * empty.
-     * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - public com.google.protobuf.ByteString getAckIdsBytes(int index) { - return ackIds_.getByteString(index); - } - /** - * - * - *
-     * Required. The acknowledgment ID for the messages being acknowledged that
-     * was returned by the Pub/Sub system in the `Pull` response. Must not be
-     * empty.
-     * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index to set the value at. - * @param value The ackIds to set. - * @return This builder for chaining. - */ - public Builder setAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAckIdsIsMutable(); - ackIds_.set(index, value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The acknowledgment ID for the messages being acknowledged that
-     * was returned by the Pub/Sub system in the `Pull` response. Must not be
-     * empty.
-     * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The ackIds to add. - * @return This builder for chaining. - */ - public Builder addAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAckIdsIsMutable(); - ackIds_.add(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The acknowledgment ID for the messages being acknowledged that
-     * was returned by the Pub/Sub system in the `Pull` response. Must not be
-     * empty.
-     * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param values The ackIds to add. - * @return This builder for chaining. - */ - public Builder addAllAckIds(java.lang.Iterable values) { - ensureAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ackIds_); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The acknowledgment ID for the messages being acknowledged that
-     * was returned by the Pub/Sub system in the `Pull` response. Must not be
-     * empty.
-     * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearAckIds() { - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - ; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The acknowledgment ID for the messages being acknowledged that
-     * was returned by the Pub/Sub system in the `Pull` response. Must not be
-     * empty.
-     * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes of the ackIds to add. - * @return This builder for chaining. - */ - public Builder addAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAckIdsIsMutable(); - ackIds_.add(value); - bitField0_ |= 0x00000002; - 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.AcknowledgeRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.AcknowledgeRequest) - private static final com.google.pubsub.v1.AcknowledgeRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.AcknowledgeRequest(); - } - - public static com.google.pubsub.v1.AcknowledgeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AcknowledgeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.AcknowledgeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequestOrBuilder.java deleted file mode 100644 index b2e049435..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequestOrBuilder.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2023 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 AcknowledgeRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.AcknowledgeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The subscription whose message is being acknowledged.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - java.lang.String getSubscription(); - /** - * - * - *
-   * Required. The subscription whose message is being acknowledged.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - com.google.protobuf.ByteString getSubscriptionBytes(); - - /** - * - * - *
-   * Required. The acknowledgment ID for the messages being acknowledged that
-   * was returned by the Pub/Sub system in the `Pull` response. Must not be
-   * empty.
-   * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return A list containing the ackIds. - */ - java.util.List getAckIdsList(); - /** - * - * - *
-   * Required. The acknowledgment ID for the messages being acknowledged that
-   * was returned by the Pub/Sub system in the `Pull` response. Must not be
-   * empty.
-   * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The count of ackIds. - */ - int getAckIdsCount(); - /** - * - * - *
-   * Required. The acknowledgment ID for the messages being acknowledged that
-   * was returned by the Pub/Sub system in the `Pull` response. Must not be
-   * empty.
-   * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - java.lang.String getAckIds(int index); - /** - * - * - *
-   * Required. The acknowledgment ID for the messages being acknowledged that
-   * was returned by the Pub/Sub system in the `Pull` response. Must not be
-   * empty.
-   * 
- * - * repeated string ack_ids = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - com.google.protobuf.ByteString getAckIdsBytes(int index); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/BigQueryConfig.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/BigQueryConfig.java deleted file mode 100644 index 2683f75df..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/BigQueryConfig.java +++ /dev/null @@ -1,1427 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Configuration for a BigQuery subscription.
- * 
- * - * Protobuf type {@code google.pubsub.v1.BigQueryConfig} - */ -public final class BigQueryConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.BigQueryConfig) - BigQueryConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use BigQueryConfig.newBuilder() to construct. - private BigQueryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private BigQueryConfig() { - table_ = ""; - state_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new BigQueryConfig(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_BigQueryConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_BigQueryConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.BigQueryConfig.class, - com.google.pubsub.v1.BigQueryConfig.Builder.class); - } - - /** - * - * - *
-   * Possible states for a BigQuery subscription.
-   * 
- * - * Protobuf enum {@code google.pubsub.v1.BigQueryConfig.State} - */ - public enum State implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Default value. This value is unused.
-     * 
- * - * STATE_UNSPECIFIED = 0; - */ - STATE_UNSPECIFIED(0), - /** - * - * - *
-     * The subscription can actively send messages to BigQuery
-     * 
- * - * ACTIVE = 1; - */ - ACTIVE(1), - /** - * - * - *
-     * Cannot write to the BigQuery table because of permission denied errors.
-     * This can happen if
-     * - Pub/Sub SA has not been granted the [appropriate BigQuery IAM
-     * permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account)
-     * - bigquery.googleapis.com API is not enabled for the project
-     * ([instructions](https://cloud.google.com/service-usage/docs/enable-disable))
-     * 
- * - * PERMISSION_DENIED = 2; - */ - PERMISSION_DENIED(2), - /** - * - * - *
-     * Cannot write to the BigQuery table because it does not exist.
-     * 
- * - * NOT_FOUND = 3; - */ - NOT_FOUND(3), - /** - * - * - *
-     * Cannot write to the BigQuery table due to a schema mismatch.
-     * 
- * - * SCHEMA_MISMATCH = 4; - */ - SCHEMA_MISMATCH(4), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Default value. This value is unused.
-     * 
- * - * STATE_UNSPECIFIED = 0; - */ - public static final int STATE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * The subscription can actively send messages to BigQuery
-     * 
- * - * ACTIVE = 1; - */ - public static final int ACTIVE_VALUE = 1; - /** - * - * - *
-     * Cannot write to the BigQuery table because of permission denied errors.
-     * This can happen if
-     * - Pub/Sub SA has not been granted the [appropriate BigQuery IAM
-     * permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account)
-     * - bigquery.googleapis.com API is not enabled for the project
-     * ([instructions](https://cloud.google.com/service-usage/docs/enable-disable))
-     * 
- * - * PERMISSION_DENIED = 2; - */ - public static final int PERMISSION_DENIED_VALUE = 2; - /** - * - * - *
-     * Cannot write to the BigQuery table because it does not exist.
-     * 
- * - * NOT_FOUND = 3; - */ - public static final int NOT_FOUND_VALUE = 3; - /** - * - * - *
-     * Cannot write to the BigQuery table due to a schema mismatch.
-     * 
- * - * SCHEMA_MISMATCH = 4; - */ - public static final int SCHEMA_MISMATCH_VALUE = 4; - - 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 State 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 State forNumber(int value) { - switch (value) { - case 0: - return STATE_UNSPECIFIED; - case 1: - return ACTIVE; - case 2: - return PERMISSION_DENIED; - case 3: - return NOT_FOUND; - case 4: - return SCHEMA_MISMATCH; - 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 State findValueByNumber(int number) { - return State.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.BigQueryConfig.getDescriptor().getEnumTypes().get(0); - } - - private static final State[] VALUES = values(); - - public static State 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 State(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.pubsub.v1.BigQueryConfig.State) - } - - public static final int TABLE_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object table_ = ""; - /** - * - * - *
-   * The name of the table to which to write data, of the form
-   * {projectId}.{datasetId}.{tableId}
-   * 
- * - * string table = 1; - * - * @return The table. - */ - @java.lang.Override - public java.lang.String getTable() { - java.lang.Object ref = table_; - 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(); - table_ = s; - return s; - } - } - /** - * - * - *
-   * The name of the table to which to write data, of the form
-   * {projectId}.{datasetId}.{tableId}
-   * 
- * - * string table = 1; - * - * @return The bytes for table. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTableBytes() { - java.lang.Object ref = table_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - table_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int USE_TOPIC_SCHEMA_FIELD_NUMBER = 2; - private boolean useTopicSchema_ = false; - /** - * - * - *
-   * Optional. When true, use the topic's schema as the columns to write to in
-   * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
-   * enabled at the same time.
-   * 
- * - * bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The useTopicSchema. - */ - @java.lang.Override - public boolean getUseTopicSchema() { - return useTopicSchema_; - } - - public static final int WRITE_METADATA_FIELD_NUMBER = 3; - private boolean writeMetadata_ = false; - /** - * - * - *
-   * When true, write the subscription name, message_id, publish_time,
-   * attributes, and ordering_key to additional columns in the table. The
-   * subscription name, message_id, and publish_time fields are put in their own
-   * columns while all other message properties (other than data) are written to
-   * a JSON object in the attributes column.
-   * 
- * - * bool write_metadata = 3; - * - * @return The writeMetadata. - */ - @java.lang.Override - public boolean getWriteMetadata() { - return writeMetadata_; - } - - public static final int DROP_UNKNOWN_FIELDS_FIELD_NUMBER = 4; - private boolean dropUnknownFields_ = false; - /** - * - * - *
-   * When true and use_topic_schema is true, any fields that are a part of the
-   * topic schema that are not part of the BigQuery table schema are dropped
-   * when writing to BigQuery. Otherwise, the schemas must be kept in sync and
-   * any messages with extra fields are not written and remain in the
-   * subscription's backlog.
-   * 
- * - * bool drop_unknown_fields = 4; - * - * @return The dropUnknownFields. - */ - @java.lang.Override - public boolean getDropUnknownFields() { - return dropUnknownFields_; - } - - public static final int STATE_FIELD_NUMBER = 5; - private int state_ = 0; - /** - * - * - *
-   * Output only. An output-only field that indicates whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for state. - */ - @java.lang.Override - public int getStateValue() { - return state_; - } - /** - * - * - *
-   * Output only. An output-only field that indicates whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The state. - */ - @java.lang.Override - public com.google.pubsub.v1.BigQueryConfig.State getState() { - com.google.pubsub.v1.BigQueryConfig.State result = - com.google.pubsub.v1.BigQueryConfig.State.forNumber(state_); - return result == null ? com.google.pubsub.v1.BigQueryConfig.State.UNRECOGNIZED : result; - } - - public static final int USE_TABLE_SCHEMA_FIELD_NUMBER = 6; - private boolean useTableSchema_ = false; - /** - * - * - *
-   * Optional. When true, use the BigQuery table's schema as the columns to
-   * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
-   * enabled at the same time.
-   * 
- * - * bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The useTableSchema. - */ - @java.lang.Override - public boolean getUseTableSchema() { - return useTableSchema_; - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(table_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, table_); - } - if (useTopicSchema_ != false) { - output.writeBool(2, useTopicSchema_); - } - if (writeMetadata_ != false) { - output.writeBool(3, writeMetadata_); - } - if (dropUnknownFields_ != false) { - output.writeBool(4, dropUnknownFields_); - } - if (state_ != com.google.pubsub.v1.BigQueryConfig.State.STATE_UNSPECIFIED.getNumber()) { - output.writeEnum(5, state_); - } - if (useTableSchema_ != false) { - output.writeBool(6, useTableSchema_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(table_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, table_); - } - if (useTopicSchema_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, useTopicSchema_); - } - if (writeMetadata_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, writeMetadata_); - } - if (dropUnknownFields_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, dropUnknownFields_); - } - if (state_ != com.google.pubsub.v1.BigQueryConfig.State.STATE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); - } - if (useTableSchema_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, useTableSchema_); - } - size += getUnknownFields().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.BigQueryConfig)) { - return super.equals(obj); - } - com.google.pubsub.v1.BigQueryConfig other = (com.google.pubsub.v1.BigQueryConfig) obj; - - if (!getTable().equals(other.getTable())) return false; - if (getUseTopicSchema() != other.getUseTopicSchema()) return false; - if (getWriteMetadata() != other.getWriteMetadata()) return false; - if (getDropUnknownFields() != other.getDropUnknownFields()) return false; - if (state_ != other.state_) return false; - if (getUseTableSchema() != other.getUseTableSchema()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TABLE_FIELD_NUMBER; - hash = (53 * hash) + getTable().hashCode(); - hash = (37 * hash) + USE_TOPIC_SCHEMA_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseTopicSchema()); - hash = (37 * hash) + WRITE_METADATA_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getWriteMetadata()); - hash = (37 * hash) + DROP_UNKNOWN_FIELDS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDropUnknownFields()); - hash = (37 * hash) + STATE_FIELD_NUMBER; - hash = (53 * hash) + state_; - hash = (37 * hash) + USE_TABLE_SCHEMA_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseTableSchema()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.BigQueryConfig parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.BigQueryConfig 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.BigQueryConfig parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.BigQueryConfig 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.BigQueryConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.BigQueryConfig parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.BigQueryConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.BigQueryConfig 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.BigQueryConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.BigQueryConfig 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.BigQueryConfig parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.BigQueryConfig 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.BigQueryConfig 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; - } - /** - * - * - *
-   * Configuration for a BigQuery subscription.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.BigQueryConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.BigQueryConfig) - com.google.pubsub.v1.BigQueryConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_BigQueryConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_BigQueryConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.BigQueryConfig.class, - com.google.pubsub.v1.BigQueryConfig.Builder.class); - } - - // Construct using com.google.pubsub.v1.BigQueryConfig.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - table_ = ""; - useTopicSchema_ = false; - writeMetadata_ = false; - dropUnknownFields_ = false; - state_ = 0; - useTableSchema_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_BigQueryConfig_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.BigQueryConfig getDefaultInstanceForType() { - return com.google.pubsub.v1.BigQueryConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.BigQueryConfig build() { - com.google.pubsub.v1.BigQueryConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.BigQueryConfig buildPartial() { - com.google.pubsub.v1.BigQueryConfig result = new com.google.pubsub.v1.BigQueryConfig(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.BigQueryConfig result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.table_ = table_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.useTopicSchema_ = useTopicSchema_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.writeMetadata_ = writeMetadata_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.dropUnknownFields_ = dropUnknownFields_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.state_ = state_; - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.useTableSchema_ = useTableSchema_; - } - } - - @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.BigQueryConfig) { - return mergeFrom((com.google.pubsub.v1.BigQueryConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.BigQueryConfig other) { - if (other == com.google.pubsub.v1.BigQueryConfig.getDefaultInstance()) return this; - if (!other.getTable().isEmpty()) { - table_ = other.table_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getUseTopicSchema() != false) { - setUseTopicSchema(other.getUseTopicSchema()); - } - if (other.getWriteMetadata() != false) { - setWriteMetadata(other.getWriteMetadata()); - } - if (other.getDropUnknownFields() != false) { - setDropUnknownFields(other.getDropUnknownFields()); - } - if (other.state_ != 0) { - setStateValue(other.getStateValue()); - } - if (other.getUseTableSchema() != false) { - setUseTableSchema(other.getUseTableSchema()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - table_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - useTopicSchema_ = input.readBool(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: - { - writeMetadata_ = input.readBool(); - bitField0_ |= 0x00000004; - break; - } // case 24 - case 32: - { - dropUnknownFields_ = input.readBool(); - bitField0_ |= 0x00000008; - break; - } // case 32 - case 40: - { - state_ = input.readEnum(); - bitField0_ |= 0x00000010; - break; - } // case 40 - case 48: - { - useTableSchema_ = input.readBool(); - bitField0_ |= 0x00000020; - break; - } // case 48 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object table_ = ""; - /** - * - * - *
-     * The name of the table to which to write data, of the form
-     * {projectId}.{datasetId}.{tableId}
-     * 
- * - * string table = 1; - * - * @return The table. - */ - public java.lang.String getTable() { - java.lang.Object ref = table_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - table_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The name of the table to which to write data, of the form
-     * {projectId}.{datasetId}.{tableId}
-     * 
- * - * string table = 1; - * - * @return The bytes for table. - */ - public com.google.protobuf.ByteString getTableBytes() { - java.lang.Object ref = table_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - table_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The name of the table to which to write data, of the form
-     * {projectId}.{datasetId}.{tableId}
-     * 
- * - * string table = 1; - * - * @param value The table to set. - * @return This builder for chaining. - */ - public Builder setTable(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - table_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the table to which to write data, of the form
-     * {projectId}.{datasetId}.{tableId}
-     * 
- * - * string table = 1; - * - * @return This builder for chaining. - */ - public Builder clearTable() { - table_ = getDefaultInstance().getTable(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the table to which to write data, of the form
-     * {projectId}.{datasetId}.{tableId}
-     * 
- * - * string table = 1; - * - * @param value The bytes for table to set. - * @return This builder for chaining. - */ - public Builder setTableBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - table_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private boolean useTopicSchema_; - /** - * - * - *
-     * Optional. When true, use the topic's schema as the columns to write to in
-     * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
-     * enabled at the same time.
-     * 
- * - * bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The useTopicSchema. - */ - @java.lang.Override - public boolean getUseTopicSchema() { - return useTopicSchema_; - } - /** - * - * - *
-     * Optional. When true, use the topic's schema as the columns to write to in
-     * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
-     * enabled at the same time.
-     * 
- * - * bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The useTopicSchema to set. - * @return This builder for chaining. - */ - public Builder setUseTopicSchema(boolean value) { - - useTopicSchema_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. When true, use the topic's schema as the columns to write to in
-     * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
-     * enabled at the same time.
-     * 
- * - * bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearUseTopicSchema() { - bitField0_ = (bitField0_ & ~0x00000002); - useTopicSchema_ = false; - onChanged(); - return this; - } - - private boolean writeMetadata_; - /** - * - * - *
-     * When true, write the subscription name, message_id, publish_time,
-     * attributes, and ordering_key to additional columns in the table. The
-     * subscription name, message_id, and publish_time fields are put in their own
-     * columns while all other message properties (other than data) are written to
-     * a JSON object in the attributes column.
-     * 
- * - * bool write_metadata = 3; - * - * @return The writeMetadata. - */ - @java.lang.Override - public boolean getWriteMetadata() { - return writeMetadata_; - } - /** - * - * - *
-     * When true, write the subscription name, message_id, publish_time,
-     * attributes, and ordering_key to additional columns in the table. The
-     * subscription name, message_id, and publish_time fields are put in their own
-     * columns while all other message properties (other than data) are written to
-     * a JSON object in the attributes column.
-     * 
- * - * bool write_metadata = 3; - * - * @param value The writeMetadata to set. - * @return This builder for chaining. - */ - public Builder setWriteMetadata(boolean value) { - - writeMetadata_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * When true, write the subscription name, message_id, publish_time,
-     * attributes, and ordering_key to additional columns in the table. The
-     * subscription name, message_id, and publish_time fields are put in their own
-     * columns while all other message properties (other than data) are written to
-     * a JSON object in the attributes column.
-     * 
- * - * bool write_metadata = 3; - * - * @return This builder for chaining. - */ - public Builder clearWriteMetadata() { - bitField0_ = (bitField0_ & ~0x00000004); - writeMetadata_ = false; - onChanged(); - return this; - } - - private boolean dropUnknownFields_; - /** - * - * - *
-     * When true and use_topic_schema is true, any fields that are a part of the
-     * topic schema that are not part of the BigQuery table schema are dropped
-     * when writing to BigQuery. Otherwise, the schemas must be kept in sync and
-     * any messages with extra fields are not written and remain in the
-     * subscription's backlog.
-     * 
- * - * bool drop_unknown_fields = 4; - * - * @return The dropUnknownFields. - */ - @java.lang.Override - public boolean getDropUnknownFields() { - return dropUnknownFields_; - } - /** - * - * - *
-     * When true and use_topic_schema is true, any fields that are a part of the
-     * topic schema that are not part of the BigQuery table schema are dropped
-     * when writing to BigQuery. Otherwise, the schemas must be kept in sync and
-     * any messages with extra fields are not written and remain in the
-     * subscription's backlog.
-     * 
- * - * bool drop_unknown_fields = 4; - * - * @param value The dropUnknownFields to set. - * @return This builder for chaining. - */ - public Builder setDropUnknownFields(boolean value) { - - dropUnknownFields_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * When true and use_topic_schema is true, any fields that are a part of the
-     * topic schema that are not part of the BigQuery table schema are dropped
-     * when writing to BigQuery. Otherwise, the schemas must be kept in sync and
-     * any messages with extra fields are not written and remain in the
-     * subscription's backlog.
-     * 
- * - * bool drop_unknown_fields = 4; - * - * @return This builder for chaining. - */ - public Builder clearDropUnknownFields() { - bitField0_ = (bitField0_ & ~0x00000008); - dropUnknownFields_ = false; - onChanged(); - return this; - } - - private int state_ = 0; - /** - * - * - *
-     * Output only. An output-only field that indicates whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for state. - */ - @java.lang.Override - public int getStateValue() { - return state_; - } - /** - * - * - *
-     * Output only. An output-only field that indicates whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The enum numeric value on the wire for state to set. - * @return This builder for chaining. - */ - public Builder setStateValue(int value) { - state_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. An output-only field that indicates whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The state. - */ - @java.lang.Override - public com.google.pubsub.v1.BigQueryConfig.State getState() { - com.google.pubsub.v1.BigQueryConfig.State result = - com.google.pubsub.v1.BigQueryConfig.State.forNumber(state_); - return result == null ? com.google.pubsub.v1.BigQueryConfig.State.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Output only. An output-only field that indicates whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The state to set. - * @return This builder for chaining. - */ - public Builder setState(com.google.pubsub.v1.BigQueryConfig.State value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - state_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. An output-only field that indicates whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return This builder for chaining. - */ - public Builder clearState() { - bitField0_ = (bitField0_ & ~0x00000010); - state_ = 0; - onChanged(); - return this; - } - - private boolean useTableSchema_; - /** - * - * - *
-     * Optional. When true, use the BigQuery table's schema as the columns to
-     * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
-     * enabled at the same time.
-     * 
- * - * bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The useTableSchema. - */ - @java.lang.Override - public boolean getUseTableSchema() { - return useTableSchema_; - } - /** - * - * - *
-     * Optional. When true, use the BigQuery table's schema as the columns to
-     * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
-     * enabled at the same time.
-     * 
- * - * bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The useTableSchema to set. - * @return This builder for chaining. - */ - public Builder setUseTableSchema(boolean value) { - - useTableSchema_ = value; - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. When true, use the BigQuery table's schema as the columns to
-     * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
-     * enabled at the same time.
-     * 
- * - * bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearUseTableSchema() { - bitField0_ = (bitField0_ & ~0x00000020); - useTableSchema_ = false; - 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.BigQueryConfig) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.BigQueryConfig) - private static final com.google.pubsub.v1.BigQueryConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.BigQueryConfig(); - } - - public static com.google.pubsub.v1.BigQueryConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BigQueryConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.BigQueryConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/BigQueryConfigOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/BigQueryConfigOrBuilder.java deleted file mode 100644 index bc805214f..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/BigQueryConfigOrBuilder.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2023 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 BigQueryConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.BigQueryConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The name of the table to which to write data, of the form
-   * {projectId}.{datasetId}.{tableId}
-   * 
- * - * string table = 1; - * - * @return The table. - */ - java.lang.String getTable(); - /** - * - * - *
-   * The name of the table to which to write data, of the form
-   * {projectId}.{datasetId}.{tableId}
-   * 
- * - * string table = 1; - * - * @return The bytes for table. - */ - com.google.protobuf.ByteString getTableBytes(); - - /** - * - * - *
-   * Optional. When true, use the topic's schema as the columns to write to in
-   * BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
-   * enabled at the same time.
-   * 
- * - * bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The useTopicSchema. - */ - boolean getUseTopicSchema(); - - /** - * - * - *
-   * When true, write the subscription name, message_id, publish_time,
-   * attributes, and ordering_key to additional columns in the table. The
-   * subscription name, message_id, and publish_time fields are put in their own
-   * columns while all other message properties (other than data) are written to
-   * a JSON object in the attributes column.
-   * 
- * - * bool write_metadata = 3; - * - * @return The writeMetadata. - */ - boolean getWriteMetadata(); - - /** - * - * - *
-   * When true and use_topic_schema is true, any fields that are a part of the
-   * topic schema that are not part of the BigQuery table schema are dropped
-   * when writing to BigQuery. Otherwise, the schemas must be kept in sync and
-   * any messages with extra fields are not written and remain in the
-   * subscription's backlog.
-   * 
- * - * bool drop_unknown_fields = 4; - * - * @return The dropUnknownFields. - */ - boolean getDropUnknownFields(); - - /** - * - * - *
-   * Output only. An output-only field that indicates whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for state. - */ - int getStateValue(); - /** - * - * - *
-   * Output only. An output-only field that indicates whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.BigQueryConfig.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The state. - */ - com.google.pubsub.v1.BigQueryConfig.State getState(); - - /** - * - * - *
-   * Optional. When true, use the BigQuery table's schema as the columns to
-   * write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
-   * enabled at the same time.
-   * 
- * - * bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The useTableSchema. - */ - boolean getUseTableSchema(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CloudStorageConfig.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CloudStorageConfig.java deleted file mode 100644 index a4532a62f..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CloudStorageConfig.java +++ /dev/null @@ -1,3428 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Configuration for a Cloud Storage subscription.
- * 
- * - * Protobuf type {@code google.pubsub.v1.CloudStorageConfig} - */ -public final class CloudStorageConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.CloudStorageConfig) - CloudStorageConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use CloudStorageConfig.newBuilder() to construct. - private CloudStorageConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CloudStorageConfig() { - bucket_ = ""; - filenamePrefix_ = ""; - filenameSuffix_ = ""; - state_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CloudStorageConfig(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.CloudStorageConfig.class, - com.google.pubsub.v1.CloudStorageConfig.Builder.class); - } - - /** - * - * - *
-   * Possible states for a Cloud Storage subscription.
-   * 
- * - * Protobuf enum {@code google.pubsub.v1.CloudStorageConfig.State} - */ - public enum State implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Default value. This value is unused.
-     * 
- * - * STATE_UNSPECIFIED = 0; - */ - STATE_UNSPECIFIED(0), - /** - * - * - *
-     * The subscription can actively send messages to Cloud Storage.
-     * 
- * - * ACTIVE = 1; - */ - ACTIVE(1), - /** - * - * - *
-     * Cannot write to the Cloud Storage bucket because of permission denied
-     * errors.
-     * 
- * - * PERMISSION_DENIED = 2; - */ - PERMISSION_DENIED(2), - /** - * - * - *
-     * Cannot write to the Cloud Storage bucket because it does not exist.
-     * 
- * - * NOT_FOUND = 3; - */ - NOT_FOUND(3), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Default value. This value is unused.
-     * 
- * - * STATE_UNSPECIFIED = 0; - */ - public static final int STATE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * The subscription can actively send messages to Cloud Storage.
-     * 
- * - * ACTIVE = 1; - */ - public static final int ACTIVE_VALUE = 1; - /** - * - * - *
-     * Cannot write to the Cloud Storage bucket because of permission denied
-     * errors.
-     * 
- * - * PERMISSION_DENIED = 2; - */ - public static final int PERMISSION_DENIED_VALUE = 2; - /** - * - * - *
-     * Cannot write to the Cloud Storage bucket because it does not exist.
-     * 
- * - * NOT_FOUND = 3; - */ - public static final int NOT_FOUND_VALUE = 3; - - 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 State 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 State forNumber(int value) { - switch (value) { - case 0: - return STATE_UNSPECIFIED; - case 1: - return ACTIVE; - case 2: - return PERMISSION_DENIED; - case 3: - return NOT_FOUND; - 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 State findValueByNumber(int number) { - return State.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.CloudStorageConfig.getDescriptor().getEnumTypes().get(0); - } - - private static final State[] VALUES = values(); - - public static State 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 State(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.pubsub.v1.CloudStorageConfig.State) - } - - public interface TextConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.CloudStorageConfig.TextConfig) - com.google.protobuf.MessageOrBuilder {} - /** - * - * - *
-   * Configuration for writing message data in text format.
-   * Message payloads will be written to files as raw text, separated by a
-   * newline.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.CloudStorageConfig.TextConfig} - */ - public static final class TextConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.CloudStorageConfig.TextConfig) - TextConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use TextConfig.newBuilder() to construct. - private TextConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private TextConfig() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new TextConfig(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.CloudStorageConfig.TextConfig.class, - com.google.pubsub.v1.CloudStorageConfig.TextConfig.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 { - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += getUnknownFields().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.CloudStorageConfig.TextConfig)) { - return super.equals(obj); - } - com.google.pubsub.v1.CloudStorageConfig.TextConfig other = - (com.google.pubsub.v1.CloudStorageConfig.TextConfig) obj; - - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.CloudStorageConfig.TextConfig parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CloudStorageConfig.TextConfig 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.CloudStorageConfig.TextConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CloudStorageConfig.TextConfig 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.CloudStorageConfig.TextConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CloudStorageConfig.TextConfig parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.CloudStorageConfig.TextConfig parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CloudStorageConfig.TextConfig 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.CloudStorageConfig.TextConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CloudStorageConfig.TextConfig 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.CloudStorageConfig.TextConfig parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CloudStorageConfig.TextConfig 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.CloudStorageConfig.TextConfig 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; - } - /** - * - * - *
-     * Configuration for writing message data in text format.
-     * Message payloads will be written to files as raw text, separated by a
-     * newline.
-     * 
- * - * Protobuf type {@code google.pubsub.v1.CloudStorageConfig.TextConfig} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.CloudStorageConfig.TextConfig) - com.google.pubsub.v1.CloudStorageConfig.TextConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.CloudStorageConfig.TextConfig.class, - com.google.pubsub.v1.CloudStorageConfig.TextConfig.Builder.class); - } - - // Construct using com.google.pubsub.v1.CloudStorageConfig.TextConfig.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @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.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.TextConfig getDefaultInstanceForType() { - return com.google.pubsub.v1.CloudStorageConfig.TextConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.TextConfig build() { - com.google.pubsub.v1.CloudStorageConfig.TextConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.TextConfig buildPartial() { - com.google.pubsub.v1.CloudStorageConfig.TextConfig result = - new com.google.pubsub.v1.CloudStorageConfig.TextConfig(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.CloudStorageConfig.TextConfig) { - return mergeFrom((com.google.pubsub.v1.CloudStorageConfig.TextConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.CloudStorageConfig.TextConfig other) { - if (other == com.google.pubsub.v1.CloudStorageConfig.TextConfig.getDefaultInstance()) - return this; - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - 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.CloudStorageConfig.TextConfig) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.CloudStorageConfig.TextConfig) - private static final com.google.pubsub.v1.CloudStorageConfig.TextConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.CloudStorageConfig.TextConfig(); - } - - public static com.google.pubsub.v1.CloudStorageConfig.TextConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TextConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.CloudStorageConfig.TextConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface AvroConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.CloudStorageConfig.AvroConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * When true, write the subscription name, message_id, publish_time,
-     * attributes, and ordering_key as additional fields in the output. The
-     * subscription name, message_id, and publish_time fields are put in their
-     * own fields while all other message properties other than data (for
-     * example, an ordering_key, if present) are added as entries in the
-     * attributes map.
-     * 
- * - * bool write_metadata = 1; - * - * @return The writeMetadata. - */ - boolean getWriteMetadata(); - } - /** - * - * - *
-   * Configuration for writing message data in Avro format.
-   * Message payloads and metadata will be written to files as an Avro binary.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.CloudStorageConfig.AvroConfig} - */ - public static final class AvroConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.CloudStorageConfig.AvroConfig) - AvroConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use AvroConfig.newBuilder() to construct. - private AvroConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AvroConfig() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AvroConfig(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_AvroConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_AvroConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.CloudStorageConfig.AvroConfig.class, - com.google.pubsub.v1.CloudStorageConfig.AvroConfig.Builder.class); - } - - public static final int WRITE_METADATA_FIELD_NUMBER = 1; - private boolean writeMetadata_ = false; - /** - * - * - *
-     * When true, write the subscription name, message_id, publish_time,
-     * attributes, and ordering_key as additional fields in the output. The
-     * subscription name, message_id, and publish_time fields are put in their
-     * own fields while all other message properties other than data (for
-     * example, an ordering_key, if present) are added as entries in the
-     * attributes map.
-     * 
- * - * bool write_metadata = 1; - * - * @return The writeMetadata. - */ - @java.lang.Override - public boolean getWriteMetadata() { - return writeMetadata_; - } - - 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 (writeMetadata_ != false) { - output.writeBool(1, writeMetadata_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (writeMetadata_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, writeMetadata_); - } - size += getUnknownFields().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.CloudStorageConfig.AvroConfig)) { - return super.equals(obj); - } - com.google.pubsub.v1.CloudStorageConfig.AvroConfig other = - (com.google.pubsub.v1.CloudStorageConfig.AvroConfig) obj; - - if (getWriteMetadata() != other.getWriteMetadata()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + WRITE_METADATA_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getWriteMetadata()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.CloudStorageConfig.AvroConfig parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CloudStorageConfig.AvroConfig 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.CloudStorageConfig.AvroConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CloudStorageConfig.AvroConfig 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.CloudStorageConfig.AvroConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CloudStorageConfig.AvroConfig parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.CloudStorageConfig.AvroConfig parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CloudStorageConfig.AvroConfig 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.CloudStorageConfig.AvroConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CloudStorageConfig.AvroConfig 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.CloudStorageConfig.AvroConfig parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CloudStorageConfig.AvroConfig 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.CloudStorageConfig.AvroConfig 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; - } - /** - * - * - *
-     * Configuration for writing message data in Avro format.
-     * Message payloads and metadata will be written to files as an Avro binary.
-     * 
- * - * Protobuf type {@code google.pubsub.v1.CloudStorageConfig.AvroConfig} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.CloudStorageConfig.AvroConfig) - com.google.pubsub.v1.CloudStorageConfig.AvroConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_AvroConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_AvroConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.CloudStorageConfig.AvroConfig.class, - com.google.pubsub.v1.CloudStorageConfig.AvroConfig.Builder.class); - } - - // Construct using com.google.pubsub.v1.CloudStorageConfig.AvroConfig.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - writeMetadata_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_AvroConfig_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.AvroConfig getDefaultInstanceForType() { - return com.google.pubsub.v1.CloudStorageConfig.AvroConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.AvroConfig build() { - com.google.pubsub.v1.CloudStorageConfig.AvroConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.AvroConfig buildPartial() { - com.google.pubsub.v1.CloudStorageConfig.AvroConfig result = - new com.google.pubsub.v1.CloudStorageConfig.AvroConfig(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.CloudStorageConfig.AvroConfig result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.writeMetadata_ = writeMetadata_; - } - } - - @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.CloudStorageConfig.AvroConfig) { - return mergeFrom((com.google.pubsub.v1.CloudStorageConfig.AvroConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.CloudStorageConfig.AvroConfig other) { - if (other == com.google.pubsub.v1.CloudStorageConfig.AvroConfig.getDefaultInstance()) - return this; - if (other.getWriteMetadata() != false) { - setWriteMetadata(other.getWriteMetadata()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - writeMetadata_ = input.readBool(); - bitField0_ |= 0x00000001; - break; - } // case 8 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private boolean writeMetadata_; - /** - * - * - *
-       * When true, write the subscription name, message_id, publish_time,
-       * attributes, and ordering_key as additional fields in the output. The
-       * subscription name, message_id, and publish_time fields are put in their
-       * own fields while all other message properties other than data (for
-       * example, an ordering_key, if present) are added as entries in the
-       * attributes map.
-       * 
- * - * bool write_metadata = 1; - * - * @return The writeMetadata. - */ - @java.lang.Override - public boolean getWriteMetadata() { - return writeMetadata_; - } - /** - * - * - *
-       * When true, write the subscription name, message_id, publish_time,
-       * attributes, and ordering_key as additional fields in the output. The
-       * subscription name, message_id, and publish_time fields are put in their
-       * own fields while all other message properties other than data (for
-       * example, an ordering_key, if present) are added as entries in the
-       * attributes map.
-       * 
- * - * bool write_metadata = 1; - * - * @param value The writeMetadata to set. - * @return This builder for chaining. - */ - public Builder setWriteMetadata(boolean value) { - - writeMetadata_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * When true, write the subscription name, message_id, publish_time,
-       * attributes, and ordering_key as additional fields in the output. The
-       * subscription name, message_id, and publish_time fields are put in their
-       * own fields while all other message properties other than data (for
-       * example, an ordering_key, if present) are added as entries in the
-       * attributes map.
-       * 
- * - * bool write_metadata = 1; - * - * @return This builder for chaining. - */ - public Builder clearWriteMetadata() { - bitField0_ = (bitField0_ & ~0x00000001); - writeMetadata_ = false; - 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.CloudStorageConfig.AvroConfig) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.CloudStorageConfig.AvroConfig) - private static final com.google.pubsub.v1.CloudStorageConfig.AvroConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.CloudStorageConfig.AvroConfig(); - } - - public static com.google.pubsub.v1.CloudStorageConfig.AvroConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AvroConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.CloudStorageConfig.AvroConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private int outputFormatCase_ = 0; - - @SuppressWarnings("serial") - private java.lang.Object outputFormat_; - - public enum OutputFormatCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - TEXT_CONFIG(4), - AVRO_CONFIG(5), - OUTPUTFORMAT_NOT_SET(0); - private final int value; - - private OutputFormatCase(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 OutputFormatCase valueOf(int value) { - return forNumber(value); - } - - public static OutputFormatCase forNumber(int value) { - switch (value) { - case 4: - return TEXT_CONFIG; - case 5: - return AVRO_CONFIG; - case 0: - return OUTPUTFORMAT_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public OutputFormatCase getOutputFormatCase() { - return OutputFormatCase.forNumber(outputFormatCase_); - } - - public static final int BUCKET_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object bucket_ = ""; - /** - * - * - *
-   * Required. User-provided name for the Cloud Storage bucket.
-   * The bucket must be created by the user. The bucket name must be without
-   * any prefix like "gs://". See the [bucket naming
-   * requirements] (https://cloud.google.com/storage/docs/buckets#naming).
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucket. - */ - @java.lang.Override - public java.lang.String getBucket() { - java.lang.Object ref = bucket_; - 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(); - bucket_ = s; - return s; - } - } - /** - * - * - *
-   * Required. User-provided name for the Cloud Storage bucket.
-   * The bucket must be created by the user. The bucket name must be without
-   * any prefix like "gs://". See the [bucket naming
-   * requirements] (https://cloud.google.com/storage/docs/buckets#naming).
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for bucket. - */ - @java.lang.Override - public com.google.protobuf.ByteString getBucketBytes() { - java.lang.Object ref = bucket_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILENAME_PREFIX_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object filenamePrefix_ = ""; - /** - * - * - *
-   * User-provided prefix for Cloud Storage filename. See the [object naming
-   * requirements](https://cloud.google.com/storage/docs/objects#naming).
-   * 
- * - * string filename_prefix = 2; - * - * @return The filenamePrefix. - */ - @java.lang.Override - public java.lang.String getFilenamePrefix() { - java.lang.Object ref = filenamePrefix_; - 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(); - filenamePrefix_ = s; - return s; - } - } - /** - * - * - *
-   * User-provided prefix for Cloud Storage filename. See the [object naming
-   * requirements](https://cloud.google.com/storage/docs/objects#naming).
-   * 
- * - * string filename_prefix = 2; - * - * @return The bytes for filenamePrefix. - */ - @java.lang.Override - public com.google.protobuf.ByteString getFilenamePrefixBytes() { - java.lang.Object ref = filenamePrefix_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filenamePrefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILENAME_SUFFIX_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object filenameSuffix_ = ""; - /** - * - * - *
-   * User-provided suffix for Cloud Storage filename. See the [object naming
-   * requirements](https://cloud.google.com/storage/docs/objects#naming). Must
-   * not end in "/".
-   * 
- * - * string filename_suffix = 3; - * - * @return The filenameSuffix. - */ - @java.lang.Override - public java.lang.String getFilenameSuffix() { - java.lang.Object ref = filenameSuffix_; - 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(); - filenameSuffix_ = s; - return s; - } - } - /** - * - * - *
-   * User-provided suffix for Cloud Storage filename. See the [object naming
-   * requirements](https://cloud.google.com/storage/docs/objects#naming). Must
-   * not end in "/".
-   * 
- * - * string filename_suffix = 3; - * - * @return The bytes for filenameSuffix. - */ - @java.lang.Override - public com.google.protobuf.ByteString getFilenameSuffixBytes() { - java.lang.Object ref = filenameSuffix_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filenameSuffix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TEXT_CONFIG_FIELD_NUMBER = 4; - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in text format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - * - * @return Whether the textConfig field is set. - */ - @java.lang.Override - public boolean hasTextConfig() { - return outputFormatCase_ == 4; - } - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in text format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - * - * @return The textConfig. - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.TextConfig getTextConfig() { - if (outputFormatCase_ == 4) { - return (com.google.pubsub.v1.CloudStorageConfig.TextConfig) outputFormat_; - } - return com.google.pubsub.v1.CloudStorageConfig.TextConfig.getDefaultInstance(); - } - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in text format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.TextConfigOrBuilder getTextConfigOrBuilder() { - if (outputFormatCase_ == 4) { - return (com.google.pubsub.v1.CloudStorageConfig.TextConfig) outputFormat_; - } - return com.google.pubsub.v1.CloudStorageConfig.TextConfig.getDefaultInstance(); - } - - public static final int AVRO_CONFIG_FIELD_NUMBER = 5; - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in Avro format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - * - * @return Whether the avroConfig field is set. - */ - @java.lang.Override - public boolean hasAvroConfig() { - return outputFormatCase_ == 5; - } - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in Avro format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - * - * @return The avroConfig. - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.AvroConfig getAvroConfig() { - if (outputFormatCase_ == 5) { - return (com.google.pubsub.v1.CloudStorageConfig.AvroConfig) outputFormat_; - } - return com.google.pubsub.v1.CloudStorageConfig.AvroConfig.getDefaultInstance(); - } - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in Avro format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.AvroConfigOrBuilder getAvroConfigOrBuilder() { - if (outputFormatCase_ == 5) { - return (com.google.pubsub.v1.CloudStorageConfig.AvroConfig) outputFormat_; - } - return com.google.pubsub.v1.CloudStorageConfig.AvroConfig.getDefaultInstance(); - } - - public static final int MAX_DURATION_FIELD_NUMBER = 6; - private com.google.protobuf.Duration maxDuration_; - /** - * - * - *
-   * The maximum duration that can elapse before a new Cloud Storage file is
-   * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-   * the subscription's acknowledgement deadline.
-   * 
- * - * .google.protobuf.Duration max_duration = 6; - * - * @return Whether the maxDuration field is set. - */ - @java.lang.Override - public boolean hasMaxDuration() { - return maxDuration_ != null; - } - /** - * - * - *
-   * The maximum duration that can elapse before a new Cloud Storage file is
-   * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-   * the subscription's acknowledgement deadline.
-   * 
- * - * .google.protobuf.Duration max_duration = 6; - * - * @return The maxDuration. - */ - @java.lang.Override - public com.google.protobuf.Duration getMaxDuration() { - return maxDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : maxDuration_; - } - /** - * - * - *
-   * The maximum duration that can elapse before a new Cloud Storage file is
-   * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-   * the subscription's acknowledgement deadline.
-   * 
- * - * .google.protobuf.Duration max_duration = 6; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getMaxDurationOrBuilder() { - return maxDuration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : maxDuration_; - } - - public static final int MAX_BYTES_FIELD_NUMBER = 7; - private long maxBytes_ = 0L; - /** - * - * - *
-   * The maximum bytes that can be written to a Cloud Storage file before a new
-   * file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded
-   * in cases where messages are larger than the limit.
-   * 
- * - * int64 max_bytes = 7; - * - * @return The maxBytes. - */ - @java.lang.Override - public long getMaxBytes() { - return maxBytes_; - } - - public static final int STATE_FIELD_NUMBER = 9; - private int state_ = 0; - /** - * - * - *
-   * Output only. An output-only field that indicates whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for state. - */ - @java.lang.Override - public int getStateValue() { - return state_; - } - /** - * - * - *
-   * Output only. An output-only field that indicates whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The state. - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.State getState() { - com.google.pubsub.v1.CloudStorageConfig.State result = - com.google.pubsub.v1.CloudStorageConfig.State.forNumber(state_); - return result == null ? com.google.pubsub.v1.CloudStorageConfig.State.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filenamePrefix_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filenamePrefix_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filenameSuffix_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filenameSuffix_); - } - if (outputFormatCase_ == 4) { - output.writeMessage(4, (com.google.pubsub.v1.CloudStorageConfig.TextConfig) outputFormat_); - } - if (outputFormatCase_ == 5) { - output.writeMessage(5, (com.google.pubsub.v1.CloudStorageConfig.AvroConfig) outputFormat_); - } - if (maxDuration_ != null) { - output.writeMessage(6, getMaxDuration()); - } - if (maxBytes_ != 0L) { - output.writeInt64(7, maxBytes_); - } - if (state_ != com.google.pubsub.v1.CloudStorageConfig.State.STATE_UNSPECIFIED.getNumber()) { - output.writeEnum(9, state_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filenamePrefix_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filenamePrefix_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filenameSuffix_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filenameSuffix_); - } - if (outputFormatCase_ == 4) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 4, (com.google.pubsub.v1.CloudStorageConfig.TextConfig) outputFormat_); - } - if (outputFormatCase_ == 5) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 5, (com.google.pubsub.v1.CloudStorageConfig.AvroConfig) outputFormat_); - } - if (maxDuration_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getMaxDuration()); - } - if (maxBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, maxBytes_); - } - if (state_ != com.google.pubsub.v1.CloudStorageConfig.State.STATE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, state_); - } - size += getUnknownFields().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.CloudStorageConfig)) { - return super.equals(obj); - } - com.google.pubsub.v1.CloudStorageConfig other = (com.google.pubsub.v1.CloudStorageConfig) obj; - - if (!getBucket().equals(other.getBucket())) return false; - if (!getFilenamePrefix().equals(other.getFilenamePrefix())) return false; - if (!getFilenameSuffix().equals(other.getFilenameSuffix())) return false; - if (hasMaxDuration() != other.hasMaxDuration()) return false; - if (hasMaxDuration()) { - if (!getMaxDuration().equals(other.getMaxDuration())) return false; - } - if (getMaxBytes() != other.getMaxBytes()) return false; - if (state_ != other.state_) return false; - if (!getOutputFormatCase().equals(other.getOutputFormatCase())) return false; - switch (outputFormatCase_) { - case 4: - if (!getTextConfig().equals(other.getTextConfig())) return false; - break; - case 5: - if (!getAvroConfig().equals(other.getAvroConfig())) return false; - break; - case 0: - default: - } - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getBucket().hashCode(); - hash = (37 * hash) + FILENAME_PREFIX_FIELD_NUMBER; - hash = (53 * hash) + getFilenamePrefix().hashCode(); - hash = (37 * hash) + FILENAME_SUFFIX_FIELD_NUMBER; - hash = (53 * hash) + getFilenameSuffix().hashCode(); - if (hasMaxDuration()) { - hash = (37 * hash) + MAX_DURATION_FIELD_NUMBER; - hash = (53 * hash) + getMaxDuration().hashCode(); - } - hash = (37 * hash) + MAX_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxBytes()); - hash = (37 * hash) + STATE_FIELD_NUMBER; - hash = (53 * hash) + state_; - switch (outputFormatCase_) { - case 4: - hash = (37 * hash) + TEXT_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getTextConfig().hashCode(); - break; - case 5: - hash = (37 * hash) + AVRO_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getAvroConfig().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.CloudStorageConfig parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CloudStorageConfig 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.CloudStorageConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CloudStorageConfig 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.CloudStorageConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CloudStorageConfig parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.CloudStorageConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CloudStorageConfig 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.CloudStorageConfig parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CloudStorageConfig 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.CloudStorageConfig parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CloudStorageConfig 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.CloudStorageConfig 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; - } - /** - * - * - *
-   * Configuration for a Cloud Storage subscription.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.CloudStorageConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.CloudStorageConfig) - com.google.pubsub.v1.CloudStorageConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.CloudStorageConfig.class, - com.google.pubsub.v1.CloudStorageConfig.Builder.class); - } - - // Construct using com.google.pubsub.v1.CloudStorageConfig.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - bucket_ = ""; - filenamePrefix_ = ""; - filenameSuffix_ = ""; - if (textConfigBuilder_ != null) { - textConfigBuilder_.clear(); - } - if (avroConfigBuilder_ != null) { - avroConfigBuilder_.clear(); - } - maxDuration_ = null; - if (maxDurationBuilder_ != null) { - maxDurationBuilder_.dispose(); - maxDurationBuilder_ = null; - } - maxBytes_ = 0L; - state_ = 0; - outputFormatCase_ = 0; - outputFormat_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CloudStorageConfig_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig getDefaultInstanceForType() { - return com.google.pubsub.v1.CloudStorageConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig build() { - com.google.pubsub.v1.CloudStorageConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig buildPartial() { - com.google.pubsub.v1.CloudStorageConfig result = - new com.google.pubsub.v1.CloudStorageConfig(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.CloudStorageConfig result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.bucket_ = bucket_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.filenamePrefix_ = filenamePrefix_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.filenameSuffix_ = filenameSuffix_; - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.maxDuration_ = - maxDurationBuilder_ == null ? maxDuration_ : maxDurationBuilder_.build(); - } - if (((from_bitField0_ & 0x00000040) != 0)) { - result.maxBytes_ = maxBytes_; - } - if (((from_bitField0_ & 0x00000080) != 0)) { - result.state_ = state_; - } - } - - private void buildPartialOneofs(com.google.pubsub.v1.CloudStorageConfig result) { - result.outputFormatCase_ = outputFormatCase_; - result.outputFormat_ = this.outputFormat_; - if (outputFormatCase_ == 4 && textConfigBuilder_ != null) { - result.outputFormat_ = textConfigBuilder_.build(); - } - if (outputFormatCase_ == 5 && avroConfigBuilder_ != null) { - result.outputFormat_ = avroConfigBuilder_.build(); - } - } - - @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.CloudStorageConfig) { - return mergeFrom((com.google.pubsub.v1.CloudStorageConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.CloudStorageConfig other) { - if (other == com.google.pubsub.v1.CloudStorageConfig.getDefaultInstance()) return this; - if (!other.getBucket().isEmpty()) { - bucket_ = other.bucket_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getFilenamePrefix().isEmpty()) { - filenamePrefix_ = other.filenamePrefix_; - bitField0_ |= 0x00000002; - onChanged(); - } - if (!other.getFilenameSuffix().isEmpty()) { - filenameSuffix_ = other.filenameSuffix_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (other.hasMaxDuration()) { - mergeMaxDuration(other.getMaxDuration()); - } - if (other.getMaxBytes() != 0L) { - setMaxBytes(other.getMaxBytes()); - } - if (other.state_ != 0) { - setStateValue(other.getStateValue()); - } - switch (other.getOutputFormatCase()) { - case TEXT_CONFIG: - { - mergeTextConfig(other.getTextConfig()); - break; - } - case AVRO_CONFIG: - { - mergeAvroConfig(other.getAvroConfig()); - break; - } - case OUTPUTFORMAT_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - bucket_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - filenamePrefix_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - filenameSuffix_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 34: - { - input.readMessage(getTextConfigFieldBuilder().getBuilder(), extensionRegistry); - outputFormatCase_ = 4; - break; - } // case 34 - case 42: - { - input.readMessage(getAvroConfigFieldBuilder().getBuilder(), extensionRegistry); - outputFormatCase_ = 5; - break; - } // case 42 - case 50: - { - input.readMessage(getMaxDurationFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000020; - break; - } // case 50 - case 56: - { - maxBytes_ = input.readInt64(); - bitField0_ |= 0x00000040; - break; - } // case 56 - case 72: - { - state_ = input.readEnum(); - bitField0_ |= 0x00000080; - break; - } // case 72 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int outputFormatCase_ = 0; - private java.lang.Object outputFormat_; - - public OutputFormatCase getOutputFormatCase() { - return OutputFormatCase.forNumber(outputFormatCase_); - } - - public Builder clearOutputFormat() { - outputFormatCase_ = 0; - outputFormat_ = null; - onChanged(); - return this; - } - - private int bitField0_; - - private java.lang.Object bucket_ = ""; - /** - * - * - *
-     * Required. User-provided name for the Cloud Storage bucket.
-     * The bucket must be created by the user. The bucket name must be without
-     * any prefix like "gs://". See the [bucket naming
-     * requirements] (https://cloud.google.com/storage/docs/buckets#naming).
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucket. - */ - public java.lang.String getBucket() { - java.lang.Object ref = bucket_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bucket_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. User-provided name for the Cloud Storage bucket.
-     * The bucket must be created by the user. The bucket name must be without
-     * any prefix like "gs://". See the [bucket naming
-     * requirements] (https://cloud.google.com/storage/docs/buckets#naming).
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for bucket. - */ - public com.google.protobuf.ByteString getBucketBytes() { - java.lang.Object ref = bucket_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - bucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. User-provided name for the Cloud Storage bucket.
-     * The bucket must be created by the user. The bucket name must be without
-     * any prefix like "gs://". See the [bucket naming
-     * requirements] (https://cloud.google.com/storage/docs/buckets#naming).
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bucket to set. - * @return This builder for chaining. - */ - public Builder setBucket(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bucket_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. User-provided name for the Cloud Storage bucket.
-     * The bucket must be created by the user. The bucket name must be without
-     * any prefix like "gs://". See the [bucket naming
-     * requirements] (https://cloud.google.com/storage/docs/buckets#naming).
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearBucket() { - bucket_ = getDefaultInstance().getBucket(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. User-provided name for the Cloud Storage bucket.
-     * The bucket must be created by the user. The bucket name must be without
-     * any prefix like "gs://". See the [bucket naming
-     * requirements] (https://cloud.google.com/storage/docs/buckets#naming).
-     * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for bucket to set. - * @return This builder for chaining. - */ - public Builder setBucketBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - bucket_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object filenamePrefix_ = ""; - /** - * - * - *
-     * User-provided prefix for Cloud Storage filename. See the [object naming
-     * requirements](https://cloud.google.com/storage/docs/objects#naming).
-     * 
- * - * string filename_prefix = 2; - * - * @return The filenamePrefix. - */ - public java.lang.String getFilenamePrefix() { - java.lang.Object ref = filenamePrefix_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filenamePrefix_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * User-provided prefix for Cloud Storage filename. See the [object naming
-     * requirements](https://cloud.google.com/storage/docs/objects#naming).
-     * 
- * - * string filename_prefix = 2; - * - * @return The bytes for filenamePrefix. - */ - public com.google.protobuf.ByteString getFilenamePrefixBytes() { - java.lang.Object ref = filenamePrefix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filenamePrefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * User-provided prefix for Cloud Storage filename. See the [object naming
-     * requirements](https://cloud.google.com/storage/docs/objects#naming).
-     * 
- * - * string filename_prefix = 2; - * - * @param value The filenamePrefix to set. - * @return This builder for chaining. - */ - public Builder setFilenamePrefix(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - filenamePrefix_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * User-provided prefix for Cloud Storage filename. See the [object naming
-     * requirements](https://cloud.google.com/storage/docs/objects#naming).
-     * 
- * - * string filename_prefix = 2; - * - * @return This builder for chaining. - */ - public Builder clearFilenamePrefix() { - filenamePrefix_ = getDefaultInstance().getFilenamePrefix(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * User-provided prefix for Cloud Storage filename. See the [object naming
-     * requirements](https://cloud.google.com/storage/docs/objects#naming).
-     * 
- * - * string filename_prefix = 2; - * - * @param value The bytes for filenamePrefix to set. - * @return This builder for chaining. - */ - public Builder setFilenamePrefixBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - filenamePrefix_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private java.lang.Object filenameSuffix_ = ""; - /** - * - * - *
-     * User-provided suffix for Cloud Storage filename. See the [object naming
-     * requirements](https://cloud.google.com/storage/docs/objects#naming). Must
-     * not end in "/".
-     * 
- * - * string filename_suffix = 3; - * - * @return The filenameSuffix. - */ - public java.lang.String getFilenameSuffix() { - java.lang.Object ref = filenameSuffix_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filenameSuffix_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * User-provided suffix for Cloud Storage filename. See the [object naming
-     * requirements](https://cloud.google.com/storage/docs/objects#naming). Must
-     * not end in "/".
-     * 
- * - * string filename_suffix = 3; - * - * @return The bytes for filenameSuffix. - */ - public com.google.protobuf.ByteString getFilenameSuffixBytes() { - java.lang.Object ref = filenameSuffix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filenameSuffix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * User-provided suffix for Cloud Storage filename. See the [object naming
-     * requirements](https://cloud.google.com/storage/docs/objects#naming). Must
-     * not end in "/".
-     * 
- * - * string filename_suffix = 3; - * - * @param value The filenameSuffix to set. - * @return This builder for chaining. - */ - public Builder setFilenameSuffix(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - filenameSuffix_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * User-provided suffix for Cloud Storage filename. See the [object naming
-     * requirements](https://cloud.google.com/storage/docs/objects#naming). Must
-     * not end in "/".
-     * 
- * - * string filename_suffix = 3; - * - * @return This builder for chaining. - */ - public Builder clearFilenameSuffix() { - filenameSuffix_ = getDefaultInstance().getFilenameSuffix(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-     * User-provided suffix for Cloud Storage filename. See the [object naming
-     * requirements](https://cloud.google.com/storage/docs/objects#naming). Must
-     * not end in "/".
-     * 
- * - * string filename_suffix = 3; - * - * @param value The bytes for filenameSuffix to set. - * @return This builder for chaining. - */ - public Builder setFilenameSuffixBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - filenameSuffix_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.CloudStorageConfig.TextConfig, - com.google.pubsub.v1.CloudStorageConfig.TextConfig.Builder, - com.google.pubsub.v1.CloudStorageConfig.TextConfigOrBuilder> - textConfigBuilder_; - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in text format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - * - * @return Whether the textConfig field is set. - */ - @java.lang.Override - public boolean hasTextConfig() { - return outputFormatCase_ == 4; - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in text format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - * - * @return The textConfig. - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.TextConfig getTextConfig() { - if (textConfigBuilder_ == null) { - if (outputFormatCase_ == 4) { - return (com.google.pubsub.v1.CloudStorageConfig.TextConfig) outputFormat_; - } - return com.google.pubsub.v1.CloudStorageConfig.TextConfig.getDefaultInstance(); - } else { - if (outputFormatCase_ == 4) { - return textConfigBuilder_.getMessage(); - } - return com.google.pubsub.v1.CloudStorageConfig.TextConfig.getDefaultInstance(); - } - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in text format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - */ - public Builder setTextConfig(com.google.pubsub.v1.CloudStorageConfig.TextConfig value) { - if (textConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - outputFormat_ = value; - onChanged(); - } else { - textConfigBuilder_.setMessage(value); - } - outputFormatCase_ = 4; - return this; - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in text format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - */ - public Builder setTextConfig( - com.google.pubsub.v1.CloudStorageConfig.TextConfig.Builder builderForValue) { - if (textConfigBuilder_ == null) { - outputFormat_ = builderForValue.build(); - onChanged(); - } else { - textConfigBuilder_.setMessage(builderForValue.build()); - } - outputFormatCase_ = 4; - return this; - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in text format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - */ - public Builder mergeTextConfig(com.google.pubsub.v1.CloudStorageConfig.TextConfig value) { - if (textConfigBuilder_ == null) { - if (outputFormatCase_ == 4 - && outputFormat_ - != com.google.pubsub.v1.CloudStorageConfig.TextConfig.getDefaultInstance()) { - outputFormat_ = - com.google.pubsub.v1.CloudStorageConfig.TextConfig.newBuilder( - (com.google.pubsub.v1.CloudStorageConfig.TextConfig) outputFormat_) - .mergeFrom(value) - .buildPartial(); - } else { - outputFormat_ = value; - } - onChanged(); - } else { - if (outputFormatCase_ == 4) { - textConfigBuilder_.mergeFrom(value); - } else { - textConfigBuilder_.setMessage(value); - } - } - outputFormatCase_ = 4; - return this; - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in text format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - */ - public Builder clearTextConfig() { - if (textConfigBuilder_ == null) { - if (outputFormatCase_ == 4) { - outputFormatCase_ = 0; - outputFormat_ = null; - onChanged(); - } - } else { - if (outputFormatCase_ == 4) { - outputFormatCase_ = 0; - outputFormat_ = null; - } - textConfigBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in text format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - */ - public com.google.pubsub.v1.CloudStorageConfig.TextConfig.Builder getTextConfigBuilder() { - return getTextConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in text format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.TextConfigOrBuilder getTextConfigOrBuilder() { - if ((outputFormatCase_ == 4) && (textConfigBuilder_ != null)) { - return textConfigBuilder_.getMessageOrBuilder(); - } else { - if (outputFormatCase_ == 4) { - return (com.google.pubsub.v1.CloudStorageConfig.TextConfig) outputFormat_; - } - return com.google.pubsub.v1.CloudStorageConfig.TextConfig.getDefaultInstance(); - } - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in text format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.CloudStorageConfig.TextConfig, - com.google.pubsub.v1.CloudStorageConfig.TextConfig.Builder, - com.google.pubsub.v1.CloudStorageConfig.TextConfigOrBuilder> - getTextConfigFieldBuilder() { - if (textConfigBuilder_ == null) { - if (!(outputFormatCase_ == 4)) { - outputFormat_ = com.google.pubsub.v1.CloudStorageConfig.TextConfig.getDefaultInstance(); - } - textConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.CloudStorageConfig.TextConfig, - com.google.pubsub.v1.CloudStorageConfig.TextConfig.Builder, - com.google.pubsub.v1.CloudStorageConfig.TextConfigOrBuilder>( - (com.google.pubsub.v1.CloudStorageConfig.TextConfig) outputFormat_, - getParentForChildren(), - isClean()); - outputFormat_ = null; - } - outputFormatCase_ = 4; - onChanged(); - return textConfigBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.CloudStorageConfig.AvroConfig, - com.google.pubsub.v1.CloudStorageConfig.AvroConfig.Builder, - com.google.pubsub.v1.CloudStorageConfig.AvroConfigOrBuilder> - avroConfigBuilder_; - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in Avro format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - * - * @return Whether the avroConfig field is set. - */ - @java.lang.Override - public boolean hasAvroConfig() { - return outputFormatCase_ == 5; - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in Avro format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - * - * @return The avroConfig. - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.AvroConfig getAvroConfig() { - if (avroConfigBuilder_ == null) { - if (outputFormatCase_ == 5) { - return (com.google.pubsub.v1.CloudStorageConfig.AvroConfig) outputFormat_; - } - return com.google.pubsub.v1.CloudStorageConfig.AvroConfig.getDefaultInstance(); - } else { - if (outputFormatCase_ == 5) { - return avroConfigBuilder_.getMessage(); - } - return com.google.pubsub.v1.CloudStorageConfig.AvroConfig.getDefaultInstance(); - } - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in Avro format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - */ - public Builder setAvroConfig(com.google.pubsub.v1.CloudStorageConfig.AvroConfig value) { - if (avroConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - outputFormat_ = value; - onChanged(); - } else { - avroConfigBuilder_.setMessage(value); - } - outputFormatCase_ = 5; - return this; - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in Avro format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - */ - public Builder setAvroConfig( - com.google.pubsub.v1.CloudStorageConfig.AvroConfig.Builder builderForValue) { - if (avroConfigBuilder_ == null) { - outputFormat_ = builderForValue.build(); - onChanged(); - } else { - avroConfigBuilder_.setMessage(builderForValue.build()); - } - outputFormatCase_ = 5; - return this; - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in Avro format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - */ - public Builder mergeAvroConfig(com.google.pubsub.v1.CloudStorageConfig.AvroConfig value) { - if (avroConfigBuilder_ == null) { - if (outputFormatCase_ == 5 - && outputFormat_ - != com.google.pubsub.v1.CloudStorageConfig.AvroConfig.getDefaultInstance()) { - outputFormat_ = - com.google.pubsub.v1.CloudStorageConfig.AvroConfig.newBuilder( - (com.google.pubsub.v1.CloudStorageConfig.AvroConfig) outputFormat_) - .mergeFrom(value) - .buildPartial(); - } else { - outputFormat_ = value; - } - onChanged(); - } else { - if (outputFormatCase_ == 5) { - avroConfigBuilder_.mergeFrom(value); - } else { - avroConfigBuilder_.setMessage(value); - } - } - outputFormatCase_ = 5; - return this; - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in Avro format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - */ - public Builder clearAvroConfig() { - if (avroConfigBuilder_ == null) { - if (outputFormatCase_ == 5) { - outputFormatCase_ = 0; - outputFormat_ = null; - onChanged(); - } - } else { - if (outputFormatCase_ == 5) { - outputFormatCase_ = 0; - outputFormat_ = null; - } - avroConfigBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in Avro format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - */ - public com.google.pubsub.v1.CloudStorageConfig.AvroConfig.Builder getAvroConfigBuilder() { - return getAvroConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in Avro format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.AvroConfigOrBuilder getAvroConfigOrBuilder() { - if ((outputFormatCase_ == 5) && (avroConfigBuilder_ != null)) { - return avroConfigBuilder_.getMessageOrBuilder(); - } else { - if (outputFormatCase_ == 5) { - return (com.google.pubsub.v1.CloudStorageConfig.AvroConfig) outputFormat_; - } - return com.google.pubsub.v1.CloudStorageConfig.AvroConfig.getDefaultInstance(); - } - } - /** - * - * - *
-     * If set, message data will be written to Cloud Storage in Avro format.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.CloudStorageConfig.AvroConfig, - com.google.pubsub.v1.CloudStorageConfig.AvroConfig.Builder, - com.google.pubsub.v1.CloudStorageConfig.AvroConfigOrBuilder> - getAvroConfigFieldBuilder() { - if (avroConfigBuilder_ == null) { - if (!(outputFormatCase_ == 5)) { - outputFormat_ = com.google.pubsub.v1.CloudStorageConfig.AvroConfig.getDefaultInstance(); - } - avroConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.CloudStorageConfig.AvroConfig, - com.google.pubsub.v1.CloudStorageConfig.AvroConfig.Builder, - com.google.pubsub.v1.CloudStorageConfig.AvroConfigOrBuilder>( - (com.google.pubsub.v1.CloudStorageConfig.AvroConfig) outputFormat_, - getParentForChildren(), - isClean()); - outputFormat_ = null; - } - outputFormatCase_ = 5; - onChanged(); - return avroConfigBuilder_; - } - - private com.google.protobuf.Duration maxDuration_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - maxDurationBuilder_; - /** - * - * - *
-     * The maximum duration that can elapse before a new Cloud Storage file is
-     * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-     * the subscription's acknowledgement deadline.
-     * 
- * - * .google.protobuf.Duration max_duration = 6; - * - * @return Whether the maxDuration field is set. - */ - public boolean hasMaxDuration() { - return ((bitField0_ & 0x00000020) != 0); - } - /** - * - * - *
-     * The maximum duration that can elapse before a new Cloud Storage file is
-     * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-     * the subscription's acknowledgement deadline.
-     * 
- * - * .google.protobuf.Duration max_duration = 6; - * - * @return The maxDuration. - */ - public com.google.protobuf.Duration getMaxDuration() { - if (maxDurationBuilder_ == null) { - return maxDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : maxDuration_; - } else { - return maxDurationBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The maximum duration that can elapse before a new Cloud Storage file is
-     * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-     * the subscription's acknowledgement deadline.
-     * 
- * - * .google.protobuf.Duration max_duration = 6; - */ - public Builder setMaxDuration(com.google.protobuf.Duration value) { - if (maxDurationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - maxDuration_ = value; - } else { - maxDurationBuilder_.setMessage(value); - } - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum duration that can elapse before a new Cloud Storage file is
-     * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-     * the subscription's acknowledgement deadline.
-     * 
- * - * .google.protobuf.Duration max_duration = 6; - */ - public Builder setMaxDuration(com.google.protobuf.Duration.Builder builderForValue) { - if (maxDurationBuilder_ == null) { - maxDuration_ = builderForValue.build(); - } else { - maxDurationBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum duration that can elapse before a new Cloud Storage file is
-     * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-     * the subscription's acknowledgement deadline.
-     * 
- * - * .google.protobuf.Duration max_duration = 6; - */ - public Builder mergeMaxDuration(com.google.protobuf.Duration value) { - if (maxDurationBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0) - && maxDuration_ != null - && maxDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { - getMaxDurationBuilder().mergeFrom(value); - } else { - maxDuration_ = value; - } - } else { - maxDurationBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum duration that can elapse before a new Cloud Storage file is
-     * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-     * the subscription's acknowledgement deadline.
-     * 
- * - * .google.protobuf.Duration max_duration = 6; - */ - public Builder clearMaxDuration() { - bitField0_ = (bitField0_ & ~0x00000020); - maxDuration_ = null; - if (maxDurationBuilder_ != null) { - maxDurationBuilder_.dispose(); - maxDurationBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum duration that can elapse before a new Cloud Storage file is
-     * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-     * the subscription's acknowledgement deadline.
-     * 
- * - * .google.protobuf.Duration max_duration = 6; - */ - public com.google.protobuf.Duration.Builder getMaxDurationBuilder() { - bitField0_ |= 0x00000020; - onChanged(); - return getMaxDurationFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The maximum duration that can elapse before a new Cloud Storage file is
-     * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-     * the subscription's acknowledgement deadline.
-     * 
- * - * .google.protobuf.Duration max_duration = 6; - */ - public com.google.protobuf.DurationOrBuilder getMaxDurationOrBuilder() { - if (maxDurationBuilder_ != null) { - return maxDurationBuilder_.getMessageOrBuilder(); - } else { - return maxDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : maxDuration_; - } - } - /** - * - * - *
-     * The maximum duration that can elapse before a new Cloud Storage file is
-     * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-     * the subscription's acknowledgement deadline.
-     * 
- * - * .google.protobuf.Duration max_duration = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getMaxDurationFieldBuilder() { - if (maxDurationBuilder_ == null) { - maxDurationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getMaxDuration(), getParentForChildren(), isClean()); - maxDuration_ = null; - } - return maxDurationBuilder_; - } - - private long maxBytes_; - /** - * - * - *
-     * The maximum bytes that can be written to a Cloud Storage file before a new
-     * file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded
-     * in cases where messages are larger than the limit.
-     * 
- * - * int64 max_bytes = 7; - * - * @return The maxBytes. - */ - @java.lang.Override - public long getMaxBytes() { - return maxBytes_; - } - /** - * - * - *
-     * The maximum bytes that can be written to a Cloud Storage file before a new
-     * file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded
-     * in cases where messages are larger than the limit.
-     * 
- * - * int64 max_bytes = 7; - * - * @param value The maxBytes to set. - * @return This builder for chaining. - */ - public Builder setMaxBytes(long value) { - - maxBytes_ = value; - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum bytes that can be written to a Cloud Storage file before a new
-     * file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded
-     * in cases where messages are larger than the limit.
-     * 
- * - * int64 max_bytes = 7; - * - * @return This builder for chaining. - */ - public Builder clearMaxBytes() { - bitField0_ = (bitField0_ & ~0x00000040); - maxBytes_ = 0L; - onChanged(); - return this; - } - - private int state_ = 0; - /** - * - * - *
-     * Output only. An output-only field that indicates whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for state. - */ - @java.lang.Override - public int getStateValue() { - return state_; - } - /** - * - * - *
-     * Output only. An output-only field that indicates whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The enum numeric value on the wire for state to set. - * @return This builder for chaining. - */ - public Builder setStateValue(int value) { - state_ = value; - bitField0_ |= 0x00000080; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. An output-only field that indicates whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The state. - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig.State getState() { - com.google.pubsub.v1.CloudStorageConfig.State result = - com.google.pubsub.v1.CloudStorageConfig.State.forNumber(state_); - return result == null ? com.google.pubsub.v1.CloudStorageConfig.State.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Output only. An output-only field that indicates whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The state to set. - * @return This builder for chaining. - */ - public Builder setState(com.google.pubsub.v1.CloudStorageConfig.State value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000080; - state_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. An output-only field that indicates whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return This builder for chaining. - */ - public Builder clearState() { - bitField0_ = (bitField0_ & ~0x00000080); - state_ = 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.CloudStorageConfig) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.CloudStorageConfig) - private static final com.google.pubsub.v1.CloudStorageConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.CloudStorageConfig(); - } - - public static com.google.pubsub.v1.CloudStorageConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CloudStorageConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.CloudStorageConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CloudStorageConfigOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CloudStorageConfigOrBuilder.java deleted file mode 100644 index 5122f804a..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CloudStorageConfigOrBuilder.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright 2023 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 CloudStorageConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.CloudStorageConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. User-provided name for the Cloud Storage bucket.
-   * The bucket must be created by the user. The bucket name must be without
-   * any prefix like "gs://". See the [bucket naming
-   * requirements] (https://cloud.google.com/storage/docs/buckets#naming).
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bucket. - */ - java.lang.String getBucket(); - /** - * - * - *
-   * Required. User-provided name for the Cloud Storage bucket.
-   * The bucket must be created by the user. The bucket name must be without
-   * any prefix like "gs://". See the [bucket naming
-   * requirements] (https://cloud.google.com/storage/docs/buckets#naming).
-   * 
- * - * string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for bucket. - */ - com.google.protobuf.ByteString getBucketBytes(); - - /** - * - * - *
-   * User-provided prefix for Cloud Storage filename. See the [object naming
-   * requirements](https://cloud.google.com/storage/docs/objects#naming).
-   * 
- * - * string filename_prefix = 2; - * - * @return The filenamePrefix. - */ - java.lang.String getFilenamePrefix(); - /** - * - * - *
-   * User-provided prefix for Cloud Storage filename. See the [object naming
-   * requirements](https://cloud.google.com/storage/docs/objects#naming).
-   * 
- * - * string filename_prefix = 2; - * - * @return The bytes for filenamePrefix. - */ - com.google.protobuf.ByteString getFilenamePrefixBytes(); - - /** - * - * - *
-   * User-provided suffix for Cloud Storage filename. See the [object naming
-   * requirements](https://cloud.google.com/storage/docs/objects#naming). Must
-   * not end in "/".
-   * 
- * - * string filename_suffix = 3; - * - * @return The filenameSuffix. - */ - java.lang.String getFilenameSuffix(); - /** - * - * - *
-   * User-provided suffix for Cloud Storage filename. See the [object naming
-   * requirements](https://cloud.google.com/storage/docs/objects#naming). Must
-   * not end in "/".
-   * 
- * - * string filename_suffix = 3; - * - * @return The bytes for filenameSuffix. - */ - com.google.protobuf.ByteString getFilenameSuffixBytes(); - - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in text format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - * - * @return Whether the textConfig field is set. - */ - boolean hasTextConfig(); - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in text format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - * - * @return The textConfig. - */ - com.google.pubsub.v1.CloudStorageConfig.TextConfig getTextConfig(); - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in text format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.TextConfig text_config = 4; - */ - com.google.pubsub.v1.CloudStorageConfig.TextConfigOrBuilder getTextConfigOrBuilder(); - - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in Avro format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - * - * @return Whether the avroConfig field is set. - */ - boolean hasAvroConfig(); - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in Avro format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - * - * @return The avroConfig. - */ - com.google.pubsub.v1.CloudStorageConfig.AvroConfig getAvroConfig(); - /** - * - * - *
-   * If set, message data will be written to Cloud Storage in Avro format.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig.AvroConfig avro_config = 5; - */ - com.google.pubsub.v1.CloudStorageConfig.AvroConfigOrBuilder getAvroConfigOrBuilder(); - - /** - * - * - *
-   * The maximum duration that can elapse before a new Cloud Storage file is
-   * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-   * the subscription's acknowledgement deadline.
-   * 
- * - * .google.protobuf.Duration max_duration = 6; - * - * @return Whether the maxDuration field is set. - */ - boolean hasMaxDuration(); - /** - * - * - *
-   * The maximum duration that can elapse before a new Cloud Storage file is
-   * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-   * the subscription's acknowledgement deadline.
-   * 
- * - * .google.protobuf.Duration max_duration = 6; - * - * @return The maxDuration. - */ - com.google.protobuf.Duration getMaxDuration(); - /** - * - * - *
-   * The maximum duration that can elapse before a new Cloud Storage file is
-   * created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
-   * the subscription's acknowledgement deadline.
-   * 
- * - * .google.protobuf.Duration max_duration = 6; - */ - com.google.protobuf.DurationOrBuilder getMaxDurationOrBuilder(); - - /** - * - * - *
-   * The maximum bytes that can be written to a Cloud Storage file before a new
-   * file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded
-   * in cases where messages are larger than the limit.
-   * 
- * - * int64 max_bytes = 7; - * - * @return The maxBytes. - */ - long getMaxBytes(); - - /** - * - * - *
-   * Output only. An output-only field that indicates whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for state. - */ - int getStateValue(); - /** - * - * - *
-   * Output only. An output-only field that indicates whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.CloudStorageConfig.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The state. - */ - com.google.pubsub.v1.CloudStorageConfig.State getState(); - - com.google.pubsub.v1.CloudStorageConfig.OutputFormatCase getOutputFormatCase(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CommitSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CommitSchemaRequest.java deleted file mode 100644 index ba816deeb..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CommitSchemaRequest.java +++ /dev/null @@ -1,899 +0,0 @@ -/* - * Copyright 2023 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 CommitSchema method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.CommitSchemaRequest} - */ -public final class CommitSchemaRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.CommitSchemaRequest) - CommitSchemaRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use CommitSchemaRequest.newBuilder() to construct. - private CommitSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CommitSchemaRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CommitSchemaRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_CommitSchemaRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_CommitSchemaRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.CommitSchemaRequest.class, - com.google.pubsub.v1.CommitSchemaRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * Required. The name of the schema we are revising.
-   * 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 we are revising.
-   * 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 SCHEMA_FIELD_NUMBER = 2; - private com.google.pubsub.v1.Schema schema_; - /** - * - * - *
-   * Required. The schema revision to commit.
-   * 
- * - * .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 revision to commit.
-   * 
- * - * .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 revision to commit.
-   * 
- * - * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.pubsub.v1.SchemaOrBuilder getSchemaOrBuilder() { - return schema_ == null ? com.google.pubsub.v1.Schema.getDefaultInstance() : schema_; - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (schema_ != null) { - output.writeMessage(2, getSchema()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (schema_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSchema()); - } - size += getUnknownFields().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.CommitSchemaRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.CommitSchemaRequest other = (com.google.pubsub.v1.CommitSchemaRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (hasSchema() != other.hasSchema()) return false; - if (hasSchema()) { - if (!getSchema().equals(other.getSchema())) return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) 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(); - if (hasSchema()) { - hash = (37 * hash) + SCHEMA_FIELD_NUMBER; - hash = (53 * hash) + getSchema().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.CommitSchemaRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CommitSchemaRequest 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.CommitSchemaRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CommitSchemaRequest 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.CommitSchemaRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CommitSchemaRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.CommitSchemaRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CommitSchemaRequest 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.CommitSchemaRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CommitSchemaRequest 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.CommitSchemaRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CommitSchemaRequest 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.CommitSchemaRequest 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 CommitSchema method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.CommitSchemaRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.CommitSchemaRequest) - com.google.pubsub.v1.CommitSchemaRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_CommitSchemaRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_CommitSchemaRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.CommitSchemaRequest.class, - com.google.pubsub.v1.CommitSchemaRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.CommitSchemaRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - schema_ = null; - if (schemaBuilder_ != null) { - schemaBuilder_.dispose(); - 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_CommitSchemaRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.CommitSchemaRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.CommitSchemaRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.CommitSchemaRequest build() { - com.google.pubsub.v1.CommitSchemaRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.CommitSchemaRequest buildPartial() { - com.google.pubsub.v1.CommitSchemaRequest result = - new com.google.pubsub.v1.CommitSchemaRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.CommitSchemaRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.schema_ = schemaBuilder_ == null ? schema_ : schemaBuilder_.build(); - } - } - - @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.CommitSchemaRequest) { - return mergeFrom((com.google.pubsub.v1.CommitSchemaRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.CommitSchemaRequest other) { - if (other == com.google.pubsub.v1.CommitSchemaRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.hasSchema()) { - mergeSchema(other.getSchema()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getSchemaFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The name of the schema we are revising.
-     * 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 we are revising.
-     * 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 we are revising.
-     * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the schema we are revising.
-     * 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(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the schema we are revising.
-     * 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; - bitField0_ |= 0x00000001; - 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 revision to commit.
-     * 
- * - * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return Whether the schema field is set. - */ - public boolean hasSchema() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * Required. The schema revision to commit.
-     * 
- * - * .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 revision to commit.
-     * 
- * - * .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; - } else { - schemaBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The schema revision to commit.
-     * 
- * - * .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(); - } else { - schemaBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The schema revision to commit.
-     * 
- * - * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeSchema(com.google.pubsub.v1.Schema value) { - if (schemaBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) - && schema_ != null - && schema_ != com.google.pubsub.v1.Schema.getDefaultInstance()) { - getSchemaBuilder().mergeFrom(value); - } else { - schema_ = value; - } - } else { - schemaBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The schema revision to commit.
-     * 
- * - * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearSchema() { - bitField0_ = (bitField0_ & ~0x00000002); - schema_ = null; - if (schemaBuilder_ != null) { - schemaBuilder_.dispose(); - schemaBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The schema revision to commit.
-     * 
- * - * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.pubsub.v1.Schema.Builder getSchemaBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getSchemaFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The schema revision to commit.
-     * 
- * - * .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 revision to commit.
-     * 
- * - * .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.CommitSchemaRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.CommitSchemaRequest) - private static final com.google.pubsub.v1.CommitSchemaRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.CommitSchemaRequest(); - } - - public static com.google.pubsub.v1.CommitSchemaRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CommitSchemaRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.CommitSchemaRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CommitSchemaRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CommitSchemaRequestOrBuilder.java deleted file mode 100644 index 7ac207df8..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CommitSchemaRequestOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2023 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 CommitSchemaRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.CommitSchemaRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the schema we are revising.
-   * 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 we are revising.
-   * 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(); - - /** - * - * - *
-   * Required. The schema revision to commit.
-   * 
- * - * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return Whether the schema field is set. - */ - boolean hasSchema(); - /** - * - * - *
-   * Required. The schema revision to commit.
-   * 
- * - * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The schema. - */ - com.google.pubsub.v1.Schema getSchema(); - /** - * - * - *
-   * Required. The schema revision to commit.
-   * 
- * - * .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/CreateSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequest.java deleted file mode 100644 index 82fe63cea..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequest.java +++ /dev/null @@ -1,1157 +0,0 @@ -/* - * Copyright 2023 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(); - } - - 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; - - @SuppressWarnings("serial") - 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 schema_ == null ? com.google.pubsub.v1.Schema.getDefaultInstance() : schema_; - } - - public static final int SCHEMA_ID_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (schema_ != null) { - output.writeMessage(2, getSchema()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, schemaId_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (schema_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSchema()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, schemaId_); - } - size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - parent_ = ""; - schema_ = null; - if (schemaBuilder_ != null) { - schemaBuilder_.dispose(); - 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); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.CreateSchemaRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.parent_ = parent_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.schema_ = schemaBuilder_ == null ? schema_ : schemaBuilder_.build(); - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.schemaId_ = schemaId_; - } - } - - @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_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.hasSchema()) { - mergeSchema(other.getSchema()); - } - if (!other.getSchemaId().isEmpty()) { - schemaId_ = other.schemaId_; - bitField0_ |= 0x00000004; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - parent_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getSchemaFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - schemaId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - 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; - bitField0_ |= 0x00000001; - 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(); - bitField0_ = (bitField0_ & ~0x00000001); - 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; - bitField0_ |= 0x00000001; - 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 ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * 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; - } else { - schemaBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - 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(); - } else { - schemaBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - 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 (((bitField0_ & 0x00000002) != 0) - && schema_ != null - && schema_ != com.google.pubsub.v1.Schema.getDefaultInstance()) { - getSchemaBuilder().mergeFrom(value); - } else { - schema_ = value; - } - } else { - schemaBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - onChanged(); - 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() { - bitField0_ = (bitField0_ & ~0x00000002); - schema_ = null; - if (schemaBuilder_ != null) { - schemaBuilder_.dispose(); - schemaBuilder_ = null; - } - onChanged(); - 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() { - bitField0_ |= 0x00000002; - 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; - bitField0_ |= 0x00000004; - 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(); - bitField0_ = (bitField0_ & ~0x00000004); - 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; - bitField0_ |= 0x00000004; - 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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index c4cc82962..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequestOrBuilder.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2023 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/CreateSnapshotRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequest.java deleted file mode 100644 index 3918f5ca6..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequest.java +++ /dev/null @@ -1,1267 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `CreateSnapshot` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.CreateSnapshotRequest} - */ -public final class CreateSnapshotRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.CreateSnapshotRequest) - CreateSnapshotRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use CreateSnapshotRequest.newBuilder() to construct. - private CreateSnapshotRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CreateSnapshotRequest() { - name_ = ""; - subscription_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateSnapshotRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 3: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CreateSnapshotRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.CreateSnapshotRequest.class, - com.google.pubsub.v1.CreateSnapshotRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * Required. User-provided name for this snapshot. If the name is not provided
-   * in the request, the server will assign a random name for this snapshot on
-   * the same project as the subscription. Note that for REST API requests, you
-   * must specify a name.  See the [resource name
-   * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * 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. User-provided name for this snapshot. If the name is not provided
-   * in the request, the server will assign a random name for this snapshot on
-   * the same project as the subscription. Note that for REST API requests, you
-   * must specify a name.  See the [resource name
-   * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * 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 SUBSCRIPTION_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object subscription_ = ""; - /** - * - * - *
-   * Required. The subscription whose backlog the snapshot retains.
-   * Specifically, the created snapshot is guaranteed to retain:
-   *  (a) The existing backlog on the subscription. More precisely, this is
-   *      defined as the messages in the subscription's backlog that are
-   *      unacknowledged upon the successful completion of the
-   *      `CreateSnapshot` request; as well as:
-   *  (b) Any messages published to the subscription's topic following the
-   *      successful completion of the CreateSnapshot request.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - @java.lang.Override - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - 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(); - subscription_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The subscription whose backlog the snapshot retains.
-   * Specifically, the created snapshot is guaranteed to retain:
-   *  (a) The existing backlog on the subscription. More precisely, this is
-   *      defined as the messages in the subscription's backlog that are
-   *      unacknowledged upon the successful completion of the
-   *      `CreateSnapshot` request; as well as:
-   *  (b) Any messages published to the subscription's topic following the
-   *      successful completion of the CreateSnapshot request.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LABELS_FIELD_NUMBER = 3; - - private static final class LabelsDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CreateSnapshotRequest_LabelsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - @SuppressWarnings("serial") - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 3; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 3; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 3; - */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 3; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subscription_); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 3); - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subscription_); - } - for (java.util.Map.Entry entry : - internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry labels__ = - LabelsDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, labels__); - } - size += getUnknownFields().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.CreateSnapshotRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.CreateSnapshotRequest other = - (com.google.pubsub.v1.CreateSnapshotRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (!getSubscription().equals(other.getSubscription())) return false; - if (!internalGetLabels().equals(other.internalGetLabels())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - if (!internalGetLabels().getMap().isEmpty()) { - hash = (37 * hash) + LABELS_FIELD_NUMBER; - hash = (53 * hash) + internalGetLabels().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.CreateSnapshotRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CreateSnapshotRequest 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.CreateSnapshotRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CreateSnapshotRequest 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.CreateSnapshotRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.CreateSnapshotRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.CreateSnapshotRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CreateSnapshotRequest 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.CreateSnapshotRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CreateSnapshotRequest 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.CreateSnapshotRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.CreateSnapshotRequest 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.CreateSnapshotRequest 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 `CreateSnapshot` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.CreateSnapshotRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.CreateSnapshotRequest) - com.google.pubsub.v1.CreateSnapshotRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 3: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 3: - return internalGetMutableLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CreateSnapshotRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.CreateSnapshotRequest.class, - com.google.pubsub.v1.CreateSnapshotRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.CreateSnapshotRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - subscription_ = ""; - internalGetMutableLabels().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.CreateSnapshotRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.CreateSnapshotRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.CreateSnapshotRequest build() { - com.google.pubsub.v1.CreateSnapshotRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.CreateSnapshotRequest buildPartial() { - com.google.pubsub.v1.CreateSnapshotRequest result = - new com.google.pubsub.v1.CreateSnapshotRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.CreateSnapshotRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.subscription_ = subscription_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - } - } - - @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.CreateSnapshotRequest) { - return mergeFrom((com.google.pubsub.v1.CreateSnapshotRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.CreateSnapshotRequest other) { - if (other == com.google.pubsub.v1.CreateSnapshotRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getSubscription().isEmpty()) { - subscription_ = other.subscription_; - bitField0_ |= 0x00000002; - onChanged(); - } - internalGetMutableLabels().mergeFrom(other.internalGetLabels()); - bitField0_ |= 0x00000004; - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - subscription_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - com.google.protobuf.MapEntry labels__ = - input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableLabels() - .getMutableMap() - .put(labels__.getKey(), labels__.getValue()); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. User-provided name for this snapshot. If the name is not provided
-     * in the request, the server will assign a random name for this snapshot on
-     * the same project as the subscription. Note that for REST API requests, you
-     * must specify a name.  See the [resource name
-     * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * 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. User-provided name for this snapshot. If the name is not provided
-     * in the request, the server will assign a random name for this snapshot on
-     * the same project as the subscription. Note that for REST API requests, you
-     * must specify a name.  See the [resource name
-     * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * 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. User-provided name for this snapshot. If the name is not provided
-     * in the request, the server will assign a random name for this snapshot on
-     * the same project as the subscription. Note that for REST API requests, you
-     * must specify a name.  See the [resource name
-     * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. User-provided name for this snapshot. If the name is not provided
-     * in the request, the server will assign a random name for this snapshot on
-     * the same project as the subscription. Note that for REST API requests, you
-     * must specify a name.  See the [resource name
-     * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. User-provided name for this snapshot. If the name is not provided
-     * in the request, the server will assign a random name for this snapshot on
-     * the same project as the subscription. Note that for REST API requests, you
-     * must specify a name.  See the [resource name
-     * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object subscription_ = ""; - /** - * - * - *
-     * Required. The subscription whose backlog the snapshot retains.
-     * Specifically, the created snapshot is guaranteed to retain:
-     *  (a) The existing backlog on the subscription. More precisely, this is
-     *      defined as the messages in the subscription's backlog that are
-     *      unacknowledged upon the successful completion of the
-     *      `CreateSnapshot` request; as well as:
-     *  (b) Any messages published to the subscription's topic following the
-     *      successful completion of the CreateSnapshot request.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The subscription whose backlog the snapshot retains.
-     * Specifically, the created snapshot is guaranteed to retain:
-     *  (a) The existing backlog on the subscription. More precisely, this is
-     *      defined as the messages in the subscription's backlog that are
-     *      unacknowledged upon the successful completion of the
-     *      `CreateSnapshot` request; as well as:
-     *  (b) Any messages published to the subscription's topic following the
-     *      successful completion of the CreateSnapshot request.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The subscription whose backlog the snapshot retains.
-     * Specifically, the created snapshot is guaranteed to retain:
-     *  (a) The existing backlog on the subscription. More precisely, this is
-     *      defined as the messages in the subscription's backlog that are
-     *      unacknowledged upon the successful completion of the
-     *      `CreateSnapshot` request; as well as:
-     *  (b) Any messages published to the subscription's topic following the
-     *      successful completion of the CreateSnapshot request.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription whose backlog the snapshot retains.
-     * Specifically, the created snapshot is guaranteed to retain:
-     *  (a) The existing backlog on the subscription. More precisely, this is
-     *      defined as the messages in the subscription's backlog that are
-     *      unacknowledged upon the successful completion of the
-     *      `CreateSnapshot` request; as well as:
-     *  (b) Any messages published to the subscription's topic following the
-     *      successful completion of the CreateSnapshot request.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSubscription() { - subscription_ = getDefaultInstance().getSubscription(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription whose backlog the snapshot retains.
-     * Specifically, the created snapshot is guaranteed to retain:
-     *  (a) The existing backlog on the subscription. More precisely, this is
-     *      defined as the messages in the subscription's backlog that are
-     *      unacknowledged upon the successful completion of the
-     *      `CreateSnapshot` request; as well as:
-     *  (b) Any messages published to the subscription's topic following the
-     *      successful completion of the CreateSnapshot request.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - subscription_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - private com.google.protobuf.MapField - internalGetMutableLabels() { - if (labels_ == null) { - labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - } - if (!labels_.isMutable()) { - labels_ = labels_.copy(); - } - bitField0_ |= 0x00000004; - onChanged(); - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 3; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 3; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 3; - */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 3; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearLabels() { - bitField0_ = (bitField0_ & ~0x00000004); - internalGetMutableLabels().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 3; - */ - public Builder removeLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableLabels().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableLabels() { - bitField0_ |= 0x00000004; - return internalGetMutableLabels().getMutableMap(); - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 3; - */ - public Builder putLabels(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new NullPointerException("map key"); - } - if (value == null) { - throw new NullPointerException("map value"); - } - internalGetMutableLabels().getMutableMap().put(key, value); - bitField0_ |= 0x00000004; - return this; - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 3; - */ - public Builder putAllLabels(java.util.Map values) { - internalGetMutableLabels().getMutableMap().putAll(values); - bitField0_ |= 0x00000004; - 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.CreateSnapshotRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.CreateSnapshotRequest) - private static final com.google.pubsub.v1.CreateSnapshotRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.CreateSnapshotRequest(); - } - - public static com.google.pubsub.v1.CreateSnapshotRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateSnapshotRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.CreateSnapshotRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequestOrBuilder.java deleted file mode 100644 index ee4a6d68f..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequestOrBuilder.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2023 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 CreateSnapshotRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.CreateSnapshotRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. User-provided name for this snapshot. If the name is not provided
-   * in the request, the server will assign a random name for this snapshot on
-   * the same project as the subscription. Note that for REST API requests, you
-   * must specify a name.  See the [resource name
-   * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. User-provided name for this snapshot. If the name is not provided
-   * in the request, the server will assign a random name for this snapshot on
-   * the same project as the subscription. Note that for REST API requests, you
-   * must specify a name.  See the [resource name
-   * rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Required. The subscription whose backlog the snapshot retains.
-   * Specifically, the created snapshot is guaranteed to retain:
-   *  (a) The existing backlog on the subscription. More precisely, this is
-   *      defined as the messages in the subscription's backlog that are
-   *      unacknowledged upon the successful completion of the
-   *      `CreateSnapshot` request; as well as:
-   *  (b) Any messages published to the subscription's topic following the
-   *      successful completion of the CreateSnapshot request.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - java.lang.String getSubscription(); - /** - * - * - *
-   * Required. The subscription whose backlog the snapshot retains.
-   * Specifically, the created snapshot is guaranteed to retain:
-   *  (a) The existing backlog on the subscription. More precisely, this is
-   *      defined as the messages in the subscription's backlog that are
-   *      unacknowledged upon the successful completion of the
-   *      `CreateSnapshot` request; as well as:
-   *  (b) Any messages published to the subscription's topic following the
-   *      successful completion of the CreateSnapshot request.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - com.google.protobuf.ByteString getSubscriptionBytes(); - - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 3; - */ - int getLabelsCount(); - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 3; - */ - boolean containsLabels(java.lang.String key); - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Deprecated - java.util.Map getLabels(); - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 3; - */ - java.util.Map getLabelsMap(); - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 3; - */ - /* nullable */ - java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue); - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 3; - */ - java.lang.String getLabelsOrThrow(java.lang.String key); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicy.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicy.java deleted file mode 100644 index 08f316b30..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicy.java +++ /dev/null @@ -1,826 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Dead lettering is done on a best effort basis. The same message might be
- * dead lettered multiple times.
- *
- * If validation on any of the fields fails at subscription creation/updation,
- * the create/update subscription request will fail.
- * 
- * - * Protobuf type {@code google.pubsub.v1.DeadLetterPolicy} - */ -public final class DeadLetterPolicy extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.DeadLetterPolicy) - DeadLetterPolicyOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeadLetterPolicy.newBuilder() to construct. - private DeadLetterPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeadLetterPolicy() { - deadLetterTopic_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeadLetterPolicy(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeadLetterPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DeadLetterPolicy.class, - com.google.pubsub.v1.DeadLetterPolicy.Builder.class); - } - - public static final int DEAD_LETTER_TOPIC_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object deadLetterTopic_ = ""; - /** - * - * - *
-   * The name of the topic to which dead letter messages should be published.
-   * Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
-   * account associated with the enclosing subscription's parent project (i.e.,
-   * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-   * permission to Publish() to this topic.
-   *
-   * The operation will fail if the topic does not exist.
-   * Users should ensure that there is a subscription attached to this topic
-   * since messages published to a topic with no subscriptions are lost.
-   * 
- * - * string dead_letter_topic = 1; - * - * @return The deadLetterTopic. - */ - @java.lang.Override - public java.lang.String getDeadLetterTopic() { - java.lang.Object ref = deadLetterTopic_; - 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(); - deadLetterTopic_ = s; - return s; - } - } - /** - * - * - *
-   * The name of the topic to which dead letter messages should be published.
-   * Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
-   * account associated with the enclosing subscription's parent project (i.e.,
-   * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-   * permission to Publish() to this topic.
-   *
-   * The operation will fail if the topic does not exist.
-   * Users should ensure that there is a subscription attached to this topic
-   * since messages published to a topic with no subscriptions are lost.
-   * 
- * - * string dead_letter_topic = 1; - * - * @return The bytes for deadLetterTopic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDeadLetterTopicBytes() { - java.lang.Object ref = deadLetterTopic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - deadLetterTopic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MAX_DELIVERY_ATTEMPTS_FIELD_NUMBER = 2; - private int maxDeliveryAttempts_ = 0; - /** - * - * - *
-   * The maximum number of delivery attempts for any message. The value must be
-   * between 5 and 100.
-   *
-   * The number of delivery attempts is defined as 1 + (the sum of number of
-   * NACKs and number of times the acknowledgement deadline has been exceeded
-   * for the message).
-   *
-   * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
-   * client libraries may automatically extend ack_deadlines.
-   *
-   * This field will be honored on a best effort basis.
-   *
-   * If this parameter is 0, a default value of 5 is used.
-   * 
- * - * int32 max_delivery_attempts = 2; - * - * @return The maxDeliveryAttempts. - */ - @java.lang.Override - public int getMaxDeliveryAttempts() { - return maxDeliveryAttempts_; - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deadLetterTopic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, deadLetterTopic_); - } - if (maxDeliveryAttempts_ != 0) { - output.writeInt32(2, maxDeliveryAttempts_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deadLetterTopic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, deadLetterTopic_); - } - if (maxDeliveryAttempts_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxDeliveryAttempts_); - } - size += getUnknownFields().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.DeadLetterPolicy)) { - return super.equals(obj); - } - com.google.pubsub.v1.DeadLetterPolicy other = (com.google.pubsub.v1.DeadLetterPolicy) obj; - - if (!getDeadLetterTopic().equals(other.getDeadLetterTopic())) return false; - if (getMaxDeliveryAttempts() != other.getMaxDeliveryAttempts()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DEAD_LETTER_TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getDeadLetterTopic().hashCode(); - hash = (37 * hash) + MAX_DELIVERY_ATTEMPTS_FIELD_NUMBER; - hash = (53 * hash) + getMaxDeliveryAttempts(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.DeadLetterPolicy parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeadLetterPolicy 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.DeadLetterPolicy parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeadLetterPolicy 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.DeadLetterPolicy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeadLetterPolicy parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.DeadLetterPolicy parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeadLetterPolicy 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.DeadLetterPolicy parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeadLetterPolicy 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.DeadLetterPolicy parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeadLetterPolicy 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.DeadLetterPolicy 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; - } - /** - * - * - *
-   * Dead lettering is done on a best effort basis. The same message might be
-   * dead lettered multiple times.
-   *
-   * If validation on any of the fields fails at subscription creation/updation,
-   * the create/update subscription request will fail.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.DeadLetterPolicy} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.DeadLetterPolicy) - com.google.pubsub.v1.DeadLetterPolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeadLetterPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DeadLetterPolicy.class, - com.google.pubsub.v1.DeadLetterPolicy.Builder.class); - } - - // Construct using com.google.pubsub.v1.DeadLetterPolicy.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - deadLetterTopic_ = ""; - maxDeliveryAttempts_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.DeadLetterPolicy getDefaultInstanceForType() { - return com.google.pubsub.v1.DeadLetterPolicy.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.DeadLetterPolicy build() { - com.google.pubsub.v1.DeadLetterPolicy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.DeadLetterPolicy buildPartial() { - com.google.pubsub.v1.DeadLetterPolicy result = - new com.google.pubsub.v1.DeadLetterPolicy(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.DeadLetterPolicy result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.deadLetterTopic_ = deadLetterTopic_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.maxDeliveryAttempts_ = maxDeliveryAttempts_; - } - } - - @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.DeadLetterPolicy) { - return mergeFrom((com.google.pubsub.v1.DeadLetterPolicy) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.DeadLetterPolicy other) { - if (other == com.google.pubsub.v1.DeadLetterPolicy.getDefaultInstance()) return this; - if (!other.getDeadLetterTopic().isEmpty()) { - deadLetterTopic_ = other.deadLetterTopic_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getMaxDeliveryAttempts() != 0) { - setMaxDeliveryAttempts(other.getMaxDeliveryAttempts()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - deadLetterTopic_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - maxDeliveryAttempts_ = input.readInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object deadLetterTopic_ = ""; - /** - * - * - *
-     * The name of the topic to which dead letter messages should be published.
-     * Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
-     * account associated with the enclosing subscription's parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Publish() to this topic.
-     *
-     * The operation will fail if the topic does not exist.
-     * Users should ensure that there is a subscription attached to this topic
-     * since messages published to a topic with no subscriptions are lost.
-     * 
- * - * string dead_letter_topic = 1; - * - * @return The deadLetterTopic. - */ - public java.lang.String getDeadLetterTopic() { - java.lang.Object ref = deadLetterTopic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - deadLetterTopic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The name of the topic to which dead letter messages should be published.
-     * Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
-     * account associated with the enclosing subscription's parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Publish() to this topic.
-     *
-     * The operation will fail if the topic does not exist.
-     * Users should ensure that there is a subscription attached to this topic
-     * since messages published to a topic with no subscriptions are lost.
-     * 
- * - * string dead_letter_topic = 1; - * - * @return The bytes for deadLetterTopic. - */ - public com.google.protobuf.ByteString getDeadLetterTopicBytes() { - java.lang.Object ref = deadLetterTopic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - deadLetterTopic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The name of the topic to which dead letter messages should be published.
-     * Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
-     * account associated with the enclosing subscription's parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Publish() to this topic.
-     *
-     * The operation will fail if the topic does not exist.
-     * Users should ensure that there is a subscription attached to this topic
-     * since messages published to a topic with no subscriptions are lost.
-     * 
- * - * string dead_letter_topic = 1; - * - * @param value The deadLetterTopic to set. - * @return This builder for chaining. - */ - public Builder setDeadLetterTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - deadLetterTopic_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the topic to which dead letter messages should be published.
-     * Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
-     * account associated with the enclosing subscription's parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Publish() to this topic.
-     *
-     * The operation will fail if the topic does not exist.
-     * Users should ensure that there is a subscription attached to this topic
-     * since messages published to a topic with no subscriptions are lost.
-     * 
- * - * string dead_letter_topic = 1; - * - * @return This builder for chaining. - */ - public Builder clearDeadLetterTopic() { - deadLetterTopic_ = getDefaultInstance().getDeadLetterTopic(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the topic to which dead letter messages should be published.
-     * Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
-     * account associated with the enclosing subscription's parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Publish() to this topic.
-     *
-     * The operation will fail if the topic does not exist.
-     * Users should ensure that there is a subscription attached to this topic
-     * since messages published to a topic with no subscriptions are lost.
-     * 
- * - * string dead_letter_topic = 1; - * - * @param value The bytes for deadLetterTopic to set. - * @return This builder for chaining. - */ - public Builder setDeadLetterTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - deadLetterTopic_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private int maxDeliveryAttempts_; - /** - * - * - *
-     * The maximum number of delivery attempts for any message. The value must be
-     * between 5 and 100.
-     *
-     * The number of delivery attempts is defined as 1 + (the sum of number of
-     * NACKs and number of times the acknowledgement deadline has been exceeded
-     * for the message).
-     *
-     * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
-     * client libraries may automatically extend ack_deadlines.
-     *
-     * This field will be honored on a best effort basis.
-     *
-     * If this parameter is 0, a default value of 5 is used.
-     * 
- * - * int32 max_delivery_attempts = 2; - * - * @return The maxDeliveryAttempts. - */ - @java.lang.Override - public int getMaxDeliveryAttempts() { - return maxDeliveryAttempts_; - } - /** - * - * - *
-     * The maximum number of delivery attempts for any message. The value must be
-     * between 5 and 100.
-     *
-     * The number of delivery attempts is defined as 1 + (the sum of number of
-     * NACKs and number of times the acknowledgement deadline has been exceeded
-     * for the message).
-     *
-     * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
-     * client libraries may automatically extend ack_deadlines.
-     *
-     * This field will be honored on a best effort basis.
-     *
-     * If this parameter is 0, a default value of 5 is used.
-     * 
- * - * int32 max_delivery_attempts = 2; - * - * @param value The maxDeliveryAttempts to set. - * @return This builder for chaining. - */ - public Builder setMaxDeliveryAttempts(int value) { - - maxDeliveryAttempts_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum number of delivery attempts for any message. The value must be
-     * between 5 and 100.
-     *
-     * The number of delivery attempts is defined as 1 + (the sum of number of
-     * NACKs and number of times the acknowledgement deadline has been exceeded
-     * for the message).
-     *
-     * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
-     * client libraries may automatically extend ack_deadlines.
-     *
-     * This field will be honored on a best effort basis.
-     *
-     * If this parameter is 0, a default value of 5 is used.
-     * 
- * - * int32 max_delivery_attempts = 2; - * - * @return This builder for chaining. - */ - public Builder clearMaxDeliveryAttempts() { - bitField0_ = (bitField0_ & ~0x00000002); - maxDeliveryAttempts_ = 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.DeadLetterPolicy) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.DeadLetterPolicy) - private static final com.google.pubsub.v1.DeadLetterPolicy DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.DeadLetterPolicy(); - } - - public static com.google.pubsub.v1.DeadLetterPolicy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeadLetterPolicy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.DeadLetterPolicy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicyOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicyOrBuilder.java deleted file mode 100644 index 57c34d389..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicyOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2023 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 DeadLetterPolicyOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.DeadLetterPolicy) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The name of the topic to which dead letter messages should be published.
-   * Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
-   * account associated with the enclosing subscription's parent project (i.e.,
-   * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-   * permission to Publish() to this topic.
-   *
-   * The operation will fail if the topic does not exist.
-   * Users should ensure that there is a subscription attached to this topic
-   * since messages published to a topic with no subscriptions are lost.
-   * 
- * - * string dead_letter_topic = 1; - * - * @return The deadLetterTopic. - */ - java.lang.String getDeadLetterTopic(); - /** - * - * - *
-   * The name of the topic to which dead letter messages should be published.
-   * Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
-   * account associated with the enclosing subscription's parent project (i.e.,
-   * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-   * permission to Publish() to this topic.
-   *
-   * The operation will fail if the topic does not exist.
-   * Users should ensure that there is a subscription attached to this topic
-   * since messages published to a topic with no subscriptions are lost.
-   * 
- * - * string dead_letter_topic = 1; - * - * @return The bytes for deadLetterTopic. - */ - com.google.protobuf.ByteString getDeadLetterTopicBytes(); - - /** - * - * - *
-   * The maximum number of delivery attempts for any message. The value must be
-   * between 5 and 100.
-   *
-   * The number of delivery attempts is defined as 1 + (the sum of number of
-   * NACKs and number of times the acknowledgement deadline has been exceeded
-   * for the message).
-   *
-   * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
-   * client libraries may automatically extend ack_deadlines.
-   *
-   * This field will be honored on a best effort basis.
-   *
-   * If this parameter is 0, a default value of 5 is used.
-   * 
- * - * int32 max_delivery_attempts = 2; - * - * @return The maxDeliveryAttempts. - */ - int getMaxDeliveryAttempts(); -} 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 deleted file mode 100644 index 05b705298..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequest.java +++ /dev/null @@ -1,643 +0,0 @@ -/* - * Copyright 2023 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(); - } - - 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; - - @SuppressWarnings("serial") - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - 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); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.DeleteSchemaRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - } - - @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_; - bitField0_ |= 0x00000001; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - 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; - bitField0_ |= 0x00000001; - 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(); - bitField0_ = (bitField0_ & ~0x00000001); - 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; - bitField0_ |= 0x00000001; - 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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index 9a119b4b6..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequestOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2023 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/DeleteSchemaRevisionRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRevisionRequest.java deleted file mode 100644 index d057aaf47..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRevisionRequest.java +++ /dev/null @@ -1,883 +0,0 @@ -/* - * Copyright 2023 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 `DeleteSchemaRevision` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.DeleteSchemaRevisionRequest} - */ -public final class DeleteSchemaRevisionRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.DeleteSchemaRevisionRequest) - DeleteSchemaRevisionRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteSchemaRevisionRequest.newBuilder() to construct. - private DeleteSchemaRevisionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteSchemaRevisionRequest() { - name_ = ""; - revisionId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteSchemaRevisionRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_DeleteSchemaRevisionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_DeleteSchemaRevisionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DeleteSchemaRevisionRequest.class, - com.google.pubsub.v1.DeleteSchemaRevisionRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * Required. The name of the schema revision to be deleted, with a revision ID
-   * explicitly included.
-   *
-   * Example: `projects/123/schemas/my-schema@c7cfa2a8`
-   * 
- * - * - * 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 revision to be deleted, with a revision ID
-   * explicitly included.
-   *
-   * Example: `projects/123/schemas/my-schema@c7cfa2a8`
-   * 
- * - * - * 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 REVISION_ID_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object revisionId_ = ""; - /** - * - * - *
-   * Optional. This field is deprecated and should not be used for specifying
-   * the revision ID. The revision ID should be specified via the `name`
-   * parameter.
-   * 
- * - * string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.DeleteSchemaRevisionRequest.revision_id is deprecated. See - * google/pubsub/v1/schema.proto;l=331 - * @return The revisionId. - */ - @java.lang.Override - @java.lang.Deprecated - public java.lang.String getRevisionId() { - java.lang.Object ref = revisionId_; - 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(); - revisionId_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. This field is deprecated and should not be used for specifying
-   * the revision ID. The revision ID should be specified via the `name`
-   * parameter.
-   * 
- * - * string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.DeleteSchemaRevisionRequest.revision_id is deprecated. See - * google/pubsub/v1/schema.proto;l=331 - * @return The bytes for revisionId. - */ - @java.lang.Override - @java.lang.Deprecated - public com.google.protobuf.ByteString getRevisionIdBytes() { - java.lang.Object ref = revisionId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - revisionId_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, revisionId_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, revisionId_); - } - size += getUnknownFields().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.DeleteSchemaRevisionRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.DeleteSchemaRevisionRequest other = - (com.google.pubsub.v1.DeleteSchemaRevisionRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (!getRevisionId().equals(other.getRevisionId())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REVISION_ID_FIELD_NUMBER; - hash = (53 * hash) + getRevisionId().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.DeleteSchemaRevisionRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteSchemaRevisionRequest 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.DeleteSchemaRevisionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteSchemaRevisionRequest 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.DeleteSchemaRevisionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteSchemaRevisionRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.DeleteSchemaRevisionRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteSchemaRevisionRequest 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.DeleteSchemaRevisionRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteSchemaRevisionRequest 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.DeleteSchemaRevisionRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteSchemaRevisionRequest 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.DeleteSchemaRevisionRequest 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 `DeleteSchemaRevision` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.DeleteSchemaRevisionRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.DeleteSchemaRevisionRequest) - com.google.pubsub.v1.DeleteSchemaRevisionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_DeleteSchemaRevisionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_DeleteSchemaRevisionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DeleteSchemaRevisionRequest.class, - com.google.pubsub.v1.DeleteSchemaRevisionRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.DeleteSchemaRevisionRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - revisionId_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_DeleteSchemaRevisionRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteSchemaRevisionRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.DeleteSchemaRevisionRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteSchemaRevisionRequest build() { - com.google.pubsub.v1.DeleteSchemaRevisionRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteSchemaRevisionRequest buildPartial() { - com.google.pubsub.v1.DeleteSchemaRevisionRequest result = - new com.google.pubsub.v1.DeleteSchemaRevisionRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.DeleteSchemaRevisionRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.revisionId_ = revisionId_; - } - } - - @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.DeleteSchemaRevisionRequest) { - return mergeFrom((com.google.pubsub.v1.DeleteSchemaRevisionRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.DeleteSchemaRevisionRequest other) { - if (other == com.google.pubsub.v1.DeleteSchemaRevisionRequest.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getRevisionId().isEmpty()) { - revisionId_ = other.revisionId_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - revisionId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The name of the schema revision to be deleted, with a revision ID
-     * explicitly included.
-     *
-     * Example: `projects/123/schemas/my-schema@c7cfa2a8`
-     * 
- * - * - * 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 revision to be deleted, with a revision ID
-     * explicitly included.
-     *
-     * Example: `projects/123/schemas/my-schema@c7cfa2a8`
-     * 
- * - * - * 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 revision to be deleted, with a revision ID
-     * explicitly included.
-     *
-     * Example: `projects/123/schemas/my-schema@c7cfa2a8`
-     * 
- * - * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the schema revision to be deleted, with a revision ID
-     * explicitly included.
-     *
-     * Example: `projects/123/schemas/my-schema@c7cfa2a8`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the schema revision to be deleted, with a revision ID
-     * explicitly included.
-     *
-     * Example: `projects/123/schemas/my-schema@c7cfa2a8`
-     * 
- * - * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object revisionId_ = ""; - /** - * - * - *
-     * Optional. This field is deprecated and should not be used for specifying
-     * the revision ID. The revision ID should be specified via the `name`
-     * parameter.
-     * 
- * - * string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.DeleteSchemaRevisionRequest.revision_id is deprecated. See - * google/pubsub/v1/schema.proto;l=331 - * @return The revisionId. - */ - @java.lang.Deprecated - public java.lang.String getRevisionId() { - java.lang.Object ref = revisionId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - revisionId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. This field is deprecated and should not be used for specifying
-     * the revision ID. The revision ID should be specified via the `name`
-     * parameter.
-     * 
- * - * string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.DeleteSchemaRevisionRequest.revision_id is deprecated. See - * google/pubsub/v1/schema.proto;l=331 - * @return The bytes for revisionId. - */ - @java.lang.Deprecated - public com.google.protobuf.ByteString getRevisionIdBytes() { - java.lang.Object ref = revisionId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - revisionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. This field is deprecated and should not be used for specifying
-     * the revision ID. The revision ID should be specified via the `name`
-     * parameter.
-     * 
- * - * string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.DeleteSchemaRevisionRequest.revision_id is deprecated. See - * google/pubsub/v1/schema.proto;l=331 - * @param value The revisionId to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder setRevisionId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - revisionId_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. This field is deprecated and should not be used for specifying
-     * the revision ID. The revision ID should be specified via the `name`
-     * parameter.
-     * 
- * - * string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.DeleteSchemaRevisionRequest.revision_id is deprecated. See - * google/pubsub/v1/schema.proto;l=331 - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder clearRevisionId() { - revisionId_ = getDefaultInstance().getRevisionId(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. This field is deprecated and should not be used for specifying
-     * the revision ID. The revision ID should be specified via the `name`
-     * parameter.
-     * 
- * - * string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.DeleteSchemaRevisionRequest.revision_id is deprecated. See - * google/pubsub/v1/schema.proto;l=331 - * @param value The bytes for revisionId to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder setRevisionIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - revisionId_ = value; - bitField0_ |= 0x00000002; - 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.DeleteSchemaRevisionRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.DeleteSchemaRevisionRequest) - private static final com.google.pubsub.v1.DeleteSchemaRevisionRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.DeleteSchemaRevisionRequest(); - } - - public static com.google.pubsub.v1.DeleteSchemaRevisionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteSchemaRevisionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.DeleteSchemaRevisionRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRevisionRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRevisionRequestOrBuilder.java deleted file mode 100644 index 1286bce9f..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRevisionRequestOrBuilder.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2023 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 DeleteSchemaRevisionRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.DeleteSchemaRevisionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the schema revision to be deleted, with a revision ID
-   * explicitly included.
-   *
-   * Example: `projects/123/schemas/my-schema@c7cfa2a8`
-   * 
- * - * - * 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 revision to be deleted, with a revision ID
-   * explicitly included.
-   *
-   * Example: `projects/123/schemas/my-schema@c7cfa2a8`
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Optional. This field is deprecated and should not be used for specifying
-   * the revision ID. The revision ID should be specified via the `name`
-   * parameter.
-   * 
- * - * string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.DeleteSchemaRevisionRequest.revision_id is deprecated. See - * google/pubsub/v1/schema.proto;l=331 - * @return The revisionId. - */ - @java.lang.Deprecated - java.lang.String getRevisionId(); - /** - * - * - *
-   * Optional. This field is deprecated and should not be used for specifying
-   * the revision ID. The revision ID should be specified via the `name`
-   * parameter.
-   * 
- * - * string revision_id = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.DeleteSchemaRevisionRequest.revision_id is deprecated. See - * google/pubsub/v1/schema.proto;l=331 - * @return The bytes for revisionId. - */ - @java.lang.Deprecated - com.google.protobuf.ByteString getRevisionIdBytes(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequest.java deleted file mode 100644 index 3d494f98f..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequest.java +++ /dev/null @@ -1,644 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `DeleteSnapshot` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.DeleteSnapshotRequest} - */ -public final class DeleteSnapshotRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.DeleteSnapshotRequest) - DeleteSnapshotRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteSnapshotRequest.newBuilder() to construct. - private DeleteSnapshotRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteSnapshotRequest() { - snapshot_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteSnapshotRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteSnapshotRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteSnapshotRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DeleteSnapshotRequest.class, - com.google.pubsub.v1.DeleteSnapshotRequest.Builder.class); - } - - public static final int SNAPSHOT_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object snapshot_ = ""; - /** - * - * - *
-   * Required. The name of the snapshot to delete.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The snapshot. - */ - @java.lang.Override - public java.lang.String getSnapshot() { - java.lang.Object ref = snapshot_; - 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(); - snapshot_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the snapshot to delete.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for snapshot. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSnapshotBytes() { - java.lang.Object ref = snapshot_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - snapshot_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshot_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, snapshot_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshot_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, snapshot_); - } - size += getUnknownFields().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.DeleteSnapshotRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.DeleteSnapshotRequest other = - (com.google.pubsub.v1.DeleteSnapshotRequest) obj; - - if (!getSnapshot().equals(other.getSnapshot())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SNAPSHOT_FIELD_NUMBER; - hash = (53 * hash) + getSnapshot().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.DeleteSnapshotRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteSnapshotRequest 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.DeleteSnapshotRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteSnapshotRequest 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.DeleteSnapshotRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteSnapshotRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.DeleteSnapshotRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteSnapshotRequest 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.DeleteSnapshotRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteSnapshotRequest 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.DeleteSnapshotRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteSnapshotRequest 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.DeleteSnapshotRequest 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 `DeleteSnapshot` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.DeleteSnapshotRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.DeleteSnapshotRequest) - com.google.pubsub.v1.DeleteSnapshotRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteSnapshotRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteSnapshotRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DeleteSnapshotRequest.class, - com.google.pubsub.v1.DeleteSnapshotRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.DeleteSnapshotRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - snapshot_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteSnapshotRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteSnapshotRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.DeleteSnapshotRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteSnapshotRequest build() { - com.google.pubsub.v1.DeleteSnapshotRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteSnapshotRequest buildPartial() { - com.google.pubsub.v1.DeleteSnapshotRequest result = - new com.google.pubsub.v1.DeleteSnapshotRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.DeleteSnapshotRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.snapshot_ = snapshot_; - } - } - - @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.DeleteSnapshotRequest) { - return mergeFrom((com.google.pubsub.v1.DeleteSnapshotRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.DeleteSnapshotRequest other) { - if (other == com.google.pubsub.v1.DeleteSnapshotRequest.getDefaultInstance()) return this; - if (!other.getSnapshot().isEmpty()) { - snapshot_ = other.snapshot_; - bitField0_ |= 0x00000001; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - snapshot_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object snapshot_ = ""; - /** - * - * - *
-     * Required. The name of the snapshot to delete.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The snapshot. - */ - public java.lang.String getSnapshot() { - java.lang.Object ref = snapshot_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - snapshot_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the snapshot to delete.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for snapshot. - */ - public com.google.protobuf.ByteString getSnapshotBytes() { - java.lang.Object ref = snapshot_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - snapshot_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the snapshot to delete.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The snapshot to set. - * @return This builder for chaining. - */ - public Builder setSnapshot(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - snapshot_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the snapshot to delete.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSnapshot() { - snapshot_ = getDefaultInstance().getSnapshot(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the snapshot to delete.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for snapshot to set. - * @return This builder for chaining. - */ - public Builder setSnapshotBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - snapshot_ = value; - bitField0_ |= 0x00000001; - 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.DeleteSnapshotRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.DeleteSnapshotRequest) - private static final com.google.pubsub.v1.DeleteSnapshotRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.DeleteSnapshotRequest(); - } - - public static com.google.pubsub.v1.DeleteSnapshotRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteSnapshotRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.DeleteSnapshotRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequestOrBuilder.java deleted file mode 100644 index c69c25ca8..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequestOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2023 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 DeleteSnapshotRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.DeleteSnapshotRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the snapshot to delete.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The snapshot. - */ - java.lang.String getSnapshot(); - /** - * - * - *
-   * Required. The name of the snapshot to delete.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for snapshot. - */ - com.google.protobuf.ByteString getSnapshotBytes(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java deleted file mode 100644 index d91bb8783..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java +++ /dev/null @@ -1,644 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the DeleteSubscription method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.DeleteSubscriptionRequest} - */ -public final class DeleteSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.DeleteSubscriptionRequest) - DeleteSubscriptionRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteSubscriptionRequest.newBuilder() to construct. - private DeleteSubscriptionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteSubscriptionRequest() { - subscription_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteSubscriptionRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteSubscriptionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DeleteSubscriptionRequest.class, - com.google.pubsub.v1.DeleteSubscriptionRequest.Builder.class); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object subscription_ = ""; - /** - * - * - *
-   * Required. The subscription to delete.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - @java.lang.Override - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - 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(); - subscription_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The subscription to delete.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_); - } - size += getUnknownFields().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.DeleteSubscriptionRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.DeleteSubscriptionRequest other = - (com.google.pubsub.v1.DeleteSubscriptionRequest) obj; - - if (!getSubscription().equals(other.getSubscription())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.DeleteSubscriptionRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteSubscriptionRequest 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.DeleteSubscriptionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteSubscriptionRequest 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.DeleteSubscriptionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteSubscriptionRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.DeleteSubscriptionRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteSubscriptionRequest 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.DeleteSubscriptionRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteSubscriptionRequest 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.DeleteSubscriptionRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteSubscriptionRequest 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.DeleteSubscriptionRequest 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 DeleteSubscription method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.DeleteSubscriptionRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.DeleteSubscriptionRequest) - com.google.pubsub.v1.DeleteSubscriptionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteSubscriptionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DeleteSubscriptionRequest.class, - com.google.pubsub.v1.DeleteSubscriptionRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.DeleteSubscriptionRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscription_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteSubscriptionRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.DeleteSubscriptionRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteSubscriptionRequest build() { - com.google.pubsub.v1.DeleteSubscriptionRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteSubscriptionRequest buildPartial() { - com.google.pubsub.v1.DeleteSubscriptionRequest result = - new com.google.pubsub.v1.DeleteSubscriptionRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.DeleteSubscriptionRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.subscription_ = subscription_; - } - } - - @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.DeleteSubscriptionRequest) { - return mergeFrom((com.google.pubsub.v1.DeleteSubscriptionRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.DeleteSubscriptionRequest other) { - if (other == com.google.pubsub.v1.DeleteSubscriptionRequest.getDefaultInstance()) return this; - if (!other.getSubscription().isEmpty()) { - subscription_ = other.subscription_; - bitField0_ |= 0x00000001; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - subscription_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object subscription_ = ""; - /** - * - * - *
-     * Required. The subscription to delete.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The subscription to delete.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The subscription to delete.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription to delete.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSubscription() { - subscription_ = getDefaultInstance().getSubscription(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription to delete.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - subscription_ = value; - bitField0_ |= 0x00000001; - 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.DeleteSubscriptionRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.DeleteSubscriptionRequest) - private static final com.google.pubsub.v1.DeleteSubscriptionRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.DeleteSubscriptionRequest(); - } - - public static com.google.pubsub.v1.DeleteSubscriptionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteSubscriptionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.DeleteSubscriptionRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequestOrBuilder.java deleted file mode 100644 index 53ffc2512..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequestOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2023 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 DeleteSubscriptionRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.DeleteSubscriptionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The subscription to delete.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - java.lang.String getSubscription(); - /** - * - * - *
-   * Required. The subscription to delete.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - com.google.protobuf.ByteString getSubscriptionBytes(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java deleted file mode 100644 index a4055d287..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java +++ /dev/null @@ -1,643 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `DeleteTopic` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.DeleteTopicRequest} - */ -public final class DeleteTopicRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.DeleteTopicRequest) - DeleteTopicRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteTopicRequest.newBuilder() to construct. - private DeleteTopicRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteTopicRequest() { - topic_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteTopicRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteTopicRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DeleteTopicRequest.class, - com.google.pubsub.v1.DeleteTopicRequest.Builder.class); - } - - public static final int TOPIC_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object topic_ = ""; - /** - * - * - *
-   * Required. Name of the topic to delete.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - @java.lang.Override - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - 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(); - topic_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Name of the topic to delete.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_); - } - size += getUnknownFields().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.DeleteTopicRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.DeleteTopicRequest other = (com.google.pubsub.v1.DeleteTopicRequest) obj; - - if (!getTopic().equals(other.getTopic())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getTopic().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.DeleteTopicRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteTopicRequest 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.DeleteTopicRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteTopicRequest 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.DeleteTopicRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DeleteTopicRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.DeleteTopicRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteTopicRequest 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.DeleteTopicRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteTopicRequest 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.DeleteTopicRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DeleteTopicRequest 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.DeleteTopicRequest 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 `DeleteTopic` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.DeleteTopicRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.DeleteTopicRequest) - com.google.pubsub.v1.DeleteTopicRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteTopicRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DeleteTopicRequest.class, - com.google.pubsub.v1.DeleteTopicRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.DeleteTopicRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - topic_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteTopicRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.DeleteTopicRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteTopicRequest build() { - com.google.pubsub.v1.DeleteTopicRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.DeleteTopicRequest buildPartial() { - com.google.pubsub.v1.DeleteTopicRequest result = - new com.google.pubsub.v1.DeleteTopicRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.DeleteTopicRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.topic_ = topic_; - } - } - - @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.DeleteTopicRequest) { - return mergeFrom((com.google.pubsub.v1.DeleteTopicRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.DeleteTopicRequest other) { - if (other == com.google.pubsub.v1.DeleteTopicRequest.getDefaultInstance()) return this; - if (!other.getTopic().isEmpty()) { - topic_ = other.topic_; - bitField0_ |= 0x00000001; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - topic_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object topic_ = ""; - /** - * - * - *
-     * Required. Name of the topic to delete.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - topic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Name of the topic to delete.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Name of the topic to delete.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The topic to set. - * @return This builder for chaining. - */ - public Builder setTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - topic_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the topic to delete.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearTopic() { - topic_ = getDefaultInstance().getTopic(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the topic to delete.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for topic to set. - * @return This builder for chaining. - */ - public Builder setTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - topic_ = value; - bitField0_ |= 0x00000001; - 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.DeleteTopicRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.DeleteTopicRequest) - private static final com.google.pubsub.v1.DeleteTopicRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.DeleteTopicRequest(); - } - - public static com.google.pubsub.v1.DeleteTopicRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteTopicRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.DeleteTopicRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteTopicRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteTopicRequestOrBuilder.java deleted file mode 100644 index 8360c7745..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteTopicRequestOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2023 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 DeleteTopicRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.DeleteTopicRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Name of the topic to delete.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - java.lang.String getTopic(); - /** - * - * - *
-   * Required. Name of the topic to delete.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - com.google.protobuf.ByteString getTopicBytes(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequest.java deleted file mode 100644 index 910c1f9e2..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequest.java +++ /dev/null @@ -1,644 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the DetachSubscription method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.DetachSubscriptionRequest} - */ -public final class DetachSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.DetachSubscriptionRequest) - DetachSubscriptionRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DetachSubscriptionRequest.newBuilder() to construct. - private DetachSubscriptionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DetachSubscriptionRequest() { - subscription_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DetachSubscriptionRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DetachSubscriptionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DetachSubscriptionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DetachSubscriptionRequest.class, - com.google.pubsub.v1.DetachSubscriptionRequest.Builder.class); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object subscription_ = ""; - /** - * - * - *
-   * Required. The subscription to detach.
-   * Format is `projects/{project}/subscriptions/{subscription}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - @java.lang.Override - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - 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(); - subscription_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The subscription to detach.
-   * Format is `projects/{project}/subscriptions/{subscription}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_); - } - size += getUnknownFields().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.DetachSubscriptionRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.DetachSubscriptionRequest other = - (com.google.pubsub.v1.DetachSubscriptionRequest) obj; - - if (!getSubscription().equals(other.getSubscription())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.DetachSubscriptionRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DetachSubscriptionRequest 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.DetachSubscriptionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DetachSubscriptionRequest 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.DetachSubscriptionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DetachSubscriptionRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.DetachSubscriptionRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DetachSubscriptionRequest 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.DetachSubscriptionRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DetachSubscriptionRequest 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.DetachSubscriptionRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DetachSubscriptionRequest 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.DetachSubscriptionRequest 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 DetachSubscription method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.DetachSubscriptionRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.DetachSubscriptionRequest) - com.google.pubsub.v1.DetachSubscriptionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DetachSubscriptionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DetachSubscriptionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DetachSubscriptionRequest.class, - com.google.pubsub.v1.DetachSubscriptionRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.DetachSubscriptionRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscription_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DetachSubscriptionRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.DetachSubscriptionRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.DetachSubscriptionRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.DetachSubscriptionRequest build() { - com.google.pubsub.v1.DetachSubscriptionRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.DetachSubscriptionRequest buildPartial() { - com.google.pubsub.v1.DetachSubscriptionRequest result = - new com.google.pubsub.v1.DetachSubscriptionRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.DetachSubscriptionRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.subscription_ = subscription_; - } - } - - @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.DetachSubscriptionRequest) { - return mergeFrom((com.google.pubsub.v1.DetachSubscriptionRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.DetachSubscriptionRequest other) { - if (other == com.google.pubsub.v1.DetachSubscriptionRequest.getDefaultInstance()) return this; - if (!other.getSubscription().isEmpty()) { - subscription_ = other.subscription_; - bitField0_ |= 0x00000001; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - subscription_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object subscription_ = ""; - /** - * - * - *
-     * Required. The subscription to detach.
-     * Format is `projects/{project}/subscriptions/{subscription}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The subscription to detach.
-     * Format is `projects/{project}/subscriptions/{subscription}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The subscription to detach.
-     * Format is `projects/{project}/subscriptions/{subscription}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription to detach.
-     * Format is `projects/{project}/subscriptions/{subscription}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSubscription() { - subscription_ = getDefaultInstance().getSubscription(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription to detach.
-     * Format is `projects/{project}/subscriptions/{subscription}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - subscription_ = value; - bitField0_ |= 0x00000001; - 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.DetachSubscriptionRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.DetachSubscriptionRequest) - private static final com.google.pubsub.v1.DetachSubscriptionRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.DetachSubscriptionRequest(); - } - - public static com.google.pubsub.v1.DetachSubscriptionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DetachSubscriptionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.DetachSubscriptionRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequestOrBuilder.java deleted file mode 100644 index 6b348ec14..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequestOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2023 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 DetachSubscriptionRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.DetachSubscriptionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The subscription to detach.
-   * Format is `projects/{project}/subscriptions/{subscription}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - java.lang.String getSubscription(); - /** - * - * - *
-   * Required. The subscription to detach.
-   * Format is `projects/{project}/subscriptions/{subscription}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - com.google.protobuf.ByteString getSubscriptionBytes(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionResponse.java deleted file mode 100644 index 0eae1bac2..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionResponse.java +++ /dev/null @@ -1,433 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Response for the DetachSubscription method.
- * Reserved for future use.
- * 
- * - * Protobuf type {@code google.pubsub.v1.DetachSubscriptionResponse} - */ -public final class DetachSubscriptionResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.DetachSubscriptionResponse) - DetachSubscriptionResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use DetachSubscriptionResponse.newBuilder() to construct. - private DetachSubscriptionResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DetachSubscriptionResponse() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DetachSubscriptionResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DetachSubscriptionResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DetachSubscriptionResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DetachSubscriptionResponse.class, - com.google.pubsub.v1.DetachSubscriptionResponse.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 { - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += getUnknownFields().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.DetachSubscriptionResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.DetachSubscriptionResponse other = - (com.google.pubsub.v1.DetachSubscriptionResponse) obj; - - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.DetachSubscriptionResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DetachSubscriptionResponse 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.DetachSubscriptionResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DetachSubscriptionResponse 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.DetachSubscriptionResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.DetachSubscriptionResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.DetachSubscriptionResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DetachSubscriptionResponse 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.DetachSubscriptionResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DetachSubscriptionResponse 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.DetachSubscriptionResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.DetachSubscriptionResponse 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.DetachSubscriptionResponse 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 DetachSubscription method.
-   * Reserved for future use.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.DetachSubscriptionResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.DetachSubscriptionResponse) - com.google.pubsub.v1.DetachSubscriptionResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DetachSubscriptionResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_DetachSubscriptionResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.DetachSubscriptionResponse.class, - com.google.pubsub.v1.DetachSubscriptionResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.DetachSubscriptionResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @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.PubsubProto - .internal_static_google_pubsub_v1_DetachSubscriptionResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.DetachSubscriptionResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.DetachSubscriptionResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.DetachSubscriptionResponse build() { - com.google.pubsub.v1.DetachSubscriptionResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.DetachSubscriptionResponse buildPartial() { - com.google.pubsub.v1.DetachSubscriptionResponse result = - new com.google.pubsub.v1.DetachSubscriptionResponse(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.DetachSubscriptionResponse) { - return mergeFrom((com.google.pubsub.v1.DetachSubscriptionResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.DetachSubscriptionResponse other) { - if (other == com.google.pubsub.v1.DetachSubscriptionResponse.getDefaultInstance()) - return this; - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - 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.DetachSubscriptionResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.DetachSubscriptionResponse) - private static final com.google.pubsub.v1.DetachSubscriptionResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.DetachSubscriptionResponse(); - } - - public static com.google.pubsub.v1.DetachSubscriptionResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DetachSubscriptionResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.DetachSubscriptionResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionResponseOrBuilder.java deleted file mode 100644 index 4d8a60b3a..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionResponseOrBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2023 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 DetachSubscriptionResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.DetachSubscriptionResponse) - com.google.protobuf.MessageOrBuilder {} 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 deleted file mode 100644 index 6f07b9ea4..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Encoding.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright 2023 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/ExpirationPolicy.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ExpirationPolicy.java deleted file mode 100644 index 89229dd47..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ExpirationPolicy.java +++ /dev/null @@ -1,755 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * A policy that specifies the conditions for resource expiration (i.e.,
- * automatic resource deletion).
- * 
- * - * Protobuf type {@code google.pubsub.v1.ExpirationPolicy} - */ -public final class ExpirationPolicy extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ExpirationPolicy) - ExpirationPolicyOrBuilder { - private static final long serialVersionUID = 0L; - // Use ExpirationPolicy.newBuilder() to construct. - private ExpirationPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ExpirationPolicy() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ExpirationPolicy(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ExpirationPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ExpirationPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ExpirationPolicy.class, - com.google.pubsub.v1.ExpirationPolicy.Builder.class); - } - - public static final int TTL_FIELD_NUMBER = 1; - private com.google.protobuf.Duration ttl_; - /** - * - * - *
-   * Specifies the "time-to-live" duration for an associated resource. The
-   * resource expires if it is not active for a period of `ttl`. The definition
-   * of "activity" depends on the type of the associated resource. The minimum
-   * and maximum allowed values for `ttl` depend on the type of the associated
-   * resource, as well. If `ttl` is not set, the associated resource never
-   * expires.
-   * 
- * - * .google.protobuf.Duration ttl = 1; - * - * @return Whether the ttl field is set. - */ - @java.lang.Override - public boolean hasTtl() { - return ttl_ != null; - } - /** - * - * - *
-   * Specifies the "time-to-live" duration for an associated resource. The
-   * resource expires if it is not active for a period of `ttl`. The definition
-   * of "activity" depends on the type of the associated resource. The minimum
-   * and maximum allowed values for `ttl` depend on the type of the associated
-   * resource, as well. If `ttl` is not set, the associated resource never
-   * expires.
-   * 
- * - * .google.protobuf.Duration ttl = 1; - * - * @return The ttl. - */ - @java.lang.Override - public com.google.protobuf.Duration getTtl() { - return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; - } - /** - * - * - *
-   * Specifies the "time-to-live" duration for an associated resource. The
-   * resource expires if it is not active for a period of `ttl`. The definition
-   * of "activity" depends on the type of the associated resource. The minimum
-   * and maximum allowed values for `ttl` depend on the type of the associated
-   * resource, as well. If `ttl` is not set, the associated resource never
-   * expires.
-   * 
- * - * .google.protobuf.Duration ttl = 1; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { - return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; - } - - 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 (ttl_ != null) { - output.writeMessage(1, getTtl()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (ttl_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTtl()); - } - size += getUnknownFields().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.ExpirationPolicy)) { - return super.equals(obj); - } - com.google.pubsub.v1.ExpirationPolicy other = (com.google.pubsub.v1.ExpirationPolicy) obj; - - if (hasTtl() != other.hasTtl()) return false; - if (hasTtl()) { - if (!getTtl().equals(other.getTtl())) return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasTtl()) { - hash = (37 * hash) + TTL_FIELD_NUMBER; - hash = (53 * hash) + getTtl().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ExpirationPolicy parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ExpirationPolicy 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.ExpirationPolicy parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ExpirationPolicy 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.ExpirationPolicy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ExpirationPolicy parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ExpirationPolicy parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ExpirationPolicy 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.ExpirationPolicy parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ExpirationPolicy 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.ExpirationPolicy parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ExpirationPolicy 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.ExpirationPolicy 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 policy that specifies the conditions for resource expiration (i.e.,
-   * automatic resource deletion).
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ExpirationPolicy} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ExpirationPolicy) - com.google.pubsub.v1.ExpirationPolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ExpirationPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ExpirationPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ExpirationPolicy.class, - com.google.pubsub.v1.ExpirationPolicy.Builder.class); - } - - // Construct using com.google.pubsub.v1.ExpirationPolicy.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - ttl_ = null; - if (ttlBuilder_ != null) { - ttlBuilder_.dispose(); - ttlBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ExpirationPolicy_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ExpirationPolicy getDefaultInstanceForType() { - return com.google.pubsub.v1.ExpirationPolicy.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ExpirationPolicy build() { - com.google.pubsub.v1.ExpirationPolicy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ExpirationPolicy buildPartial() { - com.google.pubsub.v1.ExpirationPolicy result = - new com.google.pubsub.v1.ExpirationPolicy(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ExpirationPolicy result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ttl_ = ttlBuilder_ == null ? ttl_ : ttlBuilder_.build(); - } - } - - @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.ExpirationPolicy) { - return mergeFrom((com.google.pubsub.v1.ExpirationPolicy) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ExpirationPolicy other) { - if (other == com.google.pubsub.v1.ExpirationPolicy.getDefaultInstance()) return this; - if (other.hasTtl()) { - mergeTtl(other.getTtl()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getTtlFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.protobuf.Duration ttl_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - ttlBuilder_; - /** - * - * - *
-     * Specifies the "time-to-live" duration for an associated resource. The
-     * resource expires if it is not active for a period of `ttl`. The definition
-     * of "activity" depends on the type of the associated resource. The minimum
-     * and maximum allowed values for `ttl` depend on the type of the associated
-     * resource, as well. If `ttl` is not set, the associated resource never
-     * expires.
-     * 
- * - * .google.protobuf.Duration ttl = 1; - * - * @return Whether the ttl field is set. - */ - public boolean hasTtl() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * Specifies the "time-to-live" duration for an associated resource. The
-     * resource expires if it is not active for a period of `ttl`. The definition
-     * of "activity" depends on the type of the associated resource. The minimum
-     * and maximum allowed values for `ttl` depend on the type of the associated
-     * resource, as well. If `ttl` is not set, the associated resource never
-     * expires.
-     * 
- * - * .google.protobuf.Duration ttl = 1; - * - * @return The ttl. - */ - public com.google.protobuf.Duration getTtl() { - if (ttlBuilder_ == null) { - return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; - } else { - return ttlBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Specifies the "time-to-live" duration for an associated resource. The
-     * resource expires if it is not active for a period of `ttl`. The definition
-     * of "activity" depends on the type of the associated resource. The minimum
-     * and maximum allowed values for `ttl` depend on the type of the associated
-     * resource, as well. If `ttl` is not set, the associated resource never
-     * expires.
-     * 
- * - * .google.protobuf.Duration ttl = 1; - */ - public Builder setTtl(com.google.protobuf.Duration value) { - if (ttlBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ttl_ = value; - } else { - ttlBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Specifies the "time-to-live" duration for an associated resource. The
-     * resource expires if it is not active for a period of `ttl`. The definition
-     * of "activity" depends on the type of the associated resource. The minimum
-     * and maximum allowed values for `ttl` depend on the type of the associated
-     * resource, as well. If `ttl` is not set, the associated resource never
-     * expires.
-     * 
- * - * .google.protobuf.Duration ttl = 1; - */ - public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { - if (ttlBuilder_ == null) { - ttl_ = builderForValue.build(); - } else { - ttlBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Specifies the "time-to-live" duration for an associated resource. The
-     * resource expires if it is not active for a period of `ttl`. The definition
-     * of "activity" depends on the type of the associated resource. The minimum
-     * and maximum allowed values for `ttl` depend on the type of the associated
-     * resource, as well. If `ttl` is not set, the associated resource never
-     * expires.
-     * 
- * - * .google.protobuf.Duration ttl = 1; - */ - public Builder mergeTtl(com.google.protobuf.Duration value) { - if (ttlBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) - && ttl_ != null - && ttl_ != com.google.protobuf.Duration.getDefaultInstance()) { - getTtlBuilder().mergeFrom(value); - } else { - ttl_ = value; - } - } else { - ttlBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Specifies the "time-to-live" duration for an associated resource. The
-     * resource expires if it is not active for a period of `ttl`. The definition
-     * of "activity" depends on the type of the associated resource. The minimum
-     * and maximum allowed values for `ttl` depend on the type of the associated
-     * resource, as well. If `ttl` is not set, the associated resource never
-     * expires.
-     * 
- * - * .google.protobuf.Duration ttl = 1; - */ - public Builder clearTtl() { - bitField0_ = (bitField0_ & ~0x00000001); - ttl_ = null; - if (ttlBuilder_ != null) { - ttlBuilder_.dispose(); - ttlBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Specifies the "time-to-live" duration for an associated resource. The
-     * resource expires if it is not active for a period of `ttl`. The definition
-     * of "activity" depends on the type of the associated resource. The minimum
-     * and maximum allowed values for `ttl` depend on the type of the associated
-     * resource, as well. If `ttl` is not set, the associated resource never
-     * expires.
-     * 
- * - * .google.protobuf.Duration ttl = 1; - */ - public com.google.protobuf.Duration.Builder getTtlBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getTtlFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Specifies the "time-to-live" duration for an associated resource. The
-     * resource expires if it is not active for a period of `ttl`. The definition
-     * of "activity" depends on the type of the associated resource. The minimum
-     * and maximum allowed values for `ttl` depend on the type of the associated
-     * resource, as well. If `ttl` is not set, the associated resource never
-     * expires.
-     * 
- * - * .google.protobuf.Duration ttl = 1; - */ - public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { - if (ttlBuilder_ != null) { - return ttlBuilder_.getMessageOrBuilder(); - } else { - return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; - } - } - /** - * - * - *
-     * Specifies the "time-to-live" duration for an associated resource. The
-     * resource expires if it is not active for a period of `ttl`. The definition
-     * of "activity" depends on the type of the associated resource. The minimum
-     * and maximum allowed values for `ttl` depend on the type of the associated
-     * resource, as well. If `ttl` is not set, the associated resource never
-     * expires.
-     * 
- * - * .google.protobuf.Duration ttl = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getTtlFieldBuilder() { - if (ttlBuilder_ == null) { - ttlBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>(getTtl(), getParentForChildren(), isClean()); - ttl_ = null; - } - return ttlBuilder_; - } - - @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.ExpirationPolicy) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ExpirationPolicy) - private static final com.google.pubsub.v1.ExpirationPolicy DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ExpirationPolicy(); - } - - public static com.google.pubsub.v1.ExpirationPolicy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ExpirationPolicy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ExpirationPolicy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ExpirationPolicyOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ExpirationPolicyOrBuilder.java deleted file mode 100644 index 1b35de3b7..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ExpirationPolicyOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2023 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 ExpirationPolicyOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ExpirationPolicy) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Specifies the "time-to-live" duration for an associated resource. The
-   * resource expires if it is not active for a period of `ttl`. The definition
-   * of "activity" depends on the type of the associated resource. The minimum
-   * and maximum allowed values for `ttl` depend on the type of the associated
-   * resource, as well. If `ttl` is not set, the associated resource never
-   * expires.
-   * 
- * - * .google.protobuf.Duration ttl = 1; - * - * @return Whether the ttl field is set. - */ - boolean hasTtl(); - /** - * - * - *
-   * Specifies the "time-to-live" duration for an associated resource. The
-   * resource expires if it is not active for a period of `ttl`. The definition
-   * of "activity" depends on the type of the associated resource. The minimum
-   * and maximum allowed values for `ttl` depend on the type of the associated
-   * resource, as well. If `ttl` is not set, the associated resource never
-   * expires.
-   * 
- * - * .google.protobuf.Duration ttl = 1; - * - * @return The ttl. - */ - com.google.protobuf.Duration getTtl(); - /** - * - * - *
-   * Specifies the "time-to-live" duration for an associated resource. The
-   * resource expires if it is not active for a period of `ttl`. The definition
-   * of "activity" depends on the type of the associated resource. The minimum
-   * and maximum allowed values for `ttl` depend on the type of the associated
-   * resource, as well. If `ttl` is not set, the associated resource never
-   * expires.
-   * 
- * - * .google.protobuf.Duration ttl = 1; - */ - com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); -} 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 deleted file mode 100644 index 61bf3ff17..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequest.java +++ /dev/null @@ -1,795 +0,0 @@ -/* - * Copyright 2023 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(); - } - - 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; - - @SuppressWarnings("serial") - 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_ = 0; - /** - * - * - *
-   * The set of fields to return in the response. If not set, returns a Schema
-   * with all fields filled out. Set to `BASIC` to omit the `definition`.
-   * 
- * - * .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 all fields filled out. Set to `BASIC` to omit the `definition`.
-   * 
- * - * .google.pubsub.v1.SchemaView view = 2; - * - * @return The view. - */ - @java.lang.Override - public com.google.pubsub.v1.SchemaView getView() { - com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.forNumber(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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (view_ != com.google.pubsub.v1.SchemaView.SCHEMA_VIEW_UNSPECIFIED.getNumber()) { - output.writeEnum(2, view_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - 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 += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - 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); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.GetSchemaRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.view_ = view_; - } - } - - @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_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.view_ != 0) { - setViewValue(other.getViewValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - view_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - 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; - bitField0_ |= 0x00000001; - 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(); - bitField0_ = (bitField0_ & ~0x00000001); - 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private int view_ = 0; - /** - * - * - *
-     * The set of fields to return in the response. If not set, returns a Schema
-     * with all fields filled out. Set to `BASIC` to omit the `definition`.
-     * 
- * - * .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 all fields filled out. Set to `BASIC` to omit the `definition`.
-     * 
- * - * .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; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The set of fields to return in the response. If not set, returns a Schema
-     * with all fields filled out. Set to `BASIC` to omit the `definition`.
-     * 
- * - * .google.pubsub.v1.SchemaView view = 2; - * - * @return The view. - */ - @java.lang.Override - public com.google.pubsub.v1.SchemaView getView() { - com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.forNumber(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 all fields filled out. Set to `BASIC` to omit the `definition`.
-     * 
- * - * .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(); - } - bitField0_ |= 0x00000002; - view_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * The set of fields to return in the response. If not set, returns a Schema
-     * with all fields filled out. Set to `BASIC` to omit the `definition`.
-     * 
- * - * .google.pubsub.v1.SchemaView view = 2; - * - * @return This builder for chaining. - */ - public Builder clearView() { - bitField0_ = (bitField0_ & ~0x00000002); - 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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index 2ec773994..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequestOrBuilder.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2023 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 all fields filled out. Set to `BASIC` to omit the `definition`.
-   * 
- * - * .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 all fields filled out. Set to `BASIC` to omit the `definition`.
-   * 
- * - * .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/GetSnapshotRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequest.java deleted file mode 100644 index 1953ee97c..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequest.java +++ /dev/null @@ -1,643 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the GetSnapshot method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.GetSnapshotRequest} - */ -public final class GetSnapshotRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.GetSnapshotRequest) - GetSnapshotRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetSnapshotRequest.newBuilder() to construct. - private GetSnapshotRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetSnapshotRequest() { - snapshot_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetSnapshotRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetSnapshotRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetSnapshotRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.GetSnapshotRequest.class, - com.google.pubsub.v1.GetSnapshotRequest.Builder.class); - } - - public static final int SNAPSHOT_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object snapshot_ = ""; - /** - * - * - *
-   * Required. The name of the snapshot to get.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The snapshot. - */ - @java.lang.Override - public java.lang.String getSnapshot() { - java.lang.Object ref = snapshot_; - 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(); - snapshot_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the snapshot to get.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for snapshot. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSnapshotBytes() { - java.lang.Object ref = snapshot_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - snapshot_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshot_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, snapshot_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshot_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, snapshot_); - } - size += getUnknownFields().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.GetSnapshotRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.GetSnapshotRequest other = (com.google.pubsub.v1.GetSnapshotRequest) obj; - - if (!getSnapshot().equals(other.getSnapshot())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SNAPSHOT_FIELD_NUMBER; - hash = (53 * hash) + getSnapshot().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.GetSnapshotRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.GetSnapshotRequest 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.GetSnapshotRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.GetSnapshotRequest 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.GetSnapshotRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.GetSnapshotRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.GetSnapshotRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.GetSnapshotRequest 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.GetSnapshotRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.GetSnapshotRequest 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.GetSnapshotRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.GetSnapshotRequest 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.GetSnapshotRequest 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 GetSnapshot method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.GetSnapshotRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.GetSnapshotRequest) - com.google.pubsub.v1.GetSnapshotRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetSnapshotRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetSnapshotRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.GetSnapshotRequest.class, - com.google.pubsub.v1.GetSnapshotRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.GetSnapshotRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - snapshot_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetSnapshotRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.GetSnapshotRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.GetSnapshotRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.GetSnapshotRequest build() { - com.google.pubsub.v1.GetSnapshotRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.GetSnapshotRequest buildPartial() { - com.google.pubsub.v1.GetSnapshotRequest result = - new com.google.pubsub.v1.GetSnapshotRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.GetSnapshotRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.snapshot_ = snapshot_; - } - } - - @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.GetSnapshotRequest) { - return mergeFrom((com.google.pubsub.v1.GetSnapshotRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.GetSnapshotRequest other) { - if (other == com.google.pubsub.v1.GetSnapshotRequest.getDefaultInstance()) return this; - if (!other.getSnapshot().isEmpty()) { - snapshot_ = other.snapshot_; - bitField0_ |= 0x00000001; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - snapshot_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object snapshot_ = ""; - /** - * - * - *
-     * Required. The name of the snapshot to get.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The snapshot. - */ - public java.lang.String getSnapshot() { - java.lang.Object ref = snapshot_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - snapshot_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the snapshot to get.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for snapshot. - */ - public com.google.protobuf.ByteString getSnapshotBytes() { - java.lang.Object ref = snapshot_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - snapshot_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the snapshot to get.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The snapshot to set. - * @return This builder for chaining. - */ - public Builder setSnapshot(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - snapshot_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the snapshot to get.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSnapshot() { - snapshot_ = getDefaultInstance().getSnapshot(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the snapshot to get.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for snapshot to set. - * @return This builder for chaining. - */ - public Builder setSnapshotBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - snapshot_ = value; - bitField0_ |= 0x00000001; - 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.GetSnapshotRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.GetSnapshotRequest) - private static final com.google.pubsub.v1.GetSnapshotRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.GetSnapshotRequest(); - } - - public static com.google.pubsub.v1.GetSnapshotRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetSnapshotRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.GetSnapshotRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequestOrBuilder.java deleted file mode 100644 index 9eecf39ab..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequestOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2023 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 GetSnapshotRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.GetSnapshotRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the snapshot to get.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The snapshot. - */ - java.lang.String getSnapshot(); - /** - * - * - *
-   * Required. The name of the snapshot to get.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * - * string snapshot = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for snapshot. - */ - com.google.protobuf.ByteString getSnapshotBytes(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java deleted file mode 100644 index 66577cd6c..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java +++ /dev/null @@ -1,644 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the GetSubscription method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.GetSubscriptionRequest} - */ -public final class GetSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.GetSubscriptionRequest) - GetSubscriptionRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetSubscriptionRequest.newBuilder() to construct. - private GetSubscriptionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetSubscriptionRequest() { - subscription_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetSubscriptionRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetSubscriptionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.GetSubscriptionRequest.class, - com.google.pubsub.v1.GetSubscriptionRequest.Builder.class); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object subscription_ = ""; - /** - * - * - *
-   * Required. The name of the subscription to get.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - @java.lang.Override - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - 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(); - subscription_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the subscription to get.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_); - } - size += getUnknownFields().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.GetSubscriptionRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.GetSubscriptionRequest other = - (com.google.pubsub.v1.GetSubscriptionRequest) obj; - - if (!getSubscription().equals(other.getSubscription())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.GetSubscriptionRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.GetSubscriptionRequest 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.GetSubscriptionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.GetSubscriptionRequest 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.GetSubscriptionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.GetSubscriptionRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.GetSubscriptionRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.GetSubscriptionRequest 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.GetSubscriptionRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.GetSubscriptionRequest 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.GetSubscriptionRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.GetSubscriptionRequest 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.GetSubscriptionRequest 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 GetSubscription method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.GetSubscriptionRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.GetSubscriptionRequest) - com.google.pubsub.v1.GetSubscriptionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetSubscriptionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.GetSubscriptionRequest.class, - com.google.pubsub.v1.GetSubscriptionRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.GetSubscriptionRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscription_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.GetSubscriptionRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.GetSubscriptionRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.GetSubscriptionRequest build() { - com.google.pubsub.v1.GetSubscriptionRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.GetSubscriptionRequest buildPartial() { - com.google.pubsub.v1.GetSubscriptionRequest result = - new com.google.pubsub.v1.GetSubscriptionRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.GetSubscriptionRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.subscription_ = subscription_; - } - } - - @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.GetSubscriptionRequest) { - return mergeFrom((com.google.pubsub.v1.GetSubscriptionRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.GetSubscriptionRequest other) { - if (other == com.google.pubsub.v1.GetSubscriptionRequest.getDefaultInstance()) return this; - if (!other.getSubscription().isEmpty()) { - subscription_ = other.subscription_; - bitField0_ |= 0x00000001; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - subscription_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object subscription_ = ""; - /** - * - * - *
-     * Required. The name of the subscription to get.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the subscription to get.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the subscription to get.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the subscription to get.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSubscription() { - subscription_ = getDefaultInstance().getSubscription(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the subscription to get.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - subscription_ = value; - bitField0_ |= 0x00000001; - 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.GetSubscriptionRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.GetSubscriptionRequest) - private static final com.google.pubsub.v1.GetSubscriptionRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.GetSubscriptionRequest(); - } - - public static com.google.pubsub.v1.GetSubscriptionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetSubscriptionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.GetSubscriptionRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequestOrBuilder.java deleted file mode 100644 index bc2288db3..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequestOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2023 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 GetSubscriptionRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.GetSubscriptionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the subscription to get.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - java.lang.String getSubscription(); - /** - * - * - *
-   * Required. The name of the subscription to get.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - com.google.protobuf.ByteString getSubscriptionBytes(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequest.java deleted file mode 100644 index 59b81305a..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequest.java +++ /dev/null @@ -1,641 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the GetTopic method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.GetTopicRequest} - */ -public final class GetTopicRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.GetTopicRequest) - GetTopicRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetTopicRequest.newBuilder() to construct. - private GetTopicRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetTopicRequest() { - topic_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetTopicRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetTopicRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetTopicRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.GetTopicRequest.class, - com.google.pubsub.v1.GetTopicRequest.Builder.class); - } - - public static final int TOPIC_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object topic_ = ""; - /** - * - * - *
-   * Required. The name of the topic to get.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - @java.lang.Override - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - 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(); - topic_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the topic to get.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_); - } - size += getUnknownFields().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.GetTopicRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.GetTopicRequest other = (com.google.pubsub.v1.GetTopicRequest) obj; - - if (!getTopic().equals(other.getTopic())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getTopic().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.GetTopicRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.GetTopicRequest 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.GetTopicRequest parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.GetTopicRequest 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.GetTopicRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.GetTopicRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.GetTopicRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.GetTopicRequest 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.GetTopicRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.GetTopicRequest 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.GetTopicRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.GetTopicRequest 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.GetTopicRequest 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 GetTopic method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.GetTopicRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.GetTopicRequest) - com.google.pubsub.v1.GetTopicRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetTopicRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetTopicRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.GetTopicRequest.class, - com.google.pubsub.v1.GetTopicRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.GetTopicRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - topic_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_GetTopicRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.GetTopicRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.GetTopicRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.GetTopicRequest build() { - com.google.pubsub.v1.GetTopicRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.GetTopicRequest buildPartial() { - com.google.pubsub.v1.GetTopicRequest result = new com.google.pubsub.v1.GetTopicRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.GetTopicRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.topic_ = topic_; - } - } - - @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.GetTopicRequest) { - return mergeFrom((com.google.pubsub.v1.GetTopicRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.GetTopicRequest other) { - if (other == com.google.pubsub.v1.GetTopicRequest.getDefaultInstance()) return this; - if (!other.getTopic().isEmpty()) { - topic_ = other.topic_; - bitField0_ |= 0x00000001; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - topic_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object topic_ = ""; - /** - * - * - *
-     * Required. The name of the topic to get.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - topic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the topic to get.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the topic to get.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The topic to set. - * @return This builder for chaining. - */ - public Builder setTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - topic_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the topic to get.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearTopic() { - topic_ = getDefaultInstance().getTopic(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the topic to get.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for topic to set. - * @return This builder for chaining. - */ - public Builder setTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - topic_ = value; - bitField0_ |= 0x00000001; - 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.GetTopicRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.GetTopicRequest) - private static final com.google.pubsub.v1.GetTopicRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.GetTopicRequest(); - } - - public static com.google.pubsub.v1.GetTopicRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetTopicRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.GetTopicRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequestOrBuilder.java deleted file mode 100644 index 72ce889da..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequestOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2023 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 GetTopicRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.GetTopicRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the topic to get.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - java.lang.String getTopic(); - /** - * - * - *
-   * Required. The name of the topic to get.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - com.google.protobuf.ByteString getTopicBytes(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsRequest.java deleted file mode 100644 index cba091850..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsRequest.java +++ /dev/null @@ -1,1080 +0,0 @@ -/* - * Copyright 2023 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 `ListSchemaRevisions` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListSchemaRevisionsRequest} - */ -public final class ListSchemaRevisionsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListSchemaRevisionsRequest) - ListSchemaRevisionsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListSchemaRevisionsRequest.newBuilder() to construct. - private ListSchemaRevisionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListSchemaRevisionsRequest() { - name_ = ""; - view_ = 0; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListSchemaRevisionsRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_ListSchemaRevisionsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_ListSchemaRevisionsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSchemaRevisionsRequest.class, - com.google.pubsub.v1.ListSchemaRevisionsRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * Required. The name of the schema to list revisions for.
-   * 
- * - * - * 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 list revisions for.
-   * 
- * - * - * 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_ = 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; - * - * @return The view. - */ - @java.lang.Override - public com.google.pubsub.v1.SchemaView getView() { - com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.forNumber(view_); - return result == null ? com.google.pubsub.v1.SchemaView.UNRECOGNIZED : result; - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 3; - private int pageSize_ = 0; - /** - * - * - *
-   * The maximum number of revisions to return per page.
-   * 
- * - * int32 page_size = 3; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 4; - - @SuppressWarnings("serial") - private volatile java.lang.Object pageToken_ = ""; - /** - * - * - *
-   * The page token, received from a previous ListSchemaRevisions call.
-   * Provide this to retrieve the subsequent page.
-   * 
- * - * 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 page token, received from a previous ListSchemaRevisions call.
-   * Provide this to retrieve the subsequent page.
-   * 
- * - * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (view_ != com.google.pubsub.v1.SchemaView.SCHEMA_VIEW_UNSPECIFIED.getNumber()) { - output.writeEnum(2, view_); - } - if (pageSize_ != 0) { - output.writeInt32(3, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - 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_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); - } - size += getUnknownFields().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.ListSchemaRevisionsRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListSchemaRevisionsRequest other = - (com.google.pubsub.v1.ListSchemaRevisionsRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (view_ != other.view_) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListSchemaRevisionsRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsRequest 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.ListSchemaRevisionsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsRequest 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.ListSchemaRevisionsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsRequest 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.ListSchemaRevisionsRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsRequest 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.ListSchemaRevisionsRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsRequest 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.ListSchemaRevisionsRequest 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 `ListSchemaRevisions` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListSchemaRevisionsRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListSchemaRevisionsRequest) - com.google.pubsub.v1.ListSchemaRevisionsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_ListSchemaRevisionsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_ListSchemaRevisionsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSchemaRevisionsRequest.class, - com.google.pubsub.v1.ListSchemaRevisionsRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListSchemaRevisionsRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - 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_ListSchemaRevisionsRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSchemaRevisionsRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.ListSchemaRevisionsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListSchemaRevisionsRequest build() { - com.google.pubsub.v1.ListSchemaRevisionsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSchemaRevisionsRequest buildPartial() { - com.google.pubsub.v1.ListSchemaRevisionsRequest result = - new com.google.pubsub.v1.ListSchemaRevisionsRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ListSchemaRevisionsRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.view_ = view_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pageSize_ = pageSize_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.pageToken_ = pageToken_; - } - } - - @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.ListSchemaRevisionsRequest) { - return mergeFrom((com.google.pubsub.v1.ListSchemaRevisionsRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListSchemaRevisionsRequest other) { - if (other == com.google.pubsub.v1.ListSchemaRevisionsRequest.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.view_ != 0) { - setViewValue(other.getViewValue()); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - bitField0_ |= 0x00000008; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - view_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: - { - pageSize_ = input.readInt32(); - bitField0_ |= 0x00000004; - break; - } // case 24 - case 34: - { - pageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; - break; - } // case 34 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The name of the schema to list revisions for.
-     * 
- * - * - * 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 list revisions for.
-     * 
- * - * - * 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 list revisions for.
-     * 
- * - * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the schema to list revisions for.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the schema to list revisions for.
-     * 
- * - * - * 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; - bitField0_ |= 0x00000001; - 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; - bitField0_ |= 0x00000002; - 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() { - com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.forNumber(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(); - } - bitField0_ |= 0x00000002; - 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() { - bitField0_ = (bitField0_ & ~0x00000002); - view_ = 0; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * The maximum number of revisions to return per page.
-     * 
- * - * int32 page_size = 3; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * The maximum number of revisions to return per page.
-     * 
- * - * int32 page_size = 3; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum number of revisions to return per page.
-     * 
- * - * int32 page_size = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - bitField0_ = (bitField0_ & ~0x00000004); - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * The page token, received from a previous ListSchemaRevisions call.
-     * Provide this to retrieve the subsequent page.
-     * 
- * - * 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 page token, received from a previous ListSchemaRevisions call.
-     * Provide this to retrieve the subsequent page.
-     * 
- * - * 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 page token, received from a previous ListSchemaRevisions call.
-     * Provide this to retrieve the subsequent page.
-     * 
- * - * 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; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * The page token, received from a previous ListSchemaRevisions call.
-     * Provide this to retrieve the subsequent page.
-     * 
- * - * string page_token = 4; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - * - * - *
-     * The page token, received from a previous ListSchemaRevisions call.
-     * Provide this to retrieve the subsequent page.
-     * 
- * - * 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; - bitField0_ |= 0x00000008; - 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.ListSchemaRevisionsRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSchemaRevisionsRequest) - private static final com.google.pubsub.v1.ListSchemaRevisionsRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListSchemaRevisionsRequest(); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListSchemaRevisionsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListSchemaRevisionsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsRequestOrBuilder.java deleted file mode 100644 index 13e6188f6..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsRequestOrBuilder.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2023 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 ListSchemaRevisionsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListSchemaRevisionsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the schema to list revisions for.
-   * 
- * - * - * 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 list revisions for.
-   * 
- * - * - * 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 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(); - - /** - * - * - *
-   * The maximum number of revisions to return per page.
-   * 
- * - * int32 page_size = 3; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * The page token, received from a previous ListSchemaRevisions call.
-   * Provide this to retrieve the subsequent page.
-   * 
- * - * string page_token = 4; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * The page token, received from a previous ListSchemaRevisions call.
-   * Provide this to retrieve the subsequent page.
-   * 
- * - * 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/ListSchemaRevisionsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsResponse.java deleted file mode 100644 index da0e793f1..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsResponse.java +++ /dev/null @@ -1,1117 +0,0 @@ -/* - * Copyright 2023 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 `ListSchemaRevisions` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListSchemaRevisionsResponse} - */ -public final class ListSchemaRevisionsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListSchemaRevisionsResponse) - ListSchemaRevisionsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListSchemaRevisionsResponse.newBuilder() to construct. - private ListSchemaRevisionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListSchemaRevisionsResponse() { - schemas_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListSchemaRevisionsResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_ListSchemaRevisionsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_ListSchemaRevisionsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSchemaRevisionsResponse.class, - com.google.pubsub.v1.ListSchemaRevisionsResponse.Builder.class); - } - - public static final int SCHEMAS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private java.util.List schemas_; - /** - * - * - *
-   * The revisions of the schema.
-   * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - @java.lang.Override - public java.util.List getSchemasList() { - return schemas_; - } - /** - * - * - *
-   * The revisions of the schema.
-   * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - @java.lang.Override - public java.util.List getSchemasOrBuilderList() { - return schemas_; - } - /** - * - * - *
-   * The revisions of the schema.
-   * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - @java.lang.Override - public int getSchemasCount() { - return schemas_.size(); - } - /** - * - * - *
-   * The revisions of the schema.
-   * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.Schema getSchemas(int index) { - return schemas_.get(index); - } - /** - * - * - *
-   * The revisions of the schema.
-   * 
- * - * 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; - - @SuppressWarnings("serial") - private volatile java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-   * A token that can be sent as `page_token` to retrieve the next page.
-   * If this field is empty, there are no subsequent pages.
-   * 
- * - * 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; - } - } - /** - * - * - *
-   * A token that can be sent as `page_token` to retrieve the next page.
-   * If this field is empty, there are no subsequent pages.
-   * 
- * - * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - getUnknownFields().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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += getUnknownFields().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.ListSchemaRevisionsResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListSchemaRevisionsResponse other = - (com.google.pubsub.v1.ListSchemaRevisionsResponse) obj; - - if (!getSchemasList().equals(other.getSchemasList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListSchemaRevisionsResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsResponse 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.ListSchemaRevisionsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsResponse 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.ListSchemaRevisionsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsResponse 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.ListSchemaRevisionsResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsResponse 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.ListSchemaRevisionsResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsResponse 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.ListSchemaRevisionsResponse 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 `ListSchemaRevisions` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListSchemaRevisionsResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListSchemaRevisionsResponse) - com.google.pubsub.v1.ListSchemaRevisionsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_ListSchemaRevisionsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_ListSchemaRevisionsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSchemaRevisionsResponse.class, - com.google.pubsub.v1.ListSchemaRevisionsResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListSchemaRevisionsResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (schemasBuilder_ == null) { - schemas_ = java.util.Collections.emptyList(); - } else { - schemas_ = null; - schemasBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - nextPageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_ListSchemaRevisionsResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSchemaRevisionsResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.ListSchemaRevisionsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListSchemaRevisionsResponse build() { - com.google.pubsub.v1.ListSchemaRevisionsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSchemaRevisionsResponse buildPartial() { - com.google.pubsub.v1.ListSchemaRevisionsResponse result = - new com.google.pubsub.v1.ListSchemaRevisionsResponse(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields( - com.google.pubsub.v1.ListSchemaRevisionsResponse result) { - if (schemasBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - schemas_ = java.util.Collections.unmodifiableList(schemas_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.schemas_ = schemas_; - } else { - result.schemas_ = schemasBuilder_.build(); - } - } - - private void buildPartial0(com.google.pubsub.v1.ListSchemaRevisionsResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nextPageToken_ = nextPageToken_; - } - } - - @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.ListSchemaRevisionsResponse) { - return mergeFrom((com.google.pubsub.v1.ListSchemaRevisionsResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListSchemaRevisionsResponse other) { - if (other == com.google.pubsub.v1.ListSchemaRevisionsResponse.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_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.pubsub.v1.Schema m = - input.readMessage(com.google.pubsub.v1.Schema.parser(), extensionRegistry); - if (schemasBuilder_ == null) { - ensureSchemasIsMutable(); - schemas_.add(m); - } else { - schemasBuilder_.addMessage(m); - } - break; - } // case 10 - case 18: - { - nextPageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - public int getSchemasCount() { - if (schemasBuilder_ == null) { - return schemas_.size(); - } else { - return schemasBuilder_.getCount(); - } - } - /** - * - * - *
-     * The revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - public com.google.pubsub.v1.Schema.Builder getSchemasBuilder(int index) { - return getSchemasFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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 revisions of the schema.
-     * 
- * - * 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_ = ""; - /** - * - * - *
-     * A token that can be sent as `page_token` to retrieve the next page.
-     * If this field is empty, there are no subsequent pages.
-     * 
- * - * 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; - } - } - /** - * - * - *
-     * A token that can be sent as `page_token` to retrieve the next page.
-     * If this field is empty, there are no subsequent pages.
-     * 
- * - * 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; - } - } - /** - * - * - *
-     * A token that can be sent as `page_token` to retrieve the next page.
-     * If this field is empty, there are no subsequent pages.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * A token that can be sent as `page_token` to retrieve the next page.
-     * If this field is empty, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * A token that can be sent as `page_token` to retrieve the next page.
-     * If this field is empty, there are no subsequent pages.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - 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.ListSchemaRevisionsResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSchemaRevisionsResponse) - private static final com.google.pubsub.v1.ListSchemaRevisionsResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListSchemaRevisionsResponse(); - } - - public static com.google.pubsub.v1.ListSchemaRevisionsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListSchemaRevisionsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListSchemaRevisionsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsResponseOrBuilder.java deleted file mode 100644 index 49517becb..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemaRevisionsResponseOrBuilder.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2023 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 ListSchemaRevisionsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListSchemaRevisionsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The revisions of the schema.
-   * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - java.util.List getSchemasList(); - /** - * - * - *
-   * The revisions of the schema.
-   * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - com.google.pubsub.v1.Schema getSchemas(int index); - /** - * - * - *
-   * The revisions of the schema.
-   * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - int getSchemasCount(); - /** - * - * - *
-   * The revisions of the schema.
-   * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - java.util.List getSchemasOrBuilderList(); - /** - * - * - *
-   * The revisions of the schema.
-   * 
- * - * repeated .google.pubsub.v1.Schema schemas = 1; - */ - com.google.pubsub.v1.SchemaOrBuilder getSchemasOrBuilder(int index); - - /** - * - * - *
-   * A token that can be sent as `page_token` to retrieve the next page.
-   * If this field is empty, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * A token that can be sent as `page_token` to retrieve the next page.
-   * If this field is empty, there are no subsequent pages.
-   * 
- * - * 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/ListSchemasRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequest.java deleted file mode 100644 index 11cb59d07..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequest.java +++ /dev/null @@ -1,1092 +0,0 @@ -/* - * Copyright 2023 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(); - } - - 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; - - @SuppressWarnings("serial") - 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_ = 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; - * - * @return The view. - */ - @java.lang.Override - public com.google.pubsub.v1.SchemaView getView() { - com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.forNumber(view_); - return result == null ? com.google.pubsub.v1.SchemaView.UNRECOGNIZED : result; - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 3; - private int pageSize_ = 0; - /** - * - * - *
-   * 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; - - @SuppressWarnings("serial") - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); - } - size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - 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); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ListSchemasRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.parent_ = parent_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.view_ = view_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pageSize_ = pageSize_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.pageToken_ = pageToken_; - } - } - - @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_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.view_ != 0) { - setViewValue(other.getViewValue()); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - bitField0_ |= 0x00000008; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - parent_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - view_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: - { - pageSize_ = input.readInt32(); - bitField0_ |= 0x00000004; - break; - } // case 24 - case 34: - { - pageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; - break; - } // case 34 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - 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; - bitField0_ |= 0x00000001; - 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(); - bitField0_ = (bitField0_ & ~0x00000001); - 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; - bitField0_ |= 0x00000001; - 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; - bitField0_ |= 0x00000002; - 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() { - com.google.pubsub.v1.SchemaView result = com.google.pubsub.v1.SchemaView.forNumber(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(); - } - bitField0_ |= 0x00000002; - 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() { - bitField0_ = (bitField0_ & ~0x00000002); - 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; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of schemas to return.
-     * 
- * - * int32 page_size = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - bitField0_ = (bitField0_ & ~0x00000004); - 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; - bitField0_ |= 0x00000008; - 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(); - bitField0_ = (bitField0_ & ~0x00000008); - 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; - bitField0_ |= 0x00000008; - 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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index 9c69b0a4b..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequestOrBuilder.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2023 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 deleted file mode 100644 index 969592443..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponse.java +++ /dev/null @@ -1,1114 +0,0 @@ -/* - * Copyright 2023 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(); - } - - 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; - - @SuppressWarnings("serial") - 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; - - @SuppressWarnings("serial") - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - getUnknownFields().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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (schemasBuilder_ == null) { - schemas_ = java.util.Collections.emptyList(); - } else { - schemas_ = null; - schemasBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - 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); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(com.google.pubsub.v1.ListSchemasResponse result) { - if (schemasBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - schemas_ = java.util.Collections.unmodifiableList(schemas_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.schemas_ = schemas_; - } else { - result.schemas_ = schemasBuilder_.build(); - } - } - - private void buildPartial0(com.google.pubsub.v1.ListSchemasResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nextPageToken_ = nextPageToken_; - } - } - - @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_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.pubsub.v1.Schema m = - input.readMessage(com.google.pubsub.v1.Schema.parser(), extensionRegistry); - if (schemasBuilder_ == null) { - ensureSchemasIsMutable(); - schemas_.add(m); - } else { - schemasBuilder_.addMessage(m); - } - break; - } // case 10 - case 18: - { - nextPageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - 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; - bitField0_ |= 0x00000002; - 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(); - bitField0_ = (bitField0_ & ~0x00000002); - 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; - bitField0_ |= 0x00000002; - 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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index ca5c661c1..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponseOrBuilder.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2023 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/ListSnapshotsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequest.java deleted file mode 100644 index d2b19ce97..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequest.java +++ /dev/null @@ -1,933 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `ListSnapshots` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListSnapshotsRequest} - */ -public final class ListSnapshotsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListSnapshotsRequest) - ListSnapshotsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListSnapshotsRequest.newBuilder() to construct. - private ListSnapshotsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListSnapshotsRequest() { - project_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListSnapshotsRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSnapshotsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSnapshotsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSnapshotsRequest.class, - com.google.pubsub.v1.ListSnapshotsRequest.Builder.class); - } - - public static final int PROJECT_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object project_ = ""; - /** - * - * - *
-   * Required. The name of the project in which to list snapshots.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - @java.lang.Override - public java.lang.String getProject() { - java.lang.Object ref = project_; - 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(); - project_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the project in which to list snapshots.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_ = 0; - /** - * - * - *
-   * Maximum number of snapshots to return.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object pageToken_ = ""; - /** - * - * - *
-   * The value returned by the last `ListSnapshotsResponse`; indicates that this
-   * is a continuation of a prior `ListSnapshots` call, and that the system
-   * should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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 `ListSnapshotsResponse`; indicates that this
-   * is a continuation of a prior `ListSnapshots` call, and that the system
-   * should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += getUnknownFields().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.ListSnapshotsRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListSnapshotsRequest other = - (com.google.pubsub.v1.ListSnapshotsRequest) obj; - - if (!getProject().equals(other.getProject())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getProject().hashCode(); - 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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListSnapshotsRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSnapshotsRequest 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.ListSnapshotsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSnapshotsRequest 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.ListSnapshotsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSnapshotsRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListSnapshotsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSnapshotsRequest 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.ListSnapshotsRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSnapshotsRequest 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.ListSnapshotsRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSnapshotsRequest 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.ListSnapshotsRequest 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 `ListSnapshots` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListSnapshotsRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListSnapshotsRequest) - com.google.pubsub.v1.ListSnapshotsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSnapshotsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSnapshotsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSnapshotsRequest.class, - com.google.pubsub.v1.ListSnapshotsRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListSnapshotsRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - project_ = ""; - pageSize_ = 0; - pageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSnapshotsRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSnapshotsRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.ListSnapshotsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListSnapshotsRequest build() { - com.google.pubsub.v1.ListSnapshotsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSnapshotsRequest buildPartial() { - com.google.pubsub.v1.ListSnapshotsRequest result = - new com.google.pubsub.v1.ListSnapshotsRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ListSnapshotsRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.project_ = project_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.pageSize_ = pageSize_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pageToken_ = pageToken_; - } - } - - @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.ListSnapshotsRequest) { - return mergeFrom((com.google.pubsub.v1.ListSnapshotsRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListSnapshotsRequest other) { - if (other == com.google.pubsub.v1.ListSnapshotsRequest.getDefaultInstance()) return this; - if (!other.getProject().isEmpty()) { - project_ = other.project_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - bitField0_ |= 0x00000004; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - project_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - pageSize_ = input.readInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: - { - pageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object project_ = ""; - /** - * - * - *
-     * Required. The name of the project in which to list snapshots.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the project in which to list snapshots.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the project in which to list snapshots.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The project to set. - * @return This builder for chaining. - */ - public Builder setProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - project_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the project in which to list snapshots.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearProject() { - project_ = getDefaultInstance().getProject(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the project in which to list snapshots.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for project to set. - * @return This builder for chaining. - */ - public Builder setProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - project_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * Maximum number of snapshots to return.
-     * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * Maximum number of snapshots to return.
-     * 
- * - * int32 page_size = 2; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of snapshots to return.
-     * 
- * - * int32 page_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - bitField0_ = (bitField0_ & ~0x00000002); - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * The value returned by the last `ListSnapshotsResponse`; indicates that this
-     * is a continuation of a prior `ListSnapshots` call, and that the system
-     * should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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 `ListSnapshotsResponse`; indicates that this
-     * is a continuation of a prior `ListSnapshots` call, and that the system
-     * should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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 `ListSnapshotsResponse`; indicates that this
-     * is a continuation of a prior `ListSnapshots` call, and that the system
-     * should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The value returned by the last `ListSnapshotsResponse`; indicates that this
-     * is a continuation of a prior `ListSnapshots` call, and that the system
-     * should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-     * The value returned by the last `ListSnapshotsResponse`; indicates that this
-     * is a continuation of a prior `ListSnapshots` call, and that the system
-     * should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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; - bitField0_ |= 0x00000004; - 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.ListSnapshotsRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSnapshotsRequest) - private static final com.google.pubsub.v1.ListSnapshotsRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListSnapshotsRequest(); - } - - public static com.google.pubsub.v1.ListSnapshotsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListSnapshotsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListSnapshotsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequestOrBuilder.java deleted file mode 100644 index 36487bebd..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequestOrBuilder.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2023 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 ListSnapshotsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListSnapshotsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the project in which to list snapshots.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - java.lang.String getProject(); - /** - * - * - *
-   * Required. The name of the project in which to list snapshots.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - com.google.protobuf.ByteString getProjectBytes(); - - /** - * - * - *
-   * Maximum number of snapshots to return.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * The value returned by the last `ListSnapshotsResponse`; indicates that this
-   * is a continuation of a prior `ListSnapshots` call, and that the system
-   * should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * The value returned by the last `ListSnapshotsResponse`; indicates that this
-   * is a continuation of a prior `ListSnapshots` call, and that the system
-   * should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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/ListSnapshotsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsResponse.java deleted file mode 100644 index cc42bfb6c..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsResponse.java +++ /dev/null @@ -1,1118 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Response for the `ListSnapshots` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListSnapshotsResponse} - */ -public final class ListSnapshotsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListSnapshotsResponse) - ListSnapshotsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListSnapshotsResponse.newBuilder() to construct. - private ListSnapshotsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListSnapshotsResponse() { - snapshots_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListSnapshotsResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSnapshotsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSnapshotsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSnapshotsResponse.class, - com.google.pubsub.v1.ListSnapshotsResponse.Builder.class); - } - - public static final int SNAPSHOTS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private java.util.List snapshots_; - /** - * - * - *
-   * The resulting snapshots.
-   * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - @java.lang.Override - public java.util.List getSnapshotsList() { - return snapshots_; - } - /** - * - * - *
-   * The resulting snapshots.
-   * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - @java.lang.Override - public java.util.List - getSnapshotsOrBuilderList() { - return snapshots_; - } - /** - * - * - *
-   * The resulting snapshots.
-   * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - @java.lang.Override - public int getSnapshotsCount() { - return snapshots_.size(); - } - /** - * - * - *
-   * The resulting snapshots.
-   * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.Snapshot getSnapshots(int index) { - return snapshots_.get(index); - } - /** - * - * - *
-   * The resulting snapshots.
-   * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.SnapshotOrBuilder getSnapshotsOrBuilder(int index) { - return snapshots_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-   * If not empty, indicates that there may be more snapshot that match the
-   * request; this value should be passed in a new `ListSnapshotsRequest`.
-   * 
- * - * 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 snapshot that match the
-   * request; this value should be passed in a new `ListSnapshotsRequest`.
-   * 
- * - * 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 < snapshots_.size(); i++) { - output.writeMessage(1, snapshots_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < snapshots_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, snapshots_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += getUnknownFields().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.ListSnapshotsResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListSnapshotsResponse other = - (com.google.pubsub.v1.ListSnapshotsResponse) obj; - - if (!getSnapshotsList().equals(other.getSnapshotsList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getSnapshotsCount() > 0) { - hash = (37 * hash) + SNAPSHOTS_FIELD_NUMBER; - hash = (53 * hash) + getSnapshotsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListSnapshotsResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSnapshotsResponse 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.ListSnapshotsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSnapshotsResponse 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.ListSnapshotsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSnapshotsResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListSnapshotsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSnapshotsResponse 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.ListSnapshotsResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSnapshotsResponse 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.ListSnapshotsResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSnapshotsResponse 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.ListSnapshotsResponse 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 `ListSnapshots` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListSnapshotsResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListSnapshotsResponse) - com.google.pubsub.v1.ListSnapshotsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSnapshotsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSnapshotsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSnapshotsResponse.class, - com.google.pubsub.v1.ListSnapshotsResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListSnapshotsResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (snapshotsBuilder_ == null) { - snapshots_ = java.util.Collections.emptyList(); - } else { - snapshots_ = null; - snapshotsBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - nextPageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSnapshotsResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSnapshotsResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.ListSnapshotsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListSnapshotsResponse build() { - com.google.pubsub.v1.ListSnapshotsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSnapshotsResponse buildPartial() { - com.google.pubsub.v1.ListSnapshotsResponse result = - new com.google.pubsub.v1.ListSnapshotsResponse(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(com.google.pubsub.v1.ListSnapshotsResponse result) { - if (snapshotsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - snapshots_ = java.util.Collections.unmodifiableList(snapshots_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.snapshots_ = snapshots_; - } else { - result.snapshots_ = snapshotsBuilder_.build(); - } - } - - private void buildPartial0(com.google.pubsub.v1.ListSnapshotsResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nextPageToken_ = nextPageToken_; - } - } - - @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.ListSnapshotsResponse) { - return mergeFrom((com.google.pubsub.v1.ListSnapshotsResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListSnapshotsResponse other) { - if (other == com.google.pubsub.v1.ListSnapshotsResponse.getDefaultInstance()) return this; - if (snapshotsBuilder_ == null) { - if (!other.snapshots_.isEmpty()) { - if (snapshots_.isEmpty()) { - snapshots_ = other.snapshots_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSnapshotsIsMutable(); - snapshots_.addAll(other.snapshots_); - } - onChanged(); - } - } else { - if (!other.snapshots_.isEmpty()) { - if (snapshotsBuilder_.isEmpty()) { - snapshotsBuilder_.dispose(); - snapshotsBuilder_ = null; - snapshots_ = other.snapshots_; - bitField0_ = (bitField0_ & ~0x00000001); - snapshotsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSnapshotsFieldBuilder() - : null; - } else { - snapshotsBuilder_.addAllMessages(other.snapshots_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.pubsub.v1.Snapshot m = - input.readMessage(com.google.pubsub.v1.Snapshot.parser(), extensionRegistry); - if (snapshotsBuilder_ == null) { - ensureSnapshotsIsMutable(); - snapshots_.add(m); - } else { - snapshotsBuilder_.addMessage(m); - } - break; - } // case 10 - case 18: - { - nextPageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List snapshots_ = - java.util.Collections.emptyList(); - - private void ensureSnapshotsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - snapshots_ = new java.util.ArrayList(snapshots_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.Snapshot, - com.google.pubsub.v1.Snapshot.Builder, - com.google.pubsub.v1.SnapshotOrBuilder> - snapshotsBuilder_; - - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public java.util.List getSnapshotsList() { - if (snapshotsBuilder_ == null) { - return java.util.Collections.unmodifiableList(snapshots_); - } else { - return snapshotsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public int getSnapshotsCount() { - if (snapshotsBuilder_ == null) { - return snapshots_.size(); - } else { - return snapshotsBuilder_.getCount(); - } - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public com.google.pubsub.v1.Snapshot getSnapshots(int index) { - if (snapshotsBuilder_ == null) { - return snapshots_.get(index); - } else { - return snapshotsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public Builder setSnapshots(int index, com.google.pubsub.v1.Snapshot value) { - if (snapshotsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSnapshotsIsMutable(); - snapshots_.set(index, value); - onChanged(); - } else { - snapshotsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public Builder setSnapshots(int index, com.google.pubsub.v1.Snapshot.Builder builderForValue) { - if (snapshotsBuilder_ == null) { - ensureSnapshotsIsMutable(); - snapshots_.set(index, builderForValue.build()); - onChanged(); - } else { - snapshotsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public Builder addSnapshots(com.google.pubsub.v1.Snapshot value) { - if (snapshotsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSnapshotsIsMutable(); - snapshots_.add(value); - onChanged(); - } else { - snapshotsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public Builder addSnapshots(int index, com.google.pubsub.v1.Snapshot value) { - if (snapshotsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSnapshotsIsMutable(); - snapshots_.add(index, value); - onChanged(); - } else { - snapshotsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public Builder addSnapshots(com.google.pubsub.v1.Snapshot.Builder builderForValue) { - if (snapshotsBuilder_ == null) { - ensureSnapshotsIsMutable(); - snapshots_.add(builderForValue.build()); - onChanged(); - } else { - snapshotsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public Builder addSnapshots(int index, com.google.pubsub.v1.Snapshot.Builder builderForValue) { - if (snapshotsBuilder_ == null) { - ensureSnapshotsIsMutable(); - snapshots_.add(index, builderForValue.build()); - onChanged(); - } else { - snapshotsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public Builder addAllSnapshots( - java.lang.Iterable values) { - if (snapshotsBuilder_ == null) { - ensureSnapshotsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, snapshots_); - onChanged(); - } else { - snapshotsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public Builder clearSnapshots() { - if (snapshotsBuilder_ == null) { - snapshots_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - snapshotsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public Builder removeSnapshots(int index) { - if (snapshotsBuilder_ == null) { - ensureSnapshotsIsMutable(); - snapshots_.remove(index); - onChanged(); - } else { - snapshotsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public com.google.pubsub.v1.Snapshot.Builder getSnapshotsBuilder(int index) { - return getSnapshotsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public com.google.pubsub.v1.SnapshotOrBuilder getSnapshotsOrBuilder(int index) { - if (snapshotsBuilder_ == null) { - return snapshots_.get(index); - } else { - return snapshotsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public java.util.List - getSnapshotsOrBuilderList() { - if (snapshotsBuilder_ != null) { - return snapshotsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(snapshots_); - } - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public com.google.pubsub.v1.Snapshot.Builder addSnapshotsBuilder() { - return getSnapshotsFieldBuilder() - .addBuilder(com.google.pubsub.v1.Snapshot.getDefaultInstance()); - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public com.google.pubsub.v1.Snapshot.Builder addSnapshotsBuilder(int index) { - return getSnapshotsFieldBuilder() - .addBuilder(index, com.google.pubsub.v1.Snapshot.getDefaultInstance()); - } - /** - * - * - *
-     * The resulting snapshots.
-     * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - public java.util.List getSnapshotsBuilderList() { - return getSnapshotsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.Snapshot, - com.google.pubsub.v1.Snapshot.Builder, - com.google.pubsub.v1.SnapshotOrBuilder> - getSnapshotsFieldBuilder() { - if (snapshotsBuilder_ == null) { - snapshotsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.Snapshot, - com.google.pubsub.v1.Snapshot.Builder, - com.google.pubsub.v1.SnapshotOrBuilder>( - snapshots_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - snapshots_ = null; - } - return snapshotsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * If not empty, indicates that there may be more snapshot that match the
-     * request; this value should be passed in a new `ListSnapshotsRequest`.
-     * 
- * - * 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 snapshot that match the
-     * request; this value should be passed in a new `ListSnapshotsRequest`.
-     * 
- * - * 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 snapshot that match the
-     * request; this value should be passed in a new `ListSnapshotsRequest`.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * If not empty, indicates that there may be more snapshot that match the
-     * request; this value should be passed in a new `ListSnapshotsRequest`.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * If not empty, indicates that there may be more snapshot that match the
-     * request; this value should be passed in a new `ListSnapshotsRequest`.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - 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.ListSnapshotsResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSnapshotsResponse) - private static final com.google.pubsub.v1.ListSnapshotsResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListSnapshotsResponse(); - } - - public static com.google.pubsub.v1.ListSnapshotsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListSnapshotsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListSnapshotsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsResponseOrBuilder.java deleted file mode 100644 index 4559682d5..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsResponseOrBuilder.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2023 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 ListSnapshotsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListSnapshotsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The resulting snapshots.
-   * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - java.util.List getSnapshotsList(); - /** - * - * - *
-   * The resulting snapshots.
-   * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - com.google.pubsub.v1.Snapshot getSnapshots(int index); - /** - * - * - *
-   * The resulting snapshots.
-   * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - int getSnapshotsCount(); - /** - * - * - *
-   * The resulting snapshots.
-   * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - java.util.List getSnapshotsOrBuilderList(); - /** - * - * - *
-   * The resulting snapshots.
-   * 
- * - * repeated .google.pubsub.v1.Snapshot snapshots = 1; - */ - com.google.pubsub.v1.SnapshotOrBuilder getSnapshotsOrBuilder(int index); - - /** - * - * - *
-   * If not empty, indicates that there may be more snapshot that match the
-   * request; this value should be passed in a new `ListSnapshotsRequest`.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * If not empty, indicates that there may be more snapshot that match the
-   * request; this value should be passed in a new `ListSnapshotsRequest`.
-   * 
- * - * 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/ListSubscriptionsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequest.java deleted file mode 100644 index 63bbc9cd4..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequest.java +++ /dev/null @@ -1,933 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `ListSubscriptions` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListSubscriptionsRequest} - */ -public final class ListSubscriptionsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListSubscriptionsRequest) - ListSubscriptionsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListSubscriptionsRequest.newBuilder() to construct. - private ListSubscriptionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListSubscriptionsRequest() { - project_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListSubscriptionsRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSubscriptionsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSubscriptionsRequest.class, - com.google.pubsub.v1.ListSubscriptionsRequest.Builder.class); - } - - public static final int PROJECT_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object project_ = ""; - /** - * - * - *
-   * Required. The name of the project in which to list subscriptions.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - @java.lang.Override - public java.lang.String getProject() { - java.lang.Object ref = project_; - 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(); - project_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the project in which to list subscriptions.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_ = 0; - /** - * - * - *
-   * Maximum number of subscriptions to return.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object pageToken_ = ""; - /** - * - * - *
-   * The value returned by the last `ListSubscriptionsResponse`; indicates that
-   * this is a continuation of a prior `ListSubscriptions` call, and that the
-   * system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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 `ListSubscriptionsResponse`; indicates that
-   * this is a continuation of a prior `ListSubscriptions` call, and that the
-   * system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += getUnknownFields().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.ListSubscriptionsRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListSubscriptionsRequest other = - (com.google.pubsub.v1.ListSubscriptionsRequest) obj; - - if (!getProject().equals(other.getProject())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getProject().hashCode(); - 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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListSubscriptionsRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSubscriptionsRequest 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.ListSubscriptionsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSubscriptionsRequest 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.ListSubscriptionsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSubscriptionsRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListSubscriptionsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSubscriptionsRequest 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.ListSubscriptionsRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSubscriptionsRequest 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.ListSubscriptionsRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSubscriptionsRequest 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.ListSubscriptionsRequest 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 `ListSubscriptions` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListSubscriptionsRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListSubscriptionsRequest) - com.google.pubsub.v1.ListSubscriptionsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSubscriptionsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSubscriptionsRequest.class, - com.google.pubsub.v1.ListSubscriptionsRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListSubscriptionsRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - project_ = ""; - pageSize_ = 0; - pageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSubscriptionsRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.ListSubscriptionsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListSubscriptionsRequest build() { - com.google.pubsub.v1.ListSubscriptionsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSubscriptionsRequest buildPartial() { - com.google.pubsub.v1.ListSubscriptionsRequest result = - new com.google.pubsub.v1.ListSubscriptionsRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ListSubscriptionsRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.project_ = project_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.pageSize_ = pageSize_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pageToken_ = pageToken_; - } - } - - @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.ListSubscriptionsRequest) { - return mergeFrom((com.google.pubsub.v1.ListSubscriptionsRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListSubscriptionsRequest other) { - if (other == com.google.pubsub.v1.ListSubscriptionsRequest.getDefaultInstance()) return this; - if (!other.getProject().isEmpty()) { - project_ = other.project_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - bitField0_ |= 0x00000004; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - project_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - pageSize_ = input.readInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: - { - pageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object project_ = ""; - /** - * - * - *
-     * Required. The name of the project in which to list subscriptions.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the project in which to list subscriptions.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the project in which to list subscriptions.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The project to set. - * @return This builder for chaining. - */ - public Builder setProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - project_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the project in which to list subscriptions.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearProject() { - project_ = getDefaultInstance().getProject(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the project in which to list subscriptions.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for project to set. - * @return This builder for chaining. - */ - public Builder setProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - project_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * Maximum number of subscriptions to return.
-     * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * Maximum number of subscriptions to return.
-     * 
- * - * int32 page_size = 2; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of subscriptions to return.
-     * 
- * - * int32 page_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - bitField0_ = (bitField0_ & ~0x00000002); - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * The value returned by the last `ListSubscriptionsResponse`; indicates that
-     * this is a continuation of a prior `ListSubscriptions` call, and that the
-     * system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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 `ListSubscriptionsResponse`; indicates that
-     * this is a continuation of a prior `ListSubscriptions` call, and that the
-     * system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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 `ListSubscriptionsResponse`; indicates that
-     * this is a continuation of a prior `ListSubscriptions` call, and that the
-     * system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The value returned by the last `ListSubscriptionsResponse`; indicates that
-     * this is a continuation of a prior `ListSubscriptions` call, and that the
-     * system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-     * The value returned by the last `ListSubscriptionsResponse`; indicates that
-     * this is a continuation of a prior `ListSubscriptions` call, and that the
-     * system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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; - bitField0_ |= 0x00000004; - 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.ListSubscriptionsRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSubscriptionsRequest) - private static final com.google.pubsub.v1.ListSubscriptionsRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListSubscriptionsRequest(); - } - - public static com.google.pubsub.v1.ListSubscriptionsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListSubscriptionsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListSubscriptionsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequestOrBuilder.java deleted file mode 100644 index db2839f67..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequestOrBuilder.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2023 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 ListSubscriptionsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListSubscriptionsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the project in which to list subscriptions.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - java.lang.String getProject(); - /** - * - * - *
-   * Required. The name of the project in which to list subscriptions.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - com.google.protobuf.ByteString getProjectBytes(); - - /** - * - * - *
-   * Maximum number of subscriptions to return.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * The value returned by the last `ListSubscriptionsResponse`; indicates that
-   * this is a continuation of a prior `ListSubscriptions` call, and that the
-   * system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * The value returned by the last `ListSubscriptionsResponse`; indicates that
-   * this is a continuation of a prior `ListSubscriptions` call, and that the
-   * system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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/ListSubscriptionsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponse.java deleted file mode 100644 index 629620e65..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponse.java +++ /dev/null @@ -1,1131 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Response for the `ListSubscriptions` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListSubscriptionsResponse} - */ -public final class ListSubscriptionsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListSubscriptionsResponse) - ListSubscriptionsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListSubscriptionsResponse.newBuilder() to construct. - private ListSubscriptionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListSubscriptionsResponse() { - subscriptions_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListSubscriptionsResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSubscriptionsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSubscriptionsResponse.class, - com.google.pubsub.v1.ListSubscriptionsResponse.Builder.class); - } - - public static final int SUBSCRIPTIONS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private java.util.List subscriptions_; - /** - * - * - *
-   * The subscriptions that match the request.
-   * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - @java.lang.Override - public java.util.List getSubscriptionsList() { - return subscriptions_; - } - /** - * - * - *
-   * The subscriptions that match the request.
-   * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - @java.lang.Override - public java.util.List - getSubscriptionsOrBuilderList() { - return subscriptions_; - } - /** - * - * - *
-   * The subscriptions that match the request.
-   * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - @java.lang.Override - public int getSubscriptionsCount() { - return subscriptions_.size(); - } - /** - * - * - *
-   * The subscriptions that match the request.
-   * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.Subscription getSubscriptions(int index) { - return subscriptions_.get(index); - } - /** - * - * - *
-   * The subscriptions that match the request.
-   * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.SubscriptionOrBuilder getSubscriptionsOrBuilder(int index) { - return subscriptions_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-   * If not empty, indicates that there may be more subscriptions that match
-   * the request; this value should be passed in a new
-   * `ListSubscriptionsRequest` to get more subscriptions.
-   * 
- * - * 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 subscriptions that match
-   * the request; this value should be passed in a new
-   * `ListSubscriptionsRequest` to get more subscriptions.
-   * 
- * - * 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 < subscriptions_.size(); i++) { - output.writeMessage(1, subscriptions_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < subscriptions_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, subscriptions_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += getUnknownFields().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.ListSubscriptionsResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListSubscriptionsResponse other = - (com.google.pubsub.v1.ListSubscriptionsResponse) obj; - - if (!getSubscriptionsList().equals(other.getSubscriptionsList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getSubscriptionsCount() > 0) { - hash = (37 * hash) + SUBSCRIPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getSubscriptionsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListSubscriptionsResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSubscriptionsResponse 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.ListSubscriptionsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSubscriptionsResponse 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.ListSubscriptionsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListSubscriptionsResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListSubscriptionsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSubscriptionsResponse 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.ListSubscriptionsResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSubscriptionsResponse 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.ListSubscriptionsResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListSubscriptionsResponse 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.ListSubscriptionsResponse 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 `ListSubscriptions` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListSubscriptionsResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListSubscriptionsResponse) - com.google.pubsub.v1.ListSubscriptionsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSubscriptionsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListSubscriptionsResponse.class, - com.google.pubsub.v1.ListSubscriptionsResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListSubscriptionsResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (subscriptionsBuilder_ == null) { - subscriptions_ = java.util.Collections.emptyList(); - } else { - subscriptions_ = null; - subscriptionsBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - nextPageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSubscriptionsResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.ListSubscriptionsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListSubscriptionsResponse build() { - com.google.pubsub.v1.ListSubscriptionsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListSubscriptionsResponse buildPartial() { - com.google.pubsub.v1.ListSubscriptionsResponse result = - new com.google.pubsub.v1.ListSubscriptionsResponse(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(com.google.pubsub.v1.ListSubscriptionsResponse result) { - if (subscriptionsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - subscriptions_ = java.util.Collections.unmodifiableList(subscriptions_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.subscriptions_ = subscriptions_; - } else { - result.subscriptions_ = subscriptionsBuilder_.build(); - } - } - - private void buildPartial0(com.google.pubsub.v1.ListSubscriptionsResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nextPageToken_ = nextPageToken_; - } - } - - @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.ListSubscriptionsResponse) { - return mergeFrom((com.google.pubsub.v1.ListSubscriptionsResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListSubscriptionsResponse other) { - if (other == com.google.pubsub.v1.ListSubscriptionsResponse.getDefaultInstance()) return this; - if (subscriptionsBuilder_ == null) { - if (!other.subscriptions_.isEmpty()) { - if (subscriptions_.isEmpty()) { - subscriptions_ = other.subscriptions_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSubscriptionsIsMutable(); - subscriptions_.addAll(other.subscriptions_); - } - onChanged(); - } - } else { - if (!other.subscriptions_.isEmpty()) { - if (subscriptionsBuilder_.isEmpty()) { - subscriptionsBuilder_.dispose(); - subscriptionsBuilder_ = null; - subscriptions_ = other.subscriptions_; - bitField0_ = (bitField0_ & ~0x00000001); - subscriptionsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSubscriptionsFieldBuilder() - : null; - } else { - subscriptionsBuilder_.addAllMessages(other.subscriptions_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.pubsub.v1.Subscription m = - input.readMessage( - com.google.pubsub.v1.Subscription.parser(), extensionRegistry); - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - subscriptions_.add(m); - } else { - subscriptionsBuilder_.addMessage(m); - } - break; - } // case 10 - case 18: - { - nextPageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List subscriptions_ = - java.util.Collections.emptyList(); - - private void ensureSubscriptionsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - subscriptions_ = new java.util.ArrayList(subscriptions_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.Subscription, - com.google.pubsub.v1.Subscription.Builder, - com.google.pubsub.v1.SubscriptionOrBuilder> - subscriptionsBuilder_; - - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public java.util.List getSubscriptionsList() { - if (subscriptionsBuilder_ == null) { - return java.util.Collections.unmodifiableList(subscriptions_); - } else { - return subscriptionsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public int getSubscriptionsCount() { - if (subscriptionsBuilder_ == null) { - return subscriptions_.size(); - } else { - return subscriptionsBuilder_.getCount(); - } - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public com.google.pubsub.v1.Subscription getSubscriptions(int index) { - if (subscriptionsBuilder_ == null) { - return subscriptions_.get(index); - } else { - return subscriptionsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public Builder setSubscriptions(int index, com.google.pubsub.v1.Subscription value) { - if (subscriptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSubscriptionsIsMutable(); - subscriptions_.set(index, value); - onChanged(); - } else { - subscriptionsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public Builder setSubscriptions( - int index, com.google.pubsub.v1.Subscription.Builder builderForValue) { - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - subscriptions_.set(index, builderForValue.build()); - onChanged(); - } else { - subscriptionsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public Builder addSubscriptions(com.google.pubsub.v1.Subscription value) { - if (subscriptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSubscriptionsIsMutable(); - subscriptions_.add(value); - onChanged(); - } else { - subscriptionsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public Builder addSubscriptions(int index, com.google.pubsub.v1.Subscription value) { - if (subscriptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSubscriptionsIsMutable(); - subscriptions_.add(index, value); - onChanged(); - } else { - subscriptionsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public Builder addSubscriptions(com.google.pubsub.v1.Subscription.Builder builderForValue) { - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - subscriptions_.add(builderForValue.build()); - onChanged(); - } else { - subscriptionsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public Builder addSubscriptions( - int index, com.google.pubsub.v1.Subscription.Builder builderForValue) { - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - subscriptions_.add(index, builderForValue.build()); - onChanged(); - } else { - subscriptionsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public Builder addAllSubscriptions( - java.lang.Iterable values) { - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, subscriptions_); - onChanged(); - } else { - subscriptionsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public Builder clearSubscriptions() { - if (subscriptionsBuilder_ == null) { - subscriptions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - subscriptionsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public Builder removeSubscriptions(int index) { - if (subscriptionsBuilder_ == null) { - ensureSubscriptionsIsMutable(); - subscriptions_.remove(index); - onChanged(); - } else { - subscriptionsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public com.google.pubsub.v1.Subscription.Builder getSubscriptionsBuilder(int index) { - return getSubscriptionsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public com.google.pubsub.v1.SubscriptionOrBuilder getSubscriptionsOrBuilder(int index) { - if (subscriptionsBuilder_ == null) { - return subscriptions_.get(index); - } else { - return subscriptionsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public java.util.List - getSubscriptionsOrBuilderList() { - if (subscriptionsBuilder_ != null) { - return subscriptionsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(subscriptions_); - } - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public com.google.pubsub.v1.Subscription.Builder addSubscriptionsBuilder() { - return getSubscriptionsFieldBuilder() - .addBuilder(com.google.pubsub.v1.Subscription.getDefaultInstance()); - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public com.google.pubsub.v1.Subscription.Builder addSubscriptionsBuilder(int index) { - return getSubscriptionsFieldBuilder() - .addBuilder(index, com.google.pubsub.v1.Subscription.getDefaultInstance()); - } - /** - * - * - *
-     * The subscriptions that match the request.
-     * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - public java.util.List getSubscriptionsBuilderList() { - return getSubscriptionsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.Subscription, - com.google.pubsub.v1.Subscription.Builder, - com.google.pubsub.v1.SubscriptionOrBuilder> - getSubscriptionsFieldBuilder() { - if (subscriptionsBuilder_ == null) { - subscriptionsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.Subscription, - com.google.pubsub.v1.Subscription.Builder, - com.google.pubsub.v1.SubscriptionOrBuilder>( - subscriptions_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - subscriptions_ = null; - } - return subscriptionsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * If not empty, indicates that there may be more subscriptions that match
-     * the request; this value should be passed in a new
-     * `ListSubscriptionsRequest` to get more subscriptions.
-     * 
- * - * 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 subscriptions that match
-     * the request; this value should be passed in a new
-     * `ListSubscriptionsRequest` to get more subscriptions.
-     * 
- * - * 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 subscriptions that match
-     * the request; this value should be passed in a new
-     * `ListSubscriptionsRequest` to get more subscriptions.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * If not empty, indicates that there may be more subscriptions that match
-     * the request; this value should be passed in a new
-     * `ListSubscriptionsRequest` to get more subscriptions.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * If not empty, indicates that there may be more subscriptions that match
-     * the request; this value should be passed in a new
-     * `ListSubscriptionsRequest` to get more subscriptions.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - 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.ListSubscriptionsResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSubscriptionsResponse) - private static final com.google.pubsub.v1.ListSubscriptionsResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListSubscriptionsResponse(); - } - - public static com.google.pubsub.v1.ListSubscriptionsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListSubscriptionsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListSubscriptionsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponseOrBuilder.java deleted file mode 100644 index 439c431a5..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponseOrBuilder.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2023 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 ListSubscriptionsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListSubscriptionsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The subscriptions that match the request.
-   * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - java.util.List getSubscriptionsList(); - /** - * - * - *
-   * The subscriptions that match the request.
-   * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - com.google.pubsub.v1.Subscription getSubscriptions(int index); - /** - * - * - *
-   * The subscriptions that match the request.
-   * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - int getSubscriptionsCount(); - /** - * - * - *
-   * The subscriptions that match the request.
-   * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - java.util.List - getSubscriptionsOrBuilderList(); - /** - * - * - *
-   * The subscriptions that match the request.
-   * 
- * - * repeated .google.pubsub.v1.Subscription subscriptions = 1; - */ - com.google.pubsub.v1.SubscriptionOrBuilder getSubscriptionsOrBuilder(int index); - - /** - * - * - *
-   * If not empty, indicates that there may be more subscriptions that match
-   * the request; this value should be passed in a new
-   * `ListSubscriptionsRequest` to get more subscriptions.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * If not empty, indicates that there may be more subscriptions that match
-   * the request; this value should be passed in a new
-   * `ListSubscriptionsRequest` to get more subscriptions.
-   * 
- * - * 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/ListTopicSnapshotsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsRequest.java deleted file mode 100644 index 103e28b75..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsRequest.java +++ /dev/null @@ -1,933 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `ListTopicSnapshots` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicSnapshotsRequest} - */ -public final class ListTopicSnapshotsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListTopicSnapshotsRequest) - ListTopicSnapshotsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListTopicSnapshotsRequest.newBuilder() to construct. - private ListTopicSnapshotsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListTopicSnapshotsRequest() { - topic_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListTopicSnapshotsRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicSnapshotsRequest.class, - com.google.pubsub.v1.ListTopicSnapshotsRequest.Builder.class); - } - - public static final int TOPIC_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object topic_ = ""; - /** - * - * - *
-   * Required. The name of the topic that snapshots are attached to.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - @java.lang.Override - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - 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(); - topic_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the topic that snapshots are attached to.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_ = 0; - /** - * - * - *
-   * Maximum number of snapshot names to return.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object pageToken_ = ""; - /** - * - * - *
-   * The value returned by the last `ListTopicSnapshotsResponse`; indicates
-   * that this is a continuation of a prior `ListTopicSnapshots` call, and
-   * that the system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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 `ListTopicSnapshotsResponse`; indicates
-   * that this is a continuation of a prior `ListTopicSnapshots` call, and
-   * that the system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += getUnknownFields().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.ListTopicSnapshotsRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListTopicSnapshotsRequest other = - (com.google.pubsub.v1.ListTopicSnapshotsRequest) obj; - - if (!getTopic().equals(other.getTopic())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getTopic().hashCode(); - 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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListTopicSnapshotsRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsRequest 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.ListTopicSnapshotsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsRequest 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.ListTopicSnapshotsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsRequest 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.ListTopicSnapshotsRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsRequest 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.ListTopicSnapshotsRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsRequest 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.ListTopicSnapshotsRequest 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 `ListTopicSnapshots` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicSnapshotsRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListTopicSnapshotsRequest) - com.google.pubsub.v1.ListTopicSnapshotsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicSnapshotsRequest.class, - com.google.pubsub.v1.ListTopicSnapshotsRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListTopicSnapshotsRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - topic_ = ""; - pageSize_ = 0; - pageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSnapshotsRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.ListTopicSnapshotsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSnapshotsRequest build() { - com.google.pubsub.v1.ListTopicSnapshotsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSnapshotsRequest buildPartial() { - com.google.pubsub.v1.ListTopicSnapshotsRequest result = - new com.google.pubsub.v1.ListTopicSnapshotsRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ListTopicSnapshotsRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.topic_ = topic_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.pageSize_ = pageSize_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pageToken_ = pageToken_; - } - } - - @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.ListTopicSnapshotsRequest) { - return mergeFrom((com.google.pubsub.v1.ListTopicSnapshotsRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListTopicSnapshotsRequest other) { - if (other == com.google.pubsub.v1.ListTopicSnapshotsRequest.getDefaultInstance()) return this; - if (!other.getTopic().isEmpty()) { - topic_ = other.topic_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - bitField0_ |= 0x00000004; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - topic_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - pageSize_ = input.readInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: - { - pageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object topic_ = ""; - /** - * - * - *
-     * Required. The name of the topic that snapshots are attached to.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - topic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the topic that snapshots are attached to.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the topic that snapshots are attached to.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The topic to set. - * @return This builder for chaining. - */ - public Builder setTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - topic_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the topic that snapshots are attached to.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearTopic() { - topic_ = getDefaultInstance().getTopic(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the topic that snapshots are attached to.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for topic to set. - * @return This builder for chaining. - */ - public Builder setTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - topic_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * Maximum number of snapshot names to return.
-     * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * Maximum number of snapshot names to return.
-     * 
- * - * int32 page_size = 2; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of snapshot names to return.
-     * 
- * - * int32 page_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - bitField0_ = (bitField0_ & ~0x00000002); - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * The value returned by the last `ListTopicSnapshotsResponse`; indicates
-     * that this is a continuation of a prior `ListTopicSnapshots` call, and
-     * that the system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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 `ListTopicSnapshotsResponse`; indicates
-     * that this is a continuation of a prior `ListTopicSnapshots` call, and
-     * that the system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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 `ListTopicSnapshotsResponse`; indicates
-     * that this is a continuation of a prior `ListTopicSnapshots` call, and
-     * that the system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The value returned by the last `ListTopicSnapshotsResponse`; indicates
-     * that this is a continuation of a prior `ListTopicSnapshots` call, and
-     * that the system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-     * The value returned by the last `ListTopicSnapshotsResponse`; indicates
-     * that this is a continuation of a prior `ListTopicSnapshots` call, and
-     * that the system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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; - bitField0_ |= 0x00000004; - 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.ListTopicSnapshotsRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicSnapshotsRequest) - private static final com.google.pubsub.v1.ListTopicSnapshotsRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListTopicSnapshotsRequest(); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListTopicSnapshotsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListTopicSnapshotsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsRequestOrBuilder.java deleted file mode 100644 index d965d0d29..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsRequestOrBuilder.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2023 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 ListTopicSnapshotsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListTopicSnapshotsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the topic that snapshots are attached to.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - java.lang.String getTopic(); - /** - * - * - *
-   * Required. The name of the topic that snapshots are attached to.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - com.google.protobuf.ByteString getTopicBytes(); - - /** - * - * - *
-   * Maximum number of snapshot names to return.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * The value returned by the last `ListTopicSnapshotsResponse`; indicates
-   * that this is a continuation of a prior `ListTopicSnapshots` call, and
-   * that the system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * The value returned by the last `ListTopicSnapshotsResponse`; indicates
-   * that this is a continuation of a prior `ListTopicSnapshots` call, and
-   * that the system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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/ListTopicSnapshotsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsResponse.java deleted file mode 100644 index 9d0eb36e1..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsResponse.java +++ /dev/null @@ -1,915 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Response for the `ListTopicSnapshots` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicSnapshotsResponse} - */ -public final class ListTopicSnapshotsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListTopicSnapshotsResponse) - ListTopicSnapshotsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListTopicSnapshotsResponse.newBuilder() to construct. - private ListTopicSnapshotsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListTopicSnapshotsResponse() { - snapshots_ = com.google.protobuf.LazyStringArrayList.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListTopicSnapshotsResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicSnapshotsResponse.class, - com.google.pubsub.v1.ListTopicSnapshotsResponse.Builder.class); - } - - public static final int SNAPSHOTS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList snapshots_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-   * The names of the snapshots that match the request.
-   * 
- * - * repeated string snapshots = 1; - * - * @return A list containing the snapshots. - */ - public com.google.protobuf.ProtocolStringList getSnapshotsList() { - return snapshots_; - } - /** - * - * - *
-   * The names of the snapshots that match the request.
-   * 
- * - * repeated string snapshots = 1; - * - * @return The count of snapshots. - */ - public int getSnapshotsCount() { - return snapshots_.size(); - } - /** - * - * - *
-   * The names of the snapshots that match the request.
-   * 
- * - * repeated string snapshots = 1; - * - * @param index The index of the element to return. - * @return The snapshots at the given index. - */ - public java.lang.String getSnapshots(int index) { - return snapshots_.get(index); - } - /** - * - * - *
-   * The names of the snapshots that match the request.
-   * 
- * - * repeated string snapshots = 1; - * - * @param index The index of the value to return. - * @return The bytes of the snapshots at the given index. - */ - public com.google.protobuf.ByteString getSnapshotsBytes(int index) { - return snapshots_.getByteString(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-   * If not empty, indicates that there may be more snapshots that match
-   * the request; this value should be passed in a new
-   * `ListTopicSnapshotsRequest` to get more snapshots.
-   * 
- * - * 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 snapshots that match
-   * the request; this value should be passed in a new
-   * `ListTopicSnapshotsRequest` to get more snapshots.
-   * 
- * - * 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 < snapshots_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, snapshots_.getRaw(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < snapshots_.size(); i++) { - dataSize += computeStringSizeNoTag(snapshots_.getRaw(i)); - } - size += dataSize; - size += 1 * getSnapshotsList().size(); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += getUnknownFields().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.ListTopicSnapshotsResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListTopicSnapshotsResponse other = - (com.google.pubsub.v1.ListTopicSnapshotsResponse) obj; - - if (!getSnapshotsList().equals(other.getSnapshotsList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getSnapshotsCount() > 0) { - hash = (37 * hash) + SNAPSHOTS_FIELD_NUMBER; - hash = (53 * hash) + getSnapshotsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListTopicSnapshotsResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsResponse 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.ListTopicSnapshotsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsResponse 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.ListTopicSnapshotsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsResponse 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.ListTopicSnapshotsResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsResponse 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.ListTopicSnapshotsResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsResponse 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.ListTopicSnapshotsResponse 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 `ListTopicSnapshots` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicSnapshotsResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListTopicSnapshotsResponse) - com.google.pubsub.v1.ListTopicSnapshotsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicSnapshotsResponse.class, - com.google.pubsub.v1.ListTopicSnapshotsResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListTopicSnapshotsResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - snapshots_ = com.google.protobuf.LazyStringArrayList.emptyList(); - nextPageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSnapshotsResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.ListTopicSnapshotsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSnapshotsResponse build() { - com.google.pubsub.v1.ListTopicSnapshotsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSnapshotsResponse buildPartial() { - com.google.pubsub.v1.ListTopicSnapshotsResponse result = - new com.google.pubsub.v1.ListTopicSnapshotsResponse(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ListTopicSnapshotsResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - snapshots_.makeImmutable(); - result.snapshots_ = snapshots_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nextPageToken_ = nextPageToken_; - } - } - - @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.ListTopicSnapshotsResponse) { - return mergeFrom((com.google.pubsub.v1.ListTopicSnapshotsResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListTopicSnapshotsResponse other) { - if (other == com.google.pubsub.v1.ListTopicSnapshotsResponse.getDefaultInstance()) - return this; - if (!other.snapshots_.isEmpty()) { - if (snapshots_.isEmpty()) { - snapshots_ = other.snapshots_; - bitField0_ |= 0x00000001; - } else { - ensureSnapshotsIsMutable(); - snapshots_.addAll(other.snapshots_); - } - onChanged(); - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - 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(); - ensureSnapshotsIsMutable(); - snapshots_.add(s); - break; - } // case 10 - case 18: - { - nextPageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringArrayList snapshots_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureSnapshotsIsMutable() { - if (!snapshots_.isModifiable()) { - snapshots_ = new com.google.protobuf.LazyStringArrayList(snapshots_); - } - bitField0_ |= 0x00000001; - } - /** - * - * - *
-     * The names of the snapshots that match the request.
-     * 
- * - * repeated string snapshots = 1; - * - * @return A list containing the snapshots. - */ - public com.google.protobuf.ProtocolStringList getSnapshotsList() { - snapshots_.makeImmutable(); - return snapshots_; - } - /** - * - * - *
-     * The names of the snapshots that match the request.
-     * 
- * - * repeated string snapshots = 1; - * - * @return The count of snapshots. - */ - public int getSnapshotsCount() { - return snapshots_.size(); - } - /** - * - * - *
-     * The names of the snapshots that match the request.
-     * 
- * - * repeated string snapshots = 1; - * - * @param index The index of the element to return. - * @return The snapshots at the given index. - */ - public java.lang.String getSnapshots(int index) { - return snapshots_.get(index); - } - /** - * - * - *
-     * The names of the snapshots that match the request.
-     * 
- * - * repeated string snapshots = 1; - * - * @param index The index of the value to return. - * @return The bytes of the snapshots at the given index. - */ - public com.google.protobuf.ByteString getSnapshotsBytes(int index) { - return snapshots_.getByteString(index); - } - /** - * - * - *
-     * The names of the snapshots that match the request.
-     * 
- * - * repeated string snapshots = 1; - * - * @param index The index to set the value at. - * @param value The snapshots to set. - * @return This builder for chaining. - */ - public Builder setSnapshots(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSnapshotsIsMutable(); - snapshots_.set(index, value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The names of the snapshots that match the request.
-     * 
- * - * repeated string snapshots = 1; - * - * @param value The snapshots to add. - * @return This builder for chaining. - */ - public Builder addSnapshots(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSnapshotsIsMutable(); - snapshots_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The names of the snapshots that match the request.
-     * 
- * - * repeated string snapshots = 1; - * - * @param values The snapshots to add. - * @return This builder for chaining. - */ - public Builder addAllSnapshots(java.lang.Iterable values) { - ensureSnapshotsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, snapshots_); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The names of the snapshots that match the request.
-     * 
- * - * repeated string snapshots = 1; - * - * @return This builder for chaining. - */ - public Builder clearSnapshots() { - snapshots_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - ; - onChanged(); - return this; - } - /** - * - * - *
-     * The names of the snapshots that match the request.
-     * 
- * - * repeated string snapshots = 1; - * - * @param value The bytes of the snapshots to add. - * @return This builder for chaining. - */ - public Builder addSnapshotsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureSnapshotsIsMutable(); - snapshots_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * If not empty, indicates that there may be more snapshots that match
-     * the request; this value should be passed in a new
-     * `ListTopicSnapshotsRequest` to get more snapshots.
-     * 
- * - * 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 snapshots that match
-     * the request; this value should be passed in a new
-     * `ListTopicSnapshotsRequest` to get more snapshots.
-     * 
- * - * 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 snapshots that match
-     * the request; this value should be passed in a new
-     * `ListTopicSnapshotsRequest` to get more snapshots.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * If not empty, indicates that there may be more snapshots that match
-     * the request; this value should be passed in a new
-     * `ListTopicSnapshotsRequest` to get more snapshots.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * If not empty, indicates that there may be more snapshots that match
-     * the request; this value should be passed in a new
-     * `ListTopicSnapshotsRequest` to get more snapshots.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - 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.ListTopicSnapshotsResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicSnapshotsResponse) - private static final com.google.pubsub.v1.ListTopicSnapshotsResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListTopicSnapshotsResponse(); - } - - public static com.google.pubsub.v1.ListTopicSnapshotsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListTopicSnapshotsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListTopicSnapshotsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsResponseOrBuilder.java deleted file mode 100644 index b24d10865..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsResponseOrBuilder.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2023 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 ListTopicSnapshotsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListTopicSnapshotsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The names of the snapshots that match the request.
-   * 
- * - * repeated string snapshots = 1; - * - * @return A list containing the snapshots. - */ - java.util.List getSnapshotsList(); - /** - * - * - *
-   * The names of the snapshots that match the request.
-   * 
- * - * repeated string snapshots = 1; - * - * @return The count of snapshots. - */ - int getSnapshotsCount(); - /** - * - * - *
-   * The names of the snapshots that match the request.
-   * 
- * - * repeated string snapshots = 1; - * - * @param index The index of the element to return. - * @return The snapshots at the given index. - */ - java.lang.String getSnapshots(int index); - /** - * - * - *
-   * The names of the snapshots that match the request.
-   * 
- * - * repeated string snapshots = 1; - * - * @param index The index of the value to return. - * @return The bytes of the snapshots at the given index. - */ - com.google.protobuf.ByteString getSnapshotsBytes(int index); - - /** - * - * - *
-   * If not empty, indicates that there may be more snapshots that match
-   * the request; this value should be passed in a new
-   * `ListTopicSnapshotsRequest` to get more snapshots.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * If not empty, indicates that there may be more snapshots that match
-   * the request; this value should be passed in a new
-   * `ListTopicSnapshotsRequest` to get more snapshots.
-   * 
- * - * 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/ListTopicSubscriptionsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequest.java deleted file mode 100644 index 737bd00b7..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequest.java +++ /dev/null @@ -1,934 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `ListTopicSubscriptions` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicSubscriptionsRequest} - */ -public final class ListTopicSubscriptionsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListTopicSubscriptionsRequest) - ListTopicSubscriptionsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListTopicSubscriptionsRequest.newBuilder() to construct. - private ListTopicSubscriptionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListTopicSubscriptionsRequest() { - topic_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListTopicSubscriptionsRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicSubscriptionsRequest.class, - com.google.pubsub.v1.ListTopicSubscriptionsRequest.Builder.class); - } - - public static final int TOPIC_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object topic_ = ""; - /** - * - * - *
-   * Required. The name of the topic that subscriptions are attached to.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - @java.lang.Override - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - 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(); - topic_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the topic that subscriptions are attached to.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_ = 0; - /** - * - * - *
-   * Maximum number of subscription names to return.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object pageToken_ = ""; - /** - * - * - *
-   * The value returned by the last `ListTopicSubscriptionsResponse`; indicates
-   * that this is a continuation of a prior `ListTopicSubscriptions` call, and
-   * that the system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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 `ListTopicSubscriptionsResponse`; indicates
-   * that this is a continuation of a prior `ListTopicSubscriptions` call, and
-   * that the system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += getUnknownFields().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.ListTopicSubscriptionsRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListTopicSubscriptionsRequest other = - (com.google.pubsub.v1.ListTopicSubscriptionsRequest) obj; - - if (!getTopic().equals(other.getTopic())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getTopic().hashCode(); - 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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsRequest 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.ListTopicSubscriptionsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsRequest 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.ListTopicSubscriptionsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsRequest 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.ListTopicSubscriptionsRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsRequest 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.ListTopicSubscriptionsRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsRequest 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.ListTopicSubscriptionsRequest 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 `ListTopicSubscriptions` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicSubscriptionsRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListTopicSubscriptionsRequest) - com.google.pubsub.v1.ListTopicSubscriptionsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicSubscriptionsRequest.class, - com.google.pubsub.v1.ListTopicSubscriptionsRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListTopicSubscriptionsRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - topic_ = ""; - pageSize_ = 0; - pageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSubscriptionsRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.ListTopicSubscriptionsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSubscriptionsRequest build() { - com.google.pubsub.v1.ListTopicSubscriptionsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSubscriptionsRequest buildPartial() { - com.google.pubsub.v1.ListTopicSubscriptionsRequest result = - new com.google.pubsub.v1.ListTopicSubscriptionsRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ListTopicSubscriptionsRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.topic_ = topic_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.pageSize_ = pageSize_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pageToken_ = pageToken_; - } - } - - @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.ListTopicSubscriptionsRequest) { - return mergeFrom((com.google.pubsub.v1.ListTopicSubscriptionsRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListTopicSubscriptionsRequest other) { - if (other == com.google.pubsub.v1.ListTopicSubscriptionsRequest.getDefaultInstance()) - return this; - if (!other.getTopic().isEmpty()) { - topic_ = other.topic_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - bitField0_ |= 0x00000004; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - topic_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - pageSize_ = input.readInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: - { - pageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object topic_ = ""; - /** - * - * - *
-     * Required. The name of the topic that subscriptions are attached to.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - topic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the topic that subscriptions are attached to.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the topic that subscriptions are attached to.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The topic to set. - * @return This builder for chaining. - */ - public Builder setTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - topic_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the topic that subscriptions are attached to.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearTopic() { - topic_ = getDefaultInstance().getTopic(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the topic that subscriptions are attached to.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for topic to set. - * @return This builder for chaining. - */ - public Builder setTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - topic_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * Maximum number of subscription names to return.
-     * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * Maximum number of subscription names to return.
-     * 
- * - * int32 page_size = 2; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of subscription names to return.
-     * 
- * - * int32 page_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - bitField0_ = (bitField0_ & ~0x00000002); - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * The value returned by the last `ListTopicSubscriptionsResponse`; indicates
-     * that this is a continuation of a prior `ListTopicSubscriptions` call, and
-     * that the system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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 `ListTopicSubscriptionsResponse`; indicates
-     * that this is a continuation of a prior `ListTopicSubscriptions` call, and
-     * that the system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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 `ListTopicSubscriptionsResponse`; indicates
-     * that this is a continuation of a prior `ListTopicSubscriptions` call, and
-     * that the system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The value returned by the last `ListTopicSubscriptionsResponse`; indicates
-     * that this is a continuation of a prior `ListTopicSubscriptions` call, and
-     * that the system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-     * The value returned by the last `ListTopicSubscriptionsResponse`; indicates
-     * that this is a continuation of a prior `ListTopicSubscriptions` call, and
-     * that the system should return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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; - bitField0_ |= 0x00000004; - 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.ListTopicSubscriptionsRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicSubscriptionsRequest) - private static final com.google.pubsub.v1.ListTopicSubscriptionsRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListTopicSubscriptionsRequest(); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListTopicSubscriptionsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListTopicSubscriptionsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequestOrBuilder.java deleted file mode 100644 index d6bc07531..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequestOrBuilder.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2023 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 ListTopicSubscriptionsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListTopicSubscriptionsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the topic that subscriptions are attached to.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - java.lang.String getTopic(); - /** - * - * - *
-   * Required. The name of the topic that subscriptions are attached to.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - com.google.protobuf.ByteString getTopicBytes(); - - /** - * - * - *
-   * Maximum number of subscription names to return.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * The value returned by the last `ListTopicSubscriptionsResponse`; indicates
-   * that this is a continuation of a prior `ListTopicSubscriptions` call, and
-   * that the system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * The value returned by the last `ListTopicSubscriptionsResponse`; indicates
-   * that this is a continuation of a prior `ListTopicSubscriptions` call, and
-   * that the system should return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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/ListTopicSubscriptionsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponse.java deleted file mode 100644 index f270eed8d..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponse.java +++ /dev/null @@ -1,916 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Response for the `ListTopicSubscriptions` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicSubscriptionsResponse} - */ -public final class ListTopicSubscriptionsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListTopicSubscriptionsResponse) - ListTopicSubscriptionsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListTopicSubscriptionsResponse.newBuilder() to construct. - private ListTopicSubscriptionsResponse( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListTopicSubscriptionsResponse() { - subscriptions_ = com.google.protobuf.LazyStringArrayList.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListTopicSubscriptionsResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicSubscriptionsResponse.class, - com.google.pubsub.v1.ListTopicSubscriptionsResponse.Builder.class); - } - - public static final int SUBSCRIPTIONS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList subscriptions_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-   * The names of subscriptions attached to the topic specified in the request.
-   * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @return A list containing the subscriptions. - */ - public com.google.protobuf.ProtocolStringList getSubscriptionsList() { - return subscriptions_; - } - /** - * - * - *
-   * The names of subscriptions attached to the topic specified in the request.
-   * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @return The count of subscriptions. - */ - public int getSubscriptionsCount() { - return subscriptions_.size(); - } - /** - * - * - *
-   * The names of subscriptions attached to the topic specified in the request.
-   * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @param index The index of the element to return. - * @return The subscriptions at the given index. - */ - public java.lang.String getSubscriptions(int index) { - return subscriptions_.get(index); - } - /** - * - * - *
-   * The names of subscriptions attached to the topic specified in the request.
-   * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @param index The index of the value to return. - * @return The bytes of the subscriptions at the given index. - */ - public com.google.protobuf.ByteString getSubscriptionsBytes(int index) { - return subscriptions_.getByteString(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-   * If not empty, indicates that there may be more subscriptions that match
-   * the request; this value should be passed in a new
-   * `ListTopicSubscriptionsRequest` to get more subscriptions.
-   * 
- * - * 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 subscriptions that match
-   * the request; this value should be passed in a new
-   * `ListTopicSubscriptionsRequest` to get more subscriptions.
-   * 
- * - * 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 < subscriptions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscriptions_.getRaw(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < subscriptions_.size(); i++) { - dataSize += computeStringSizeNoTag(subscriptions_.getRaw(i)); - } - size += dataSize; - size += 1 * getSubscriptionsList().size(); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += getUnknownFields().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.ListTopicSubscriptionsResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListTopicSubscriptionsResponse other = - (com.google.pubsub.v1.ListTopicSubscriptionsResponse) obj; - - if (!getSubscriptionsList().equals(other.getSubscriptionsList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getSubscriptionsCount() > 0) { - hash = (37 * hash) + SUBSCRIPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getSubscriptionsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsResponse 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.ListTopicSubscriptionsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsResponse 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.ListTopicSubscriptionsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsResponse 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.ListTopicSubscriptionsResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsResponse 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.ListTopicSubscriptionsResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsResponse 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.ListTopicSubscriptionsResponse 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 `ListTopicSubscriptions` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicSubscriptionsResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListTopicSubscriptionsResponse) - com.google.pubsub.v1.ListTopicSubscriptionsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicSubscriptionsResponse.class, - com.google.pubsub.v1.ListTopicSubscriptionsResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListTopicSubscriptionsResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscriptions_ = com.google.protobuf.LazyStringArrayList.emptyList(); - nextPageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSubscriptionsResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.ListTopicSubscriptionsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSubscriptionsResponse build() { - com.google.pubsub.v1.ListTopicSubscriptionsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicSubscriptionsResponse buildPartial() { - com.google.pubsub.v1.ListTopicSubscriptionsResponse result = - new com.google.pubsub.v1.ListTopicSubscriptionsResponse(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ListTopicSubscriptionsResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - subscriptions_.makeImmutable(); - result.subscriptions_ = subscriptions_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nextPageToken_ = nextPageToken_; - } - } - - @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.ListTopicSubscriptionsResponse) { - return mergeFrom((com.google.pubsub.v1.ListTopicSubscriptionsResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListTopicSubscriptionsResponse other) { - if (other == com.google.pubsub.v1.ListTopicSubscriptionsResponse.getDefaultInstance()) - return this; - if (!other.subscriptions_.isEmpty()) { - if (subscriptions_.isEmpty()) { - subscriptions_ = other.subscriptions_; - bitField0_ |= 0x00000001; - } else { - ensureSubscriptionsIsMutable(); - subscriptions_.addAll(other.subscriptions_); - } - onChanged(); - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - 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(); - ensureSubscriptionsIsMutable(); - subscriptions_.add(s); - break; - } // case 10 - case 18: - { - nextPageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringArrayList subscriptions_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureSubscriptionsIsMutable() { - if (!subscriptions_.isModifiable()) { - subscriptions_ = new com.google.protobuf.LazyStringArrayList(subscriptions_); - } - bitField0_ |= 0x00000001; - } - /** - * - * - *
-     * The names of subscriptions attached to the topic specified in the request.
-     * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @return A list containing the subscriptions. - */ - public com.google.protobuf.ProtocolStringList getSubscriptionsList() { - subscriptions_.makeImmutable(); - return subscriptions_; - } - /** - * - * - *
-     * The names of subscriptions attached to the topic specified in the request.
-     * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @return The count of subscriptions. - */ - public int getSubscriptionsCount() { - return subscriptions_.size(); - } - /** - * - * - *
-     * The names of subscriptions attached to the topic specified in the request.
-     * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @param index The index of the element to return. - * @return The subscriptions at the given index. - */ - public java.lang.String getSubscriptions(int index) { - return subscriptions_.get(index); - } - /** - * - * - *
-     * The names of subscriptions attached to the topic specified in the request.
-     * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @param index The index of the value to return. - * @return The bytes of the subscriptions at the given index. - */ - public com.google.protobuf.ByteString getSubscriptionsBytes(int index) { - return subscriptions_.getByteString(index); - } - /** - * - * - *
-     * The names of subscriptions attached to the topic specified in the request.
-     * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @param index The index to set the value at. - * @param value The subscriptions to set. - * @return This builder for chaining. - */ - public Builder setSubscriptions(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSubscriptionsIsMutable(); - subscriptions_.set(index, value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The names of subscriptions attached to the topic specified in the request.
-     * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @param value The subscriptions to add. - * @return This builder for chaining. - */ - public Builder addSubscriptions(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSubscriptionsIsMutable(); - subscriptions_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The names of subscriptions attached to the topic specified in the request.
-     * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @param values The subscriptions to add. - * @return This builder for chaining. - */ - public Builder addAllSubscriptions(java.lang.Iterable values) { - ensureSubscriptionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, subscriptions_); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The names of subscriptions attached to the topic specified in the request.
-     * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @return This builder for chaining. - */ - public Builder clearSubscriptions() { - subscriptions_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - ; - onChanged(); - return this; - } - /** - * - * - *
-     * The names of subscriptions attached to the topic specified in the request.
-     * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @param value The bytes of the subscriptions to add. - * @return This builder for chaining. - */ - public Builder addSubscriptionsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureSubscriptionsIsMutable(); - subscriptions_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * If not empty, indicates that there may be more subscriptions that match
-     * the request; this value should be passed in a new
-     * `ListTopicSubscriptionsRequest` to get more subscriptions.
-     * 
- * - * 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 subscriptions that match
-     * the request; this value should be passed in a new
-     * `ListTopicSubscriptionsRequest` to get more subscriptions.
-     * 
- * - * 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 subscriptions that match
-     * the request; this value should be passed in a new
-     * `ListTopicSubscriptionsRequest` to get more subscriptions.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * If not empty, indicates that there may be more subscriptions that match
-     * the request; this value should be passed in a new
-     * `ListTopicSubscriptionsRequest` to get more subscriptions.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * If not empty, indicates that there may be more subscriptions that match
-     * the request; this value should be passed in a new
-     * `ListTopicSubscriptionsRequest` to get more subscriptions.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - 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.ListTopicSubscriptionsResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicSubscriptionsResponse) - private static final com.google.pubsub.v1.ListTopicSubscriptionsResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListTopicSubscriptionsResponse(); - } - - public static com.google.pubsub.v1.ListTopicSubscriptionsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListTopicSubscriptionsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListTopicSubscriptionsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponseOrBuilder.java deleted file mode 100644 index d8c6f021e..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponseOrBuilder.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2023 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 ListTopicSubscriptionsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListTopicSubscriptionsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The names of subscriptions attached to the topic specified in the request.
-   * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @return A list containing the subscriptions. - */ - java.util.List getSubscriptionsList(); - /** - * - * - *
-   * The names of subscriptions attached to the topic specified in the request.
-   * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @return The count of subscriptions. - */ - int getSubscriptionsCount(); - /** - * - * - *
-   * The names of subscriptions attached to the topic specified in the request.
-   * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @param index The index of the element to return. - * @return The subscriptions at the given index. - */ - java.lang.String getSubscriptions(int index); - /** - * - * - *
-   * The names of subscriptions attached to the topic specified in the request.
-   * 
- * - * repeated string subscriptions = 1 [(.google.api.resource_reference) = { ... } - * - * @param index The index of the value to return. - * @return The bytes of the subscriptions at the given index. - */ - com.google.protobuf.ByteString getSubscriptionsBytes(int index); - - /** - * - * - *
-   * If not empty, indicates that there may be more subscriptions that match
-   * the request; this value should be passed in a new
-   * `ListTopicSubscriptionsRequest` to get more subscriptions.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * If not empty, indicates that there may be more subscriptions that match
-   * the request; this value should be passed in a new
-   * `ListTopicSubscriptionsRequest` to get more subscriptions.
-   * 
- * - * 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/ListTopicsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsRequest.java deleted file mode 100644 index 5c2e9d64b..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsRequest.java +++ /dev/null @@ -1,932 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `ListTopics` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicsRequest} - */ -public final class ListTopicsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListTopicsRequest) - ListTopicsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListTopicsRequest.newBuilder() to construct. - private ListTopicsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListTopicsRequest() { - project_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListTopicsRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicsRequest.class, - com.google.pubsub.v1.ListTopicsRequest.Builder.class); - } - - public static final int PROJECT_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object project_ = ""; - /** - * - * - *
-   * Required. The name of the project in which to list topics.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - @java.lang.Override - public java.lang.String getProject() { - java.lang.Object ref = project_; - 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(); - project_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the project in which to list topics.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - @java.lang.Override - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_ = 0; - /** - * - * - *
-   * Maximum number of topics to return.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object pageToken_ = ""; - /** - * - * - *
-   * The value returned by the last `ListTopicsResponse`; indicates that this is
-   * a continuation of a prior `ListTopics` call, and that the system should
-   * return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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 `ListTopicsResponse`; indicates that this is
-   * a continuation of a prior `ListTopics` call, and that the system should
-   * return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += getUnknownFields().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.ListTopicsRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListTopicsRequest other = (com.google.pubsub.v1.ListTopicsRequest) obj; - - if (!getProject().equals(other.getProject())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PROJECT_FIELD_NUMBER; - hash = (53 * hash) + getProject().hashCode(); - 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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListTopicsRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicsRequest 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.ListTopicsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicsRequest 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.ListTopicsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicsRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListTopicsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicsRequest 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.ListTopicsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicsRequest 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.ListTopicsRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicsRequest 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.ListTopicsRequest 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 `ListTopics` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicsRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListTopicsRequest) - com.google.pubsub.v1.ListTopicsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicsRequest.class, - com.google.pubsub.v1.ListTopicsRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListTopicsRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - project_ = ""; - pageSize_ = 0; - pageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicsRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicsRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicsRequest build() { - com.google.pubsub.v1.ListTopicsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicsRequest buildPartial() { - com.google.pubsub.v1.ListTopicsRequest result = - new com.google.pubsub.v1.ListTopicsRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ListTopicsRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.project_ = project_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.pageSize_ = pageSize_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pageToken_ = pageToken_; - } - } - - @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.ListTopicsRequest) { - return mergeFrom((com.google.pubsub.v1.ListTopicsRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListTopicsRequest other) { - if (other == com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance()) return this; - if (!other.getProject().isEmpty()) { - project_ = other.project_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - bitField0_ |= 0x00000004; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - project_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - pageSize_ = input.readInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: - { - pageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object project_ = ""; - /** - * - * - *
-     * Required. The name of the project in which to list topics.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - public java.lang.String getProject() { - java.lang.Object ref = project_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - project_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the project in which to list topics.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - public com.google.protobuf.ByteString getProjectBytes() { - java.lang.Object ref = project_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - project_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the project in which to list topics.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The project to set. - * @return This builder for chaining. - */ - public Builder setProject(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - project_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the project in which to list topics.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearProject() { - project_ = getDefaultInstance().getProject(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the project in which to list topics.
-     * Format is `projects/{project-id}`.
-     * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for project to set. - * @return This builder for chaining. - */ - public Builder setProjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - project_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * Maximum number of topics to return.
-     * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * Maximum number of topics to return.
-     * 
- * - * int32 page_size = 2; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Maximum number of topics to return.
-     * 
- * - * int32 page_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - bitField0_ = (bitField0_ & ~0x00000002); - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * The value returned by the last `ListTopicsResponse`; indicates that this is
-     * a continuation of a prior `ListTopics` call, and that the system should
-     * return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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 `ListTopicsResponse`; indicates that this is
-     * a continuation of a prior `ListTopics` call, and that the system should
-     * return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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 `ListTopicsResponse`; indicates that this is
-     * a continuation of a prior `ListTopics` call, and that the system should
-     * return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The value returned by the last `ListTopicsResponse`; indicates that this is
-     * a continuation of a prior `ListTopics` call, and that the system should
-     * return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-     * The value returned by the last `ListTopicsResponse`; indicates that this is
-     * a continuation of a prior `ListTopics` call, and that the system should
-     * return the next page of data.
-     * 
- * - * string page_token = 3; - * - * @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; - bitField0_ |= 0x00000004; - 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.ListTopicsRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicsRequest) - private static final com.google.pubsub.v1.ListTopicsRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListTopicsRequest(); - } - - public static com.google.pubsub.v1.ListTopicsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListTopicsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListTopicsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsRequestOrBuilder.java deleted file mode 100644 index 3e0d2ffb0..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsRequestOrBuilder.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2023 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 ListTopicsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListTopicsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the project in which to list topics.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The project. - */ - java.lang.String getProject(); - /** - * - * - *
-   * Required. The name of the project in which to list topics.
-   * Format is `projects/{project-id}`.
-   * 
- * - * - * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for project. - */ - com.google.protobuf.ByteString getProjectBytes(); - - /** - * - * - *
-   * Maximum number of topics to return.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * The value returned by the last `ListTopicsResponse`; indicates that this is
-   * a continuation of a prior `ListTopics` call, and that the system should
-   * return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * The value returned by the last `ListTopicsResponse`; indicates that this is
-   * a continuation of a prior `ListTopics` call, and that the system should
-   * return the next page of data.
-   * 
- * - * string page_token = 3; - * - * @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/ListTopicsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsResponse.java deleted file mode 100644 index b3f73a27d..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsResponse.java +++ /dev/null @@ -1,1112 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Response for the `ListTopics` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicsResponse} - */ -public final class ListTopicsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ListTopicsResponse) - ListTopicsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListTopicsResponse.newBuilder() to construct. - private ListTopicsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListTopicsResponse() { - topics_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListTopicsResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicsResponse.class, - com.google.pubsub.v1.ListTopicsResponse.Builder.class); - } - - public static final int TOPICS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private java.util.List topics_; - /** - * - * - *
-   * The resulting topics.
-   * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - @java.lang.Override - public java.util.List getTopicsList() { - return topics_; - } - /** - * - * - *
-   * The resulting topics.
-   * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - @java.lang.Override - public java.util.List getTopicsOrBuilderList() { - return topics_; - } - /** - * - * - *
-   * The resulting topics.
-   * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - @java.lang.Override - public int getTopicsCount() { - return topics_.size(); - } - /** - * - * - *
-   * The resulting topics.
-   * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.Topic getTopics(int index) { - return topics_.get(index); - } - /** - * - * - *
-   * The resulting topics.
-   * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.TopicOrBuilder getTopicsOrBuilder(int index) { - return topics_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-   * If not empty, indicates that there may be more topics that match the
-   * request; this value should be passed in a new `ListTopicsRequest`.
-   * 
- * - * 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 topics that match the
-   * request; this value should be passed in a new `ListTopicsRequest`.
-   * 
- * - * 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 < topics_.size(); i++) { - output.writeMessage(1, topics_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < topics_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, topics_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += getUnknownFields().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.ListTopicsResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.ListTopicsResponse other = (com.google.pubsub.v1.ListTopicsResponse) obj; - - if (!getTopicsList().equals(other.getTopicsList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getTopicsCount() > 0) { - hash = (37 * hash) + TOPICS_FIELD_NUMBER; - hash = (53 * hash) + getTopicsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ListTopicsResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicsResponse 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.ListTopicsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicsResponse 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.ListTopicsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ListTopicsResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ListTopicsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicsResponse 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.ListTopicsResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicsResponse 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.ListTopicsResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ListTopicsResponse 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.ListTopicsResponse 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 `ListTopics` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ListTopicsResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ListTopicsResponse) - com.google.pubsub.v1.ListTopicsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ListTopicsResponse.class, - com.google.pubsub.v1.ListTopicsResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.ListTopicsResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (topicsBuilder_ == null) { - topics_ = java.util.Collections.emptyList(); - } else { - topics_ = null; - topicsBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - nextPageToken_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ListTopicsResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicsResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.ListTopicsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicsResponse build() { - com.google.pubsub.v1.ListTopicsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ListTopicsResponse buildPartial() { - com.google.pubsub.v1.ListTopicsResponse result = - new com.google.pubsub.v1.ListTopicsResponse(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(com.google.pubsub.v1.ListTopicsResponse result) { - if (topicsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - topics_ = java.util.Collections.unmodifiableList(topics_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.topics_ = topics_; - } else { - result.topics_ = topicsBuilder_.build(); - } - } - - private void buildPartial0(com.google.pubsub.v1.ListTopicsResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nextPageToken_ = nextPageToken_; - } - } - - @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.ListTopicsResponse) { - return mergeFrom((com.google.pubsub.v1.ListTopicsResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ListTopicsResponse other) { - if (other == com.google.pubsub.v1.ListTopicsResponse.getDefaultInstance()) return this; - if (topicsBuilder_ == null) { - if (!other.topics_.isEmpty()) { - if (topics_.isEmpty()) { - topics_ = other.topics_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTopicsIsMutable(); - topics_.addAll(other.topics_); - } - onChanged(); - } - } else { - if (!other.topics_.isEmpty()) { - if (topicsBuilder_.isEmpty()) { - topicsBuilder_.dispose(); - topicsBuilder_ = null; - topics_ = other.topics_; - bitField0_ = (bitField0_ & ~0x00000001); - topicsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getTopicsFieldBuilder() - : null; - } else { - topicsBuilder_.addAllMessages(other.topics_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.pubsub.v1.Topic m = - input.readMessage(com.google.pubsub.v1.Topic.parser(), extensionRegistry); - if (topicsBuilder_ == null) { - ensureTopicsIsMutable(); - topics_.add(m); - } else { - topicsBuilder_.addMessage(m); - } - break; - } // case 10 - case 18: - { - nextPageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List topics_ = java.util.Collections.emptyList(); - - private void ensureTopicsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - topics_ = new java.util.ArrayList(topics_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.Topic, - com.google.pubsub.v1.Topic.Builder, - com.google.pubsub.v1.TopicOrBuilder> - topicsBuilder_; - - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public java.util.List getTopicsList() { - if (topicsBuilder_ == null) { - return java.util.Collections.unmodifiableList(topics_); - } else { - return topicsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public int getTopicsCount() { - if (topicsBuilder_ == null) { - return topics_.size(); - } else { - return topicsBuilder_.getCount(); - } - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public com.google.pubsub.v1.Topic getTopics(int index) { - if (topicsBuilder_ == null) { - return topics_.get(index); - } else { - return topicsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public Builder setTopics(int index, com.google.pubsub.v1.Topic value) { - if (topicsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTopicsIsMutable(); - topics_.set(index, value); - onChanged(); - } else { - topicsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public Builder setTopics(int index, com.google.pubsub.v1.Topic.Builder builderForValue) { - if (topicsBuilder_ == null) { - ensureTopicsIsMutable(); - topics_.set(index, builderForValue.build()); - onChanged(); - } else { - topicsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public Builder addTopics(com.google.pubsub.v1.Topic value) { - if (topicsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTopicsIsMutable(); - topics_.add(value); - onChanged(); - } else { - topicsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public Builder addTopics(int index, com.google.pubsub.v1.Topic value) { - if (topicsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTopicsIsMutable(); - topics_.add(index, value); - onChanged(); - } else { - topicsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public Builder addTopics(com.google.pubsub.v1.Topic.Builder builderForValue) { - if (topicsBuilder_ == null) { - ensureTopicsIsMutable(); - topics_.add(builderForValue.build()); - onChanged(); - } else { - topicsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public Builder addTopics(int index, com.google.pubsub.v1.Topic.Builder builderForValue) { - if (topicsBuilder_ == null) { - ensureTopicsIsMutable(); - topics_.add(index, builderForValue.build()); - onChanged(); - } else { - topicsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public Builder addAllTopics(java.lang.Iterable values) { - if (topicsBuilder_ == null) { - ensureTopicsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, topics_); - onChanged(); - } else { - topicsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public Builder clearTopics() { - if (topicsBuilder_ == null) { - topics_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - topicsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public Builder removeTopics(int index) { - if (topicsBuilder_ == null) { - ensureTopicsIsMutable(); - topics_.remove(index); - onChanged(); - } else { - topicsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public com.google.pubsub.v1.Topic.Builder getTopicsBuilder(int index) { - return getTopicsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public com.google.pubsub.v1.TopicOrBuilder getTopicsOrBuilder(int index) { - if (topicsBuilder_ == null) { - return topics_.get(index); - } else { - return topicsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public java.util.List getTopicsOrBuilderList() { - if (topicsBuilder_ != null) { - return topicsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(topics_); - } - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public com.google.pubsub.v1.Topic.Builder addTopicsBuilder() { - return getTopicsFieldBuilder().addBuilder(com.google.pubsub.v1.Topic.getDefaultInstance()); - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public com.google.pubsub.v1.Topic.Builder addTopicsBuilder(int index) { - return getTopicsFieldBuilder() - .addBuilder(index, com.google.pubsub.v1.Topic.getDefaultInstance()); - } - /** - * - * - *
-     * The resulting topics.
-     * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - public java.util.List getTopicsBuilderList() { - return getTopicsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.Topic, - com.google.pubsub.v1.Topic.Builder, - com.google.pubsub.v1.TopicOrBuilder> - getTopicsFieldBuilder() { - if (topicsBuilder_ == null) { - topicsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.Topic, - com.google.pubsub.v1.Topic.Builder, - com.google.pubsub.v1.TopicOrBuilder>( - topics_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - topics_ = null; - } - return topicsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * If not empty, indicates that there may be more topics that match the
-     * request; this value should be passed in a new `ListTopicsRequest`.
-     * 
- * - * 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 topics that match the
-     * request; this value should be passed in a new `ListTopicsRequest`.
-     * 
- * - * 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 topics that match the
-     * request; this value should be passed in a new `ListTopicsRequest`.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * If not empty, indicates that there may be more topics that match the
-     * request; this value should be passed in a new `ListTopicsRequest`.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * If not empty, indicates that there may be more topics that match the
-     * request; this value should be passed in a new `ListTopicsRequest`.
-     * 
- * - * 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; - bitField0_ |= 0x00000002; - 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.ListTopicsResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicsResponse) - private static final com.google.pubsub.v1.ListTopicsResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ListTopicsResponse(); - } - - public static com.google.pubsub.v1.ListTopicsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListTopicsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ListTopicsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsResponseOrBuilder.java deleted file mode 100644 index fd03ece34..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsResponseOrBuilder.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2023 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 ListTopicsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ListTopicsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The resulting topics.
-   * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - java.util.List getTopicsList(); - /** - * - * - *
-   * The resulting topics.
-   * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - com.google.pubsub.v1.Topic getTopics(int index); - /** - * - * - *
-   * The resulting topics.
-   * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - int getTopicsCount(); - /** - * - * - *
-   * The resulting topics.
-   * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - java.util.List getTopicsOrBuilderList(); - /** - * - * - *
-   * The resulting topics.
-   * 
- * - * repeated .google.pubsub.v1.Topic topics = 1; - */ - com.google.pubsub.v1.TopicOrBuilder getTopicsOrBuilder(int index); - - /** - * - * - *
-   * If not empty, indicates that there may be more topics that match the
-   * request; this value should be passed in a new `ListTopicsRequest`.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * If not empty, indicates that there may be more topics that match the
-   * request; this value should be passed in a new `ListTopicsRequest`.
-   * 
- * - * 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/MessageStoragePolicy.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/MessageStoragePolicy.java deleted file mode 100644 index 06c6e9aba..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/MessageStoragePolicy.java +++ /dev/null @@ -1,786 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * A policy constraining the storage of messages published to the topic.
- * 
- * - * Protobuf type {@code google.pubsub.v1.MessageStoragePolicy} - */ -public final class MessageStoragePolicy extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.MessageStoragePolicy) - MessageStoragePolicyOrBuilder { - private static final long serialVersionUID = 0L; - // Use MessageStoragePolicy.newBuilder() to construct. - private MessageStoragePolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private MessageStoragePolicy() { - allowedPersistenceRegions_ = com.google.protobuf.LazyStringArrayList.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MessageStoragePolicy(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_MessageStoragePolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_MessageStoragePolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.MessageStoragePolicy.class, - com.google.pubsub.v1.MessageStoragePolicy.Builder.class); - } - - public static final int ALLOWED_PERSISTENCE_REGIONS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList allowedPersistenceRegions_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-   * A list of IDs of Google Cloud regions where messages that are published
-   * to the topic may be persisted in storage. Messages published by publishers
-   * running in non-allowed Google Cloud regions (or running outside of Google
-   * Cloud altogether) are routed for storage in one of the allowed regions.
-   * An empty list means that no regions are allowed, and is not a valid
-   * configuration.
-   * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @return A list containing the allowedPersistenceRegions. - */ - public com.google.protobuf.ProtocolStringList getAllowedPersistenceRegionsList() { - return allowedPersistenceRegions_; - } - /** - * - * - *
-   * A list of IDs of Google Cloud regions where messages that are published
-   * to the topic may be persisted in storage. Messages published by publishers
-   * running in non-allowed Google Cloud regions (or running outside of Google
-   * Cloud altogether) are routed for storage in one of the allowed regions.
-   * An empty list means that no regions are allowed, and is not a valid
-   * configuration.
-   * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @return The count of allowedPersistenceRegions. - */ - public int getAllowedPersistenceRegionsCount() { - return allowedPersistenceRegions_.size(); - } - /** - * - * - *
-   * A list of IDs of Google Cloud regions where messages that are published
-   * to the topic may be persisted in storage. Messages published by publishers
-   * running in non-allowed Google Cloud regions (or running outside of Google
-   * Cloud altogether) are routed for storage in one of the allowed regions.
-   * An empty list means that no regions are allowed, and is not a valid
-   * configuration.
-   * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @param index The index of the element to return. - * @return The allowedPersistenceRegions at the given index. - */ - public java.lang.String getAllowedPersistenceRegions(int index) { - return allowedPersistenceRegions_.get(index); - } - /** - * - * - *
-   * A list of IDs of Google Cloud regions where messages that are published
-   * to the topic may be persisted in storage. Messages published by publishers
-   * running in non-allowed Google Cloud regions (or running outside of Google
-   * Cloud altogether) are routed for storage in one of the allowed regions.
-   * An empty list means that no regions are allowed, and is not a valid
-   * configuration.
-   * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @param index The index of the value to return. - * @return The bytes of the allowedPersistenceRegions at the given index. - */ - public com.google.protobuf.ByteString getAllowedPersistenceRegionsBytes(int index) { - return allowedPersistenceRegions_.getByteString(index); - } - - 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 < allowedPersistenceRegions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( - output, 1, allowedPersistenceRegions_.getRaw(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < allowedPersistenceRegions_.size(); i++) { - dataSize += computeStringSizeNoTag(allowedPersistenceRegions_.getRaw(i)); - } - size += dataSize; - size += 1 * getAllowedPersistenceRegionsList().size(); - } - size += getUnknownFields().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.MessageStoragePolicy)) { - return super.equals(obj); - } - com.google.pubsub.v1.MessageStoragePolicy other = - (com.google.pubsub.v1.MessageStoragePolicy) obj; - - if (!getAllowedPersistenceRegionsList().equals(other.getAllowedPersistenceRegionsList())) - return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAllowedPersistenceRegionsCount() > 0) { - hash = (37 * hash) + ALLOWED_PERSISTENCE_REGIONS_FIELD_NUMBER; - hash = (53 * hash) + getAllowedPersistenceRegionsList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.MessageStoragePolicy parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.MessageStoragePolicy 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.MessageStoragePolicy parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.MessageStoragePolicy 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.MessageStoragePolicy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.MessageStoragePolicy parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.MessageStoragePolicy parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.MessageStoragePolicy 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.MessageStoragePolicy parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.MessageStoragePolicy 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.MessageStoragePolicy parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.MessageStoragePolicy 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.MessageStoragePolicy 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 policy constraining the storage of messages published to the topic.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.MessageStoragePolicy} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.MessageStoragePolicy) - com.google.pubsub.v1.MessageStoragePolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_MessageStoragePolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_MessageStoragePolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.MessageStoragePolicy.class, - com.google.pubsub.v1.MessageStoragePolicy.Builder.class); - } - - // Construct using com.google.pubsub.v1.MessageStoragePolicy.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - allowedPersistenceRegions_ = com.google.protobuf.LazyStringArrayList.emptyList(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_MessageStoragePolicy_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.MessageStoragePolicy getDefaultInstanceForType() { - return com.google.pubsub.v1.MessageStoragePolicy.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.MessageStoragePolicy build() { - com.google.pubsub.v1.MessageStoragePolicy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.MessageStoragePolicy buildPartial() { - com.google.pubsub.v1.MessageStoragePolicy result = - new com.google.pubsub.v1.MessageStoragePolicy(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.MessageStoragePolicy result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - allowedPersistenceRegions_.makeImmutable(); - result.allowedPersistenceRegions_ = allowedPersistenceRegions_; - } - } - - @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.MessageStoragePolicy) { - return mergeFrom((com.google.pubsub.v1.MessageStoragePolicy) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.MessageStoragePolicy other) { - if (other == com.google.pubsub.v1.MessageStoragePolicy.getDefaultInstance()) return this; - if (!other.allowedPersistenceRegions_.isEmpty()) { - if (allowedPersistenceRegions_.isEmpty()) { - allowedPersistenceRegions_ = other.allowedPersistenceRegions_; - bitField0_ |= 0x00000001; - } else { - ensureAllowedPersistenceRegionsIsMutable(); - allowedPersistenceRegions_.addAll(other.allowedPersistenceRegions_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - 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(); - ensureAllowedPersistenceRegionsIsMutable(); - allowedPersistenceRegions_.add(s); - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringArrayList allowedPersistenceRegions_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureAllowedPersistenceRegionsIsMutable() { - if (!allowedPersistenceRegions_.isModifiable()) { - allowedPersistenceRegions_ = - new com.google.protobuf.LazyStringArrayList(allowedPersistenceRegions_); - } - bitField0_ |= 0x00000001; - } - /** - * - * - *
-     * A list of IDs of Google Cloud regions where messages that are published
-     * to the topic may be persisted in storage. Messages published by publishers
-     * running in non-allowed Google Cloud regions (or running outside of Google
-     * Cloud altogether) are routed for storage in one of the allowed regions.
-     * An empty list means that no regions are allowed, and is not a valid
-     * configuration.
-     * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @return A list containing the allowedPersistenceRegions. - */ - public com.google.protobuf.ProtocolStringList getAllowedPersistenceRegionsList() { - allowedPersistenceRegions_.makeImmutable(); - return allowedPersistenceRegions_; - } - /** - * - * - *
-     * A list of IDs of Google Cloud regions where messages that are published
-     * to the topic may be persisted in storage. Messages published by publishers
-     * running in non-allowed Google Cloud regions (or running outside of Google
-     * Cloud altogether) are routed for storage in one of the allowed regions.
-     * An empty list means that no regions are allowed, and is not a valid
-     * configuration.
-     * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @return The count of allowedPersistenceRegions. - */ - public int getAllowedPersistenceRegionsCount() { - return allowedPersistenceRegions_.size(); - } - /** - * - * - *
-     * A list of IDs of Google Cloud regions where messages that are published
-     * to the topic may be persisted in storage. Messages published by publishers
-     * running in non-allowed Google Cloud regions (or running outside of Google
-     * Cloud altogether) are routed for storage in one of the allowed regions.
-     * An empty list means that no regions are allowed, and is not a valid
-     * configuration.
-     * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @param index The index of the element to return. - * @return The allowedPersistenceRegions at the given index. - */ - public java.lang.String getAllowedPersistenceRegions(int index) { - return allowedPersistenceRegions_.get(index); - } - /** - * - * - *
-     * A list of IDs of Google Cloud regions where messages that are published
-     * to the topic may be persisted in storage. Messages published by publishers
-     * running in non-allowed Google Cloud regions (or running outside of Google
-     * Cloud altogether) are routed for storage in one of the allowed regions.
-     * An empty list means that no regions are allowed, and is not a valid
-     * configuration.
-     * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @param index The index of the value to return. - * @return The bytes of the allowedPersistenceRegions at the given index. - */ - public com.google.protobuf.ByteString getAllowedPersistenceRegionsBytes(int index) { - return allowedPersistenceRegions_.getByteString(index); - } - /** - * - * - *
-     * A list of IDs of Google Cloud regions where messages that are published
-     * to the topic may be persisted in storage. Messages published by publishers
-     * running in non-allowed Google Cloud regions (or running outside of Google
-     * Cloud altogether) are routed for storage in one of the allowed regions.
-     * An empty list means that no regions are allowed, and is not a valid
-     * configuration.
-     * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @param index The index to set the value at. - * @param value The allowedPersistenceRegions to set. - * @return This builder for chaining. - */ - public Builder setAllowedPersistenceRegions(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAllowedPersistenceRegionsIsMutable(); - allowedPersistenceRegions_.set(index, value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * A list of IDs of Google Cloud regions where messages that are published
-     * to the topic may be persisted in storage. Messages published by publishers
-     * running in non-allowed Google Cloud regions (or running outside of Google
-     * Cloud altogether) are routed for storage in one of the allowed regions.
-     * An empty list means that no regions are allowed, and is not a valid
-     * configuration.
-     * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @param value The allowedPersistenceRegions to add. - * @return This builder for chaining. - */ - public Builder addAllowedPersistenceRegions(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAllowedPersistenceRegionsIsMutable(); - allowedPersistenceRegions_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * A list of IDs of Google Cloud regions where messages that are published
-     * to the topic may be persisted in storage. Messages published by publishers
-     * running in non-allowed Google Cloud regions (or running outside of Google
-     * Cloud altogether) are routed for storage in one of the allowed regions.
-     * An empty list means that no regions are allowed, and is not a valid
-     * configuration.
-     * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @param values The allowedPersistenceRegions to add. - * @return This builder for chaining. - */ - public Builder addAllAllowedPersistenceRegions(java.lang.Iterable values) { - ensureAllowedPersistenceRegionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedPersistenceRegions_); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * A list of IDs of Google Cloud regions where messages that are published
-     * to the topic may be persisted in storage. Messages published by publishers
-     * running in non-allowed Google Cloud regions (or running outside of Google
-     * Cloud altogether) are routed for storage in one of the allowed regions.
-     * An empty list means that no regions are allowed, and is not a valid
-     * configuration.
-     * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @return This builder for chaining. - */ - public Builder clearAllowedPersistenceRegions() { - allowedPersistenceRegions_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - ; - onChanged(); - return this; - } - /** - * - * - *
-     * A list of IDs of Google Cloud regions where messages that are published
-     * to the topic may be persisted in storage. Messages published by publishers
-     * running in non-allowed Google Cloud regions (or running outside of Google
-     * Cloud altogether) are routed for storage in one of the allowed regions.
-     * An empty list means that no regions are allowed, and is not a valid
-     * configuration.
-     * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @param value The bytes of the allowedPersistenceRegions to add. - * @return This builder for chaining. - */ - public Builder addAllowedPersistenceRegionsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAllowedPersistenceRegionsIsMutable(); - allowedPersistenceRegions_.add(value); - bitField0_ |= 0x00000001; - 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.MessageStoragePolicy) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.MessageStoragePolicy) - private static final com.google.pubsub.v1.MessageStoragePolicy DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.MessageStoragePolicy(); - } - - public static com.google.pubsub.v1.MessageStoragePolicy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MessageStoragePolicy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.MessageStoragePolicy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/MessageStoragePolicyOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/MessageStoragePolicyOrBuilder.java deleted file mode 100644 index 5f075aca0..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/MessageStoragePolicyOrBuilder.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2023 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 MessageStoragePolicyOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.MessageStoragePolicy) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * A list of IDs of Google Cloud regions where messages that are published
-   * to the topic may be persisted in storage. Messages published by publishers
-   * running in non-allowed Google Cloud regions (or running outside of Google
-   * Cloud altogether) are routed for storage in one of the allowed regions.
-   * An empty list means that no regions are allowed, and is not a valid
-   * configuration.
-   * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @return A list containing the allowedPersistenceRegions. - */ - java.util.List getAllowedPersistenceRegionsList(); - /** - * - * - *
-   * A list of IDs of Google Cloud regions where messages that are published
-   * to the topic may be persisted in storage. Messages published by publishers
-   * running in non-allowed Google Cloud regions (or running outside of Google
-   * Cloud altogether) are routed for storage in one of the allowed regions.
-   * An empty list means that no regions are allowed, and is not a valid
-   * configuration.
-   * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @return The count of allowedPersistenceRegions. - */ - int getAllowedPersistenceRegionsCount(); - /** - * - * - *
-   * A list of IDs of Google Cloud regions where messages that are published
-   * to the topic may be persisted in storage. Messages published by publishers
-   * running in non-allowed Google Cloud regions (or running outside of Google
-   * Cloud altogether) are routed for storage in one of the allowed regions.
-   * An empty list means that no regions are allowed, and is not a valid
-   * configuration.
-   * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @param index The index of the element to return. - * @return The allowedPersistenceRegions at the given index. - */ - java.lang.String getAllowedPersistenceRegions(int index); - /** - * - * - *
-   * A list of IDs of Google Cloud regions where messages that are published
-   * to the topic may be persisted in storage. Messages published by publishers
-   * running in non-allowed Google Cloud regions (or running outside of Google
-   * Cloud altogether) are routed for storage in one of the allowed regions.
-   * An empty list means that no regions are allowed, and is not a valid
-   * configuration.
-   * 
- * - * repeated string allowed_persistence_regions = 1; - * - * @param index The index of the value to return. - * @return The bytes of the allowedPersistenceRegions at the given index. - */ - com.google.protobuf.ByteString getAllowedPersistenceRegionsBytes(int index); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java deleted file mode 100644 index 8348ebf3c..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java +++ /dev/null @@ -1,1042 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the ModifyAckDeadline method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ModifyAckDeadlineRequest} - */ -public final class ModifyAckDeadlineRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ModifyAckDeadlineRequest) - ModifyAckDeadlineRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ModifyAckDeadlineRequest.newBuilder() to construct. - private ModifyAckDeadlineRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ModifyAckDeadlineRequest() { - subscription_ = ""; - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ModifyAckDeadlineRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ModifyAckDeadlineRequest.class, - com.google.pubsub.v1.ModifyAckDeadlineRequest.Builder.class); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object subscription_ = ""; - /** - * - * - *
-   * Required. The name of the subscription.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - @java.lang.Override - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - 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(); - subscription_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the subscription.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ACK_IDS_FIELD_NUMBER = 4; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList ackIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-   * Required. List of acknowledgment IDs.
-   * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @return A list containing the ackIds. - */ - public com.google.protobuf.ProtocolStringList getAckIdsList() { - return ackIds_; - } - /** - * - * - *
-   * Required. List of acknowledgment IDs.
-   * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The count of ackIds. - */ - public int getAckIdsCount() { - return ackIds_.size(); - } - /** - * - * - *
-   * Required. List of acknowledgment IDs.
-   * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - public java.lang.String getAckIds(int index) { - return ackIds_.get(index); - } - /** - * - * - *
-   * Required. List of acknowledgment IDs.
-   * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - public com.google.protobuf.ByteString getAckIdsBytes(int index) { - return ackIds_.getByteString(index); - } - - public static final int ACK_DEADLINE_SECONDS_FIELD_NUMBER = 3; - private int ackDeadlineSeconds_ = 0; - /** - * - * - *
-   * Required. The new ack deadline with respect to the time this request was
-   * sent to the Pub/Sub system. For example, if the value is 10, the new ack
-   * deadline will expire 10 seconds after the `ModifyAckDeadline` call was
-   * made. Specifying zero might immediately make the message available for
-   * delivery to another subscriber client. This typically results in an
-   * increase in the rate of message redeliveries (that is, duplicates).
-   * The minimum deadline you can specify is 0 seconds.
-   * The maximum deadline you can specify is 600 seconds (10 minutes).
-   * 
- * - * int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The ackDeadlineSeconds. - */ - @java.lang.Override - public int getAckDeadlineSeconds() { - return ackDeadlineSeconds_; - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); - } - if (ackDeadlineSeconds_ != 0) { - output.writeInt32(3, ackDeadlineSeconds_); - } - for (int i = 0; i < ackIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, ackIds_.getRaw(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_); - } - if (ackDeadlineSeconds_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, ackDeadlineSeconds_); - } - { - int dataSize = 0; - for (int i = 0; i < ackIds_.size(); i++) { - dataSize += computeStringSizeNoTag(ackIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getAckIdsList().size(); - } - size += getUnknownFields().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.ModifyAckDeadlineRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.ModifyAckDeadlineRequest other = - (com.google.pubsub.v1.ModifyAckDeadlineRequest) obj; - - if (!getSubscription().equals(other.getSubscription())) return false; - if (!getAckIdsList().equals(other.getAckIdsList())) return false; - if (getAckDeadlineSeconds() != other.getAckDeadlineSeconds()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - if (getAckIdsCount() > 0) { - hash = (37 * hash) + ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getAckIdsList().hashCode(); - } - hash = (37 * hash) + ACK_DEADLINE_SECONDS_FIELD_NUMBER; - hash = (53 * hash) + getAckDeadlineSeconds(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ModifyAckDeadlineRequest 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.ModifyAckDeadlineRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ModifyAckDeadlineRequest 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.ModifyAckDeadlineRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ModifyAckDeadlineRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ModifyAckDeadlineRequest 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.ModifyAckDeadlineRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ModifyAckDeadlineRequest 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.ModifyAckDeadlineRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ModifyAckDeadlineRequest 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.ModifyAckDeadlineRequest 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 ModifyAckDeadline method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ModifyAckDeadlineRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ModifyAckDeadlineRequest) - com.google.pubsub.v1.ModifyAckDeadlineRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ModifyAckDeadlineRequest.class, - com.google.pubsub.v1.ModifyAckDeadlineRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.ModifyAckDeadlineRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscription_ = ""; - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - ackDeadlineSeconds_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ModifyAckDeadlineRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.ModifyAckDeadlineRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ModifyAckDeadlineRequest build() { - com.google.pubsub.v1.ModifyAckDeadlineRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ModifyAckDeadlineRequest buildPartial() { - com.google.pubsub.v1.ModifyAckDeadlineRequest result = - new com.google.pubsub.v1.ModifyAckDeadlineRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ModifyAckDeadlineRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.subscription_ = subscription_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - ackIds_.makeImmutable(); - result.ackIds_ = ackIds_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.ackDeadlineSeconds_ = ackDeadlineSeconds_; - } - } - - @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.ModifyAckDeadlineRequest) { - return mergeFrom((com.google.pubsub.v1.ModifyAckDeadlineRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ModifyAckDeadlineRequest other) { - if (other == com.google.pubsub.v1.ModifyAckDeadlineRequest.getDefaultInstance()) return this; - if (!other.getSubscription().isEmpty()) { - subscription_ = other.subscription_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.ackIds_.isEmpty()) { - if (ackIds_.isEmpty()) { - ackIds_ = other.ackIds_; - bitField0_ |= 0x00000002; - } else { - ensureAckIdsIsMutable(); - ackIds_.addAll(other.ackIds_); - } - onChanged(); - } - if (other.getAckDeadlineSeconds() != 0) { - setAckDeadlineSeconds(other.getAckDeadlineSeconds()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - subscription_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 24: - { - ackDeadlineSeconds_ = input.readInt32(); - bitField0_ |= 0x00000004; - break; - } // case 24 - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureAckIdsIsMutable(); - ackIds_.add(s); - break; - } // case 34 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object subscription_ = ""; - /** - * - * - *
-     * Required. The name of the subscription.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the subscription.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the subscription.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the subscription.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSubscription() { - subscription_ = getDefaultInstance().getSubscription(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the subscription.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringArrayList ackIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureAckIdsIsMutable() { - if (!ackIds_.isModifiable()) { - ackIds_ = new com.google.protobuf.LazyStringArrayList(ackIds_); - } - bitField0_ |= 0x00000002; - } - /** - * - * - *
-     * Required. List of acknowledgment IDs.
-     * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @return A list containing the ackIds. - */ - public com.google.protobuf.ProtocolStringList getAckIdsList() { - ackIds_.makeImmutable(); - return ackIds_; - } - /** - * - * - *
-     * Required. List of acknowledgment IDs.
-     * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The count of ackIds. - */ - public int getAckIdsCount() { - return ackIds_.size(); - } - /** - * - * - *
-     * Required. List of acknowledgment IDs.
-     * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - public java.lang.String getAckIds(int index) { - return ackIds_.get(index); - } - /** - * - * - *
-     * Required. List of acknowledgment IDs.
-     * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - public com.google.protobuf.ByteString getAckIdsBytes(int index) { - return ackIds_.getByteString(index); - } - /** - * - * - *
-     * Required. List of acknowledgment IDs.
-     * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index to set the value at. - * @param value The ackIds to set. - * @return This builder for chaining. - */ - public Builder setAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAckIdsIsMutable(); - ackIds_.set(index, value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. List of acknowledgment IDs.
-     * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The ackIds to add. - * @return This builder for chaining. - */ - public Builder addAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAckIdsIsMutable(); - ackIds_.add(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. List of acknowledgment IDs.
-     * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param values The ackIds to add. - * @return This builder for chaining. - */ - public Builder addAllAckIds(java.lang.Iterable values) { - ensureAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ackIds_); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. List of acknowledgment IDs.
-     * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearAckIds() { - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - ; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. List of acknowledgment IDs.
-     * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes of the ackIds to add. - * @return This builder for chaining. - */ - public Builder addAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAckIdsIsMutable(); - ackIds_.add(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private int ackDeadlineSeconds_; - /** - * - * - *
-     * Required. The new ack deadline with respect to the time this request was
-     * sent to the Pub/Sub system. For example, if the value is 10, the new ack
-     * deadline will expire 10 seconds after the `ModifyAckDeadline` call was
-     * made. Specifying zero might immediately make the message available for
-     * delivery to another subscriber client. This typically results in an
-     * increase in the rate of message redeliveries (that is, duplicates).
-     * The minimum deadline you can specify is 0 seconds.
-     * The maximum deadline you can specify is 600 seconds (10 minutes).
-     * 
- * - * int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The ackDeadlineSeconds. - */ - @java.lang.Override - public int getAckDeadlineSeconds() { - return ackDeadlineSeconds_; - } - /** - * - * - *
-     * Required. The new ack deadline with respect to the time this request was
-     * sent to the Pub/Sub system. For example, if the value is 10, the new ack
-     * deadline will expire 10 seconds after the `ModifyAckDeadline` call was
-     * made. Specifying zero might immediately make the message available for
-     * delivery to another subscriber client. This typically results in an
-     * increase in the rate of message redeliveries (that is, duplicates).
-     * The minimum deadline you can specify is 0 seconds.
-     * The maximum deadline you can specify is 600 seconds (10 minutes).
-     * 
- * - * int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The ackDeadlineSeconds to set. - * @return This builder for chaining. - */ - public Builder setAckDeadlineSeconds(int value) { - - ackDeadlineSeconds_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The new ack deadline with respect to the time this request was
-     * sent to the Pub/Sub system. For example, if the value is 10, the new ack
-     * deadline will expire 10 seconds after the `ModifyAckDeadline` call was
-     * made. Specifying zero might immediately make the message available for
-     * delivery to another subscriber client. This typically results in an
-     * increase in the rate of message redeliveries (that is, duplicates).
-     * The minimum deadline you can specify is 0 seconds.
-     * The maximum deadline you can specify is 600 seconds (10 minutes).
-     * 
- * - * int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearAckDeadlineSeconds() { - bitField0_ = (bitField0_ & ~0x00000004); - ackDeadlineSeconds_ = 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.ModifyAckDeadlineRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ModifyAckDeadlineRequest) - private static final com.google.pubsub.v1.ModifyAckDeadlineRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ModifyAckDeadlineRequest(); - } - - public static com.google.pubsub.v1.ModifyAckDeadlineRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ModifyAckDeadlineRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ModifyAckDeadlineRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequestOrBuilder.java deleted file mode 100644 index 8c0843c7d..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequestOrBuilder.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2023 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 ModifyAckDeadlineRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ModifyAckDeadlineRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the subscription.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - java.lang.String getSubscription(); - /** - * - * - *
-   * Required. The name of the subscription.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - com.google.protobuf.ByteString getSubscriptionBytes(); - - /** - * - * - *
-   * Required. List of acknowledgment IDs.
-   * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @return A list containing the ackIds. - */ - java.util.List getAckIdsList(); - /** - * - * - *
-   * Required. List of acknowledgment IDs.
-   * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The count of ackIds. - */ - int getAckIdsCount(); - /** - * - * - *
-   * Required. List of acknowledgment IDs.
-   * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - java.lang.String getAckIds(int index); - /** - * - * - *
-   * Required. List of acknowledgment IDs.
-   * 
- * - * repeated string ack_ids = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - com.google.protobuf.ByteString getAckIdsBytes(int index); - - /** - * - * - *
-   * Required. The new ack deadline with respect to the time this request was
-   * sent to the Pub/Sub system. For example, if the value is 10, the new ack
-   * deadline will expire 10 seconds after the `ModifyAckDeadline` call was
-   * made. Specifying zero might immediately make the message available for
-   * delivery to another subscriber client. This typically results in an
-   * increase in the rate of message redeliveries (that is, duplicates).
-   * The minimum deadline you can specify is 0 seconds.
-   * The maximum deadline you can specify is 600 seconds (10 minutes).
-   * 
- * - * int32 ack_deadline_seconds = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The ackDeadlineSeconds. - */ - int getAckDeadlineSeconds(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java deleted file mode 100644 index a1b5050ee..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java +++ /dev/null @@ -1,976 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the ModifyPushConfig method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ModifyPushConfigRequest} - */ -public final class ModifyPushConfigRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ModifyPushConfigRequest) - ModifyPushConfigRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ModifyPushConfigRequest.newBuilder() to construct. - private ModifyPushConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ModifyPushConfigRequest() { - subscription_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ModifyPushConfigRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ModifyPushConfigRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ModifyPushConfigRequest.class, - com.google.pubsub.v1.ModifyPushConfigRequest.Builder.class); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object subscription_ = ""; - /** - * - * - *
-   * Required. The name of the subscription.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - @java.lang.Override - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - 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(); - subscription_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the subscription.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PUSH_CONFIG_FIELD_NUMBER = 2; - private com.google.pubsub.v1.PushConfig pushConfig_; - /** - * - * - *
-   * Required. The push configuration for future deliveries.
-   *
-   * An empty `pushConfig` indicates that the Pub/Sub system should
-   * stop pushing messages from the given subscription and allow
-   * messages to be pulled and acknowledged - effectively pausing
-   * the subscription if `Pull` or `StreamingPull` is not called.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the pushConfig field is set. - */ - @java.lang.Override - public boolean hasPushConfig() { - return pushConfig_ != null; - } - /** - * - * - *
-   * Required. The push configuration for future deliveries.
-   *
-   * An empty `pushConfig` indicates that the Pub/Sub system should
-   * stop pushing messages from the given subscription and allow
-   * messages to be pulled and acknowledged - effectively pausing
-   * the subscription if `Pull` or `StreamingPull` is not called.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The pushConfig. - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig getPushConfig() { - return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; - } - /** - * - * - *
-   * Required. The push configuration for future deliveries.
-   *
-   * An empty `pushConfig` indicates that the Pub/Sub system should
-   * stop pushing messages from the given subscription and allow
-   * messages to be pulled and acknowledged - effectively pausing
-   * the subscription if `Pull` or `StreamingPull` is not called.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() { - return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); - } - if (pushConfig_ != null) { - output.writeMessage(2, getPushConfig()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_); - } - if (pushConfig_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPushConfig()); - } - size += getUnknownFields().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.ModifyPushConfigRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.ModifyPushConfigRequest other = - (com.google.pubsub.v1.ModifyPushConfigRequest) obj; - - if (!getSubscription().equals(other.getSubscription())) return false; - if (hasPushConfig() != other.hasPushConfig()) return false; - if (hasPushConfig()) { - if (!getPushConfig().equals(other.getPushConfig())) return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - if (hasPushConfig()) { - hash = (37 * hash) + PUSH_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getPushConfig().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ModifyPushConfigRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ModifyPushConfigRequest 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.ModifyPushConfigRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ModifyPushConfigRequest 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.ModifyPushConfigRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ModifyPushConfigRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ModifyPushConfigRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ModifyPushConfigRequest 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.ModifyPushConfigRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ModifyPushConfigRequest 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.ModifyPushConfigRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ModifyPushConfigRequest 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.ModifyPushConfigRequest 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 ModifyPushConfig method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ModifyPushConfigRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ModifyPushConfigRequest) - com.google.pubsub.v1.ModifyPushConfigRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ModifyPushConfigRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ModifyPushConfigRequest.class, - com.google.pubsub.v1.ModifyPushConfigRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.ModifyPushConfigRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscription_ = ""; - pushConfig_ = null; - if (pushConfigBuilder_ != null) { - pushConfigBuilder_.dispose(); - pushConfigBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ModifyPushConfigRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.ModifyPushConfigRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ModifyPushConfigRequest build() { - com.google.pubsub.v1.ModifyPushConfigRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ModifyPushConfigRequest buildPartial() { - com.google.pubsub.v1.ModifyPushConfigRequest result = - new com.google.pubsub.v1.ModifyPushConfigRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ModifyPushConfigRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.subscription_ = subscription_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.pushConfig_ = pushConfigBuilder_ == null ? pushConfig_ : pushConfigBuilder_.build(); - } - } - - @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.ModifyPushConfigRequest) { - return mergeFrom((com.google.pubsub.v1.ModifyPushConfigRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ModifyPushConfigRequest other) { - if (other == com.google.pubsub.v1.ModifyPushConfigRequest.getDefaultInstance()) return this; - if (!other.getSubscription().isEmpty()) { - subscription_ = other.subscription_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.hasPushConfig()) { - mergePushConfig(other.getPushConfig()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - subscription_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getPushConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object subscription_ = ""; - /** - * - * - *
-     * Required. The name of the subscription.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the subscription.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the subscription.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the subscription.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSubscription() { - subscription_ = getDefaultInstance().getSubscription(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the subscription.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.pubsub.v1.PushConfig pushConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig, - com.google.pubsub.v1.PushConfig.Builder, - com.google.pubsub.v1.PushConfigOrBuilder> - pushConfigBuilder_; - /** - * - * - *
-     * Required. The push configuration for future deliveries.
-     *
-     * An empty `pushConfig` indicates that the Pub/Sub system should
-     * stop pushing messages from the given subscription and allow
-     * messages to be pulled and acknowledged - effectively pausing
-     * the subscription if `Pull` or `StreamingPull` is not called.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the pushConfig field is set. - */ - public boolean hasPushConfig() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * Required. The push configuration for future deliveries.
-     *
-     * An empty `pushConfig` indicates that the Pub/Sub system should
-     * stop pushing messages from the given subscription and allow
-     * messages to be pulled and acknowledged - effectively pausing
-     * the subscription if `Pull` or `StreamingPull` is not called.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The pushConfig. - */ - public com.google.pubsub.v1.PushConfig getPushConfig() { - if (pushConfigBuilder_ == null) { - return pushConfig_ == null - ? com.google.pubsub.v1.PushConfig.getDefaultInstance() - : pushConfig_; - } else { - return pushConfigBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The push configuration for future deliveries.
-     *
-     * An empty `pushConfig` indicates that the Pub/Sub system should
-     * stop pushing messages from the given subscription and allow
-     * messages to be pulled and acknowledged - effectively pausing
-     * the subscription if `Pull` or `StreamingPull` is not called.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setPushConfig(com.google.pubsub.v1.PushConfig value) { - if (pushConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - pushConfig_ = value; - } else { - pushConfigBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The push configuration for future deliveries.
-     *
-     * An empty `pushConfig` indicates that the Pub/Sub system should
-     * stop pushing messages from the given subscription and allow
-     * messages to be pulled and acknowledged - effectively pausing
-     * the subscription if `Pull` or `StreamingPull` is not called.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setPushConfig(com.google.pubsub.v1.PushConfig.Builder builderForValue) { - if (pushConfigBuilder_ == null) { - pushConfig_ = builderForValue.build(); - } else { - pushConfigBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The push configuration for future deliveries.
-     *
-     * An empty `pushConfig` indicates that the Pub/Sub system should
-     * stop pushing messages from the given subscription and allow
-     * messages to be pulled and acknowledged - effectively pausing
-     * the subscription if `Pull` or `StreamingPull` is not called.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergePushConfig(com.google.pubsub.v1.PushConfig value) { - if (pushConfigBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) - && pushConfig_ != null - && pushConfig_ != com.google.pubsub.v1.PushConfig.getDefaultInstance()) { - getPushConfigBuilder().mergeFrom(value); - } else { - pushConfig_ = value; - } - } else { - pushConfigBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The push configuration for future deliveries.
-     *
-     * An empty `pushConfig` indicates that the Pub/Sub system should
-     * stop pushing messages from the given subscription and allow
-     * messages to be pulled and acknowledged - effectively pausing
-     * the subscription if `Pull` or `StreamingPull` is not called.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearPushConfig() { - bitField0_ = (bitField0_ & ~0x00000002); - pushConfig_ = null; - if (pushConfigBuilder_ != null) { - pushConfigBuilder_.dispose(); - pushConfigBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The push configuration for future deliveries.
-     *
-     * An empty `pushConfig` indicates that the Pub/Sub system should
-     * stop pushing messages from the given subscription and allow
-     * messages to be pulled and acknowledged - effectively pausing
-     * the subscription if `Pull` or `StreamingPull` is not called.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.PushConfig.Builder getPushConfigBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getPushConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The push configuration for future deliveries.
-     *
-     * An empty `pushConfig` indicates that the Pub/Sub system should
-     * stop pushing messages from the given subscription and allow
-     * messages to be pulled and acknowledged - effectively pausing
-     * the subscription if `Pull` or `StreamingPull` is not called.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() { - if (pushConfigBuilder_ != null) { - return pushConfigBuilder_.getMessageOrBuilder(); - } else { - return pushConfig_ == null - ? com.google.pubsub.v1.PushConfig.getDefaultInstance() - : pushConfig_; - } - } - /** - * - * - *
-     * Required. The push configuration for future deliveries.
-     *
-     * An empty `pushConfig` indicates that the Pub/Sub system should
-     * stop pushing messages from the given subscription and allow
-     * messages to be pulled and acknowledged - effectively pausing
-     * the subscription if `Pull` or `StreamingPull` is not called.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig, - com.google.pubsub.v1.PushConfig.Builder, - com.google.pubsub.v1.PushConfigOrBuilder> - getPushConfigFieldBuilder() { - if (pushConfigBuilder_ == null) { - pushConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig, - com.google.pubsub.v1.PushConfig.Builder, - com.google.pubsub.v1.PushConfigOrBuilder>( - getPushConfig(), getParentForChildren(), isClean()); - pushConfig_ = null; - } - return pushConfigBuilder_; - } - - @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.ModifyPushConfigRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ModifyPushConfigRequest) - private static final com.google.pubsub.v1.ModifyPushConfigRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ModifyPushConfigRequest(); - } - - public static com.google.pubsub.v1.ModifyPushConfigRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ModifyPushConfigRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ModifyPushConfigRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequestOrBuilder.java deleted file mode 100644 index 96d5ca4c1..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequestOrBuilder.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2023 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 ModifyPushConfigRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ModifyPushConfigRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the subscription.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - java.lang.String getSubscription(); - /** - * - * - *
-   * Required. The name of the subscription.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - com.google.protobuf.ByteString getSubscriptionBytes(); - - /** - * - * - *
-   * Required. The push configuration for future deliveries.
-   *
-   * An empty `pushConfig` indicates that the Pub/Sub system should
-   * stop pushing messages from the given subscription and allow
-   * messages to be pulled and acknowledged - effectively pausing
-   * the subscription if `Pull` or `StreamingPull` is not called.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the pushConfig field is set. - */ - boolean hasPushConfig(); - /** - * - * - *
-   * Required. The push configuration for future deliveries.
-   *
-   * An empty `pushConfig` indicates that the Pub/Sub system should
-   * stop pushing messages from the given subscription and allow
-   * messages to be pulled and acknowledged - effectively pausing
-   * the subscription if `Pull` or `StreamingPull` is not called.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The pushConfig. - */ - com.google.pubsub.v1.PushConfig getPushConfig(); - /** - * - * - *
-   * Required. The push configuration for future deliveries.
-   *
-   * An empty `pushConfig` indicates that the Pub/Sub system should
-   * stop pushing messages from the given subscription and allow
-   * messages to be pulled and acknowledged - effectively pausing
-   * the subscription if `Pull` or `StreamingPull` is not called.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectName.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectName.java deleted file mode 100644 index d04475ab0..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2023 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; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class ProjectName implements ResourceName { - private static final PathTemplate PROJECT = - PathTemplate.createWithoutUrlEncoding("projects/{project}"); - private volatile Map fieldValuesMap; - private final String project; - - @Deprecated - protected ProjectName() { - project = null; - } - - private ProjectName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - } - - public String getProject() { - return project; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static ProjectName of(String project) { - return newBuilder().setProject(project).build(); - } - - public static String format(String project) { - return newBuilder().setProject(project).build().toString(); - } - - public static ProjectName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT.validatedMatch( - formattedString, "ProjectName.parse: formattedString not in valid format"); - return of(matchMap.get("project")); - } - - 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 (ProjectName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT.instantiate("project", project); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null && getClass() == o.getClass()) { - ProjectName that = ((ProjectName) o); - return Objects.equals(this.project, that.project); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - return h; - } - - /** Builder for projects/{project}. */ - public static class Builder { - private String project; - - protected Builder() {} - - public String getProject() { - return project; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder(ProjectName projectName) { - this.project = projectName.project; - } - - public ProjectName build() { - return new ProjectName(this); - } - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishRequest.java deleted file mode 100644 index 2268fc162..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishRequest.java +++ /dev/null @@ -1,1178 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the Publish method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.PublishRequest} - */ -public final class PublishRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.PublishRequest) - PublishRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use PublishRequest.newBuilder() to construct. - private PublishRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PublishRequest() { - topic_ = ""; - messages_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PublishRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PublishRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PublishRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PublishRequest.class, - com.google.pubsub.v1.PublishRequest.Builder.class); - } - - public static final int TOPIC_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object topic_ = ""; - /** - * - * - *
-   * Required. The messages in the request will be published on this topic.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - @java.lang.Override - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - 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(); - topic_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The messages in the request will be published on this topic.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MESSAGES_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private java.util.List messages_; - /** - * - * - *
-   * Required. The messages to publish.
-   * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public java.util.List getMessagesList() { - return messages_; - } - /** - * - * - *
-   * Required. The messages to publish.
-   * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public java.util.List - getMessagesOrBuilderList() { - return messages_; - } - /** - * - * - *
-   * Required. The messages to publish.
-   * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public int getMessagesCount() { - return messages_.size(); - } - /** - * - * - *
-   * Required. The messages to publish.
-   * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.pubsub.v1.PubsubMessage getMessages(int index) { - return messages_.get(index); - } - /** - * - * - *
-   * Required. The messages to publish.
-   * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.pubsub.v1.PubsubMessageOrBuilder getMessagesOrBuilder(int index) { - return messages_.get(index); - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_); - } - for (int i = 0; i < messages_.size(); i++) { - output.writeMessage(2, messages_.get(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_); - } - for (int i = 0; i < messages_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, messages_.get(i)); - } - size += getUnknownFields().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.PublishRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.PublishRequest other = (com.google.pubsub.v1.PublishRequest) obj; - - if (!getTopic().equals(other.getTopic())) return false; - if (!getMessagesList().equals(other.getMessagesList())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getTopic().hashCode(); - if (getMessagesCount() > 0) { - hash = (37 * hash) + MESSAGES_FIELD_NUMBER; - hash = (53 * hash) + getMessagesList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.PublishRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PublishRequest 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.PublishRequest parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PublishRequest 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.PublishRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PublishRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.PublishRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PublishRequest 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.PublishRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PublishRequest 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.PublishRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PublishRequest 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.PublishRequest 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 Publish method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.PublishRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PublishRequest) - com.google.pubsub.v1.PublishRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PublishRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PublishRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PublishRequest.class, - com.google.pubsub.v1.PublishRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.PublishRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - topic_ = ""; - if (messagesBuilder_ == null) { - messages_ = java.util.Collections.emptyList(); - } else { - messages_ = null; - messagesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PublishRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.PublishRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.PublishRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.PublishRequest build() { - com.google.pubsub.v1.PublishRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.PublishRequest buildPartial() { - com.google.pubsub.v1.PublishRequest result = new com.google.pubsub.v1.PublishRequest(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(com.google.pubsub.v1.PublishRequest result) { - if (messagesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - messages_ = java.util.Collections.unmodifiableList(messages_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.messages_ = messages_; - } else { - result.messages_ = messagesBuilder_.build(); - } - } - - private void buildPartial0(com.google.pubsub.v1.PublishRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.topic_ = topic_; - } - } - - @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.PublishRequest) { - return mergeFrom((com.google.pubsub.v1.PublishRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.PublishRequest other) { - if (other == com.google.pubsub.v1.PublishRequest.getDefaultInstance()) return this; - if (!other.getTopic().isEmpty()) { - topic_ = other.topic_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (messagesBuilder_ == null) { - if (!other.messages_.isEmpty()) { - if (messages_.isEmpty()) { - messages_ = other.messages_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureMessagesIsMutable(); - messages_.addAll(other.messages_); - } - onChanged(); - } - } else { - if (!other.messages_.isEmpty()) { - if (messagesBuilder_.isEmpty()) { - messagesBuilder_.dispose(); - messagesBuilder_ = null; - messages_ = other.messages_; - bitField0_ = (bitField0_ & ~0x00000002); - messagesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getMessagesFieldBuilder() - : null; - } else { - messagesBuilder_.addAllMessages(other.messages_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - topic_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - com.google.pubsub.v1.PubsubMessage m = - input.readMessage( - com.google.pubsub.v1.PubsubMessage.parser(), extensionRegistry); - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - messages_.add(m); - } else { - messagesBuilder_.addMessage(m); - } - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object topic_ = ""; - /** - * - * - *
-     * Required. The messages in the request will be published on this topic.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - topic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The messages in the request will be published on this topic.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The messages in the request will be published on this topic.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The topic to set. - * @return This builder for chaining. - */ - public Builder setTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - topic_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The messages in the request will be published on this topic.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearTopic() { - topic_ = getDefaultInstance().getTopic(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The messages in the request will be published on this topic.
-     * Format is `projects/{project}/topics/{topic}`.
-     * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for topic to set. - * @return This builder for chaining. - */ - public Builder setTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - topic_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.util.List messages_ = - java.util.Collections.emptyList(); - - private void ensureMessagesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - messages_ = new java.util.ArrayList(messages_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.PubsubMessage, - com.google.pubsub.v1.PubsubMessage.Builder, - com.google.pubsub.v1.PubsubMessageOrBuilder> - messagesBuilder_; - - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public java.util.List getMessagesList() { - if (messagesBuilder_ == null) { - return java.util.Collections.unmodifiableList(messages_); - } else { - return messagesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public int getMessagesCount() { - if (messagesBuilder_ == null) { - return messages_.size(); - } else { - return messagesBuilder_.getCount(); - } - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.PubsubMessage getMessages(int index) { - if (messagesBuilder_ == null) { - return messages_.get(index); - } else { - return messagesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setMessages(int index, com.google.pubsub.v1.PubsubMessage value) { - if (messagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessagesIsMutable(); - messages_.set(index, value); - onChanged(); - } else { - messagesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setMessages( - int index, com.google.pubsub.v1.PubsubMessage.Builder builderForValue) { - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - messages_.set(index, builderForValue.build()); - onChanged(); - } else { - messagesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder addMessages(com.google.pubsub.v1.PubsubMessage value) { - if (messagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessagesIsMutable(); - messages_.add(value); - onChanged(); - } else { - messagesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder addMessages(int index, com.google.pubsub.v1.PubsubMessage value) { - if (messagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessagesIsMutable(); - messages_.add(index, value); - onChanged(); - } else { - messagesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder addMessages(com.google.pubsub.v1.PubsubMessage.Builder builderForValue) { - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - messages_.add(builderForValue.build()); - onChanged(); - } else { - messagesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder addMessages( - int index, com.google.pubsub.v1.PubsubMessage.Builder builderForValue) { - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - messages_.add(index, builderForValue.build()); - onChanged(); - } else { - messagesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder addAllMessages( - java.lang.Iterable values) { - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); - onChanged(); - } else { - messagesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearMessages() { - if (messagesBuilder_ == null) { - messages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - messagesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder removeMessages(int index) { - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - messages_.remove(index); - onChanged(); - } else { - messagesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.PubsubMessage.Builder getMessagesBuilder(int index) { - return getMessagesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.PubsubMessageOrBuilder getMessagesOrBuilder(int index) { - if (messagesBuilder_ == null) { - return messages_.get(index); - } else { - return messagesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public java.util.List - getMessagesOrBuilderList() { - if (messagesBuilder_ != null) { - return messagesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(messages_); - } - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.PubsubMessage.Builder addMessagesBuilder() { - return getMessagesFieldBuilder() - .addBuilder(com.google.pubsub.v1.PubsubMessage.getDefaultInstance()); - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.PubsubMessage.Builder addMessagesBuilder(int index) { - return getMessagesFieldBuilder() - .addBuilder(index, com.google.pubsub.v1.PubsubMessage.getDefaultInstance()); - } - /** - * - * - *
-     * Required. The messages to publish.
-     * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public java.util.List getMessagesBuilderList() { - return getMessagesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.PubsubMessage, - com.google.pubsub.v1.PubsubMessage.Builder, - com.google.pubsub.v1.PubsubMessageOrBuilder> - getMessagesFieldBuilder() { - if (messagesBuilder_ == null) { - messagesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.PubsubMessage, - com.google.pubsub.v1.PubsubMessage.Builder, - com.google.pubsub.v1.PubsubMessageOrBuilder>( - messages_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); - messages_ = null; - } - return messagesBuilder_; - } - - @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.PublishRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.PublishRequest) - private static final com.google.pubsub.v1.PublishRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.PublishRequest(); - } - - public static com.google.pubsub.v1.PublishRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PublishRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.PublishRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishRequestOrBuilder.java deleted file mode 100644 index a0b5cde08..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishRequestOrBuilder.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2023 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 PublishRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PublishRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The messages in the request will be published on this topic.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - java.lang.String getTopic(); - /** - * - * - *
-   * Required. The messages in the request will be published on this topic.
-   * Format is `projects/{project}/topics/{topic}`.
-   * 
- * - * - * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - com.google.protobuf.ByteString getTopicBytes(); - - /** - * - * - *
-   * Required. The messages to publish.
-   * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - java.util.List getMessagesList(); - /** - * - * - *
-   * Required. The messages to publish.
-   * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.pubsub.v1.PubsubMessage getMessages(int index); - /** - * - * - *
-   * Required. The messages to publish.
-   * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - int getMessagesCount(); - /** - * - * - *
-   * Required. The messages to publish.
-   * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - java.util.List getMessagesOrBuilderList(); - /** - * - * - *
-   * Required. The messages to publish.
-   * 
- * - * - * repeated .google.pubsub.v1.PubsubMessage messages = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.pubsub.v1.PubsubMessageOrBuilder getMessagesOrBuilder(int index); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishResponse.java deleted file mode 100644 index 0a0905e94..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishResponse.java +++ /dev/null @@ -1,741 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Response for the `Publish` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.PublishResponse} - */ -public final class PublishResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.PublishResponse) - PublishResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use PublishResponse.newBuilder() to construct. - private PublishResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PublishResponse() { - messageIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PublishResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PublishResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PublishResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PublishResponse.class, - com.google.pubsub.v1.PublishResponse.Builder.class); - } - - public static final int MESSAGE_IDS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList messageIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-   * The server-assigned ID of each published message, in the same order as
-   * the messages in the request. IDs are guaranteed to be unique within
-   * the topic.
-   * 
- * - * repeated string message_ids = 1; - * - * @return A list containing the messageIds. - */ - public com.google.protobuf.ProtocolStringList getMessageIdsList() { - return messageIds_; - } - /** - * - * - *
-   * The server-assigned ID of each published message, in the same order as
-   * the messages in the request. IDs are guaranteed to be unique within
-   * the topic.
-   * 
- * - * repeated string message_ids = 1; - * - * @return The count of messageIds. - */ - public int getMessageIdsCount() { - return messageIds_.size(); - } - /** - * - * - *
-   * The server-assigned ID of each published message, in the same order as
-   * the messages in the request. IDs are guaranteed to be unique within
-   * the topic.
-   * 
- * - * repeated string message_ids = 1; - * - * @param index The index of the element to return. - * @return The messageIds at the given index. - */ - public java.lang.String getMessageIds(int index) { - return messageIds_.get(index); - } - /** - * - * - *
-   * The server-assigned ID of each published message, in the same order as
-   * the messages in the request. IDs are guaranteed to be unique within
-   * the topic.
-   * 
- * - * repeated string message_ids = 1; - * - * @param index The index of the value to return. - * @return The bytes of the messageIds at the given index. - */ - public com.google.protobuf.ByteString getMessageIdsBytes(int index) { - return messageIds_.getByteString(index); - } - - 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 < messageIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, messageIds_.getRaw(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < messageIds_.size(); i++) { - dataSize += computeStringSizeNoTag(messageIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getMessageIdsList().size(); - } - size += getUnknownFields().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.PublishResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.PublishResponse other = (com.google.pubsub.v1.PublishResponse) obj; - - if (!getMessageIdsList().equals(other.getMessageIdsList())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getMessageIdsCount() > 0) { - hash = (37 * hash) + MESSAGE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getMessageIdsList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.PublishResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PublishResponse 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.PublishResponse parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PublishResponse 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.PublishResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PublishResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.PublishResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PublishResponse 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.PublishResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PublishResponse 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.PublishResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PublishResponse 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.PublishResponse 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 `Publish` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.PublishResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PublishResponse) - com.google.pubsub.v1.PublishResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PublishResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PublishResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PublishResponse.class, - com.google.pubsub.v1.PublishResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.PublishResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - messageIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PublishResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.PublishResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.PublishResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.PublishResponse build() { - com.google.pubsub.v1.PublishResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.PublishResponse buildPartial() { - com.google.pubsub.v1.PublishResponse result = new com.google.pubsub.v1.PublishResponse(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.PublishResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - messageIds_.makeImmutable(); - result.messageIds_ = messageIds_; - } - } - - @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.PublishResponse) { - return mergeFrom((com.google.pubsub.v1.PublishResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.PublishResponse other) { - if (other == com.google.pubsub.v1.PublishResponse.getDefaultInstance()) return this; - if (!other.messageIds_.isEmpty()) { - if (messageIds_.isEmpty()) { - messageIds_ = other.messageIds_; - bitField0_ |= 0x00000001; - } else { - ensureMessageIdsIsMutable(); - messageIds_.addAll(other.messageIds_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - 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(); - ensureMessageIdsIsMutable(); - messageIds_.add(s); - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringArrayList messageIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureMessageIdsIsMutable() { - if (!messageIds_.isModifiable()) { - messageIds_ = new com.google.protobuf.LazyStringArrayList(messageIds_); - } - bitField0_ |= 0x00000001; - } - /** - * - * - *
-     * The server-assigned ID of each published message, in the same order as
-     * the messages in the request. IDs are guaranteed to be unique within
-     * the topic.
-     * 
- * - * repeated string message_ids = 1; - * - * @return A list containing the messageIds. - */ - public com.google.protobuf.ProtocolStringList getMessageIdsList() { - messageIds_.makeImmutable(); - return messageIds_; - } - /** - * - * - *
-     * The server-assigned ID of each published message, in the same order as
-     * the messages in the request. IDs are guaranteed to be unique within
-     * the topic.
-     * 
- * - * repeated string message_ids = 1; - * - * @return The count of messageIds. - */ - public int getMessageIdsCount() { - return messageIds_.size(); - } - /** - * - * - *
-     * The server-assigned ID of each published message, in the same order as
-     * the messages in the request. IDs are guaranteed to be unique within
-     * the topic.
-     * 
- * - * repeated string message_ids = 1; - * - * @param index The index of the element to return. - * @return The messageIds at the given index. - */ - public java.lang.String getMessageIds(int index) { - return messageIds_.get(index); - } - /** - * - * - *
-     * The server-assigned ID of each published message, in the same order as
-     * the messages in the request. IDs are guaranteed to be unique within
-     * the topic.
-     * 
- * - * repeated string message_ids = 1; - * - * @param index The index of the value to return. - * @return The bytes of the messageIds at the given index. - */ - public com.google.protobuf.ByteString getMessageIdsBytes(int index) { - return messageIds_.getByteString(index); - } - /** - * - * - *
-     * The server-assigned ID of each published message, in the same order as
-     * the messages in the request. IDs are guaranteed to be unique within
-     * the topic.
-     * 
- * - * repeated string message_ids = 1; - * - * @param index The index to set the value at. - * @param value The messageIds to set. - * @return This builder for chaining. - */ - public Builder setMessageIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessageIdsIsMutable(); - messageIds_.set(index, value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The server-assigned ID of each published message, in the same order as
-     * the messages in the request. IDs are guaranteed to be unique within
-     * the topic.
-     * 
- * - * repeated string message_ids = 1; - * - * @param value The messageIds to add. - * @return This builder for chaining. - */ - public Builder addMessageIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessageIdsIsMutable(); - messageIds_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The server-assigned ID of each published message, in the same order as
-     * the messages in the request. IDs are guaranteed to be unique within
-     * the topic.
-     * 
- * - * repeated string message_ids = 1; - * - * @param values The messageIds to add. - * @return This builder for chaining. - */ - public Builder addAllMessageIds(java.lang.Iterable values) { - ensureMessageIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messageIds_); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The server-assigned ID of each published message, in the same order as
-     * the messages in the request. IDs are guaranteed to be unique within
-     * the topic.
-     * 
- * - * repeated string message_ids = 1; - * - * @return This builder for chaining. - */ - public Builder clearMessageIds() { - messageIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - ; - onChanged(); - return this; - } - /** - * - * - *
-     * The server-assigned ID of each published message, in the same order as
-     * the messages in the request. IDs are guaranteed to be unique within
-     * the topic.
-     * 
- * - * repeated string message_ids = 1; - * - * @param value The bytes of the messageIds to add. - * @return This builder for chaining. - */ - public Builder addMessageIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureMessageIdsIsMutable(); - messageIds_.add(value); - bitField0_ |= 0x00000001; - 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.PublishResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.PublishResponse) - private static final com.google.pubsub.v1.PublishResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.PublishResponse(); - } - - public static com.google.pubsub.v1.PublishResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PublishResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.PublishResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishResponseOrBuilder.java deleted file mode 100644 index 7d6f78725..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishResponseOrBuilder.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2023 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 PublishResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PublishResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The server-assigned ID of each published message, in the same order as
-   * the messages in the request. IDs are guaranteed to be unique within
-   * the topic.
-   * 
- * - * repeated string message_ids = 1; - * - * @return A list containing the messageIds. - */ - java.util.List getMessageIdsList(); - /** - * - * - *
-   * The server-assigned ID of each published message, in the same order as
-   * the messages in the request. IDs are guaranteed to be unique within
-   * the topic.
-   * 
- * - * repeated string message_ids = 1; - * - * @return The count of messageIds. - */ - int getMessageIdsCount(); - /** - * - * - *
-   * The server-assigned ID of each published message, in the same order as
-   * the messages in the request. IDs are guaranteed to be unique within
-   * the topic.
-   * 
- * - * repeated string message_ids = 1; - * - * @param index The index of the element to return. - * @return The messageIds at the given index. - */ - java.lang.String getMessageIds(int index); - /** - * - * - *
-   * The server-assigned ID of each published message, in the same order as
-   * the messages in the request. IDs are guaranteed to be unique within
-   * the topic.
-   * 
- * - * repeated string message_ids = 1; - * - * @param index The index of the value to return. - * @return The bytes of the messageIds at the given index. - */ - com.google.protobuf.ByteString getMessageIdsBytes(int index); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubMessage.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubMessage.java deleted file mode 100644 index cab47a3c0..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubMessage.java +++ /dev/null @@ -1,1628 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * A message that is published by publishers and consumed by subscribers. The
- * message must contain either a non-empty data field or at least one attribute.
- * Note that client libraries represent this object differently
- * depending on the language. See the corresponding [client library
- * documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for
- * more information. See [quotas and limits]
- * (https://cloud.google.com/pubsub/quotas) for more information about message
- * limits.
- * 
- * - * Protobuf type {@code google.pubsub.v1.PubsubMessage} - */ -public final class PubsubMessage extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.PubsubMessage) - PubsubMessageOrBuilder { - private static final long serialVersionUID = 0L; - // Use PubsubMessage.newBuilder() to construct. - private PubsubMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PubsubMessage() { - data_ = com.google.protobuf.ByteString.EMPTY; - messageId_ = ""; - orderingKey_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PubsubMessage(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PubsubMessage_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PubsubMessage.class, - com.google.pubsub.v1.PubsubMessage.Builder.class); - } - - public static final int DATA_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-   * The message data field. If this field is empty, the message must contain
-   * at least one attribute.
-   * 
- * - * bytes data = 1; - * - * @return The data. - */ - @java.lang.Override - public com.google.protobuf.ByteString getData() { - return data_; - } - - public static final int ATTRIBUTES_FIELD_NUMBER = 2; - - private static final class AttributesDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - @SuppressWarnings("serial") - private com.google.protobuf.MapField attributes_; - - private com.google.protobuf.MapField internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); - } - /** - * - * - *
-   * Attributes for this message. If this field is empty, the message must
-   * contain non-empty data. This can be used to filter messages on the
-   * subscription.
-   * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public boolean containsAttributes(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetAttributes().getMap().containsKey(key); - } - /** Use {@link #getAttributesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getAttributes() { - return getAttributesMap(); - } - /** - * - * - *
-   * Attributes for this message. If this field is empty, the message must
-   * contain non-empty data. This can be used to filter messages on the
-   * subscription.
-   * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public java.util.Map getAttributesMap() { - return internalGetAttributes().getMap(); - } - /** - * - * - *
-   * Attributes for this message. If this field is empty, the message must
-   * contain non-empty data. This can be used to filter messages on the
-   * subscription.
-   * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public /* nullable */ java.lang.String getAttributesOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * Attributes for this message. If this field is empty, the message must
-   * contain non-empty data. This can be used to filter messages on the
-   * subscription.
-   * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public java.lang.String getAttributesOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int MESSAGE_ID_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object messageId_ = ""; - /** - * - * - *
-   * ID of this message, assigned by the server when the message is published.
-   * Guaranteed to be unique within the topic. This value may be read by a
-   * subscriber that receives a `PubsubMessage` via a `Pull` call or a push
-   * delivery. It must not be populated by the publisher in a `Publish` call.
-   * 
- * - * string message_id = 3; - * - * @return The messageId. - */ - @java.lang.Override - public java.lang.String getMessageId() { - java.lang.Object ref = messageId_; - 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(); - messageId_ = s; - return s; - } - } - /** - * - * - *
-   * ID of this message, assigned by the server when the message is published.
-   * Guaranteed to be unique within the topic. This value may be read by a
-   * subscriber that receives a `PubsubMessage` via a `Pull` call or a push
-   * delivery. It must not be populated by the publisher in a `Publish` call.
-   * 
- * - * string message_id = 3; - * - * @return The bytes for messageId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getMessageIdBytes() { - java.lang.Object ref = messageId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - messageId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PUBLISH_TIME_FIELD_NUMBER = 4; - private com.google.protobuf.Timestamp publishTime_; - /** - * - * - *
-   * The time at which the message was published, populated by the server when
-   * it receives the `Publish` call. It must not be populated by the
-   * publisher in a `Publish` call.
-   * 
- * - * .google.protobuf.Timestamp publish_time = 4; - * - * @return Whether the publishTime field is set. - */ - @java.lang.Override - public boolean hasPublishTime() { - return publishTime_ != null; - } - /** - * - * - *
-   * The time at which the message was published, populated by the server when
-   * it receives the `Publish` call. It must not be populated by the
-   * publisher in a `Publish` call.
-   * 
- * - * .google.protobuf.Timestamp publish_time = 4; - * - * @return The publishTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getPublishTime() { - return publishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : publishTime_; - } - /** - * - * - *
-   * The time at which the message was published, populated by the server when
-   * it receives the `Publish` call. It must not be populated by the
-   * publisher in a `Publish` call.
-   * 
- * - * .google.protobuf.Timestamp publish_time = 4; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder() { - return publishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : publishTime_; - } - - public static final int ORDERING_KEY_FIELD_NUMBER = 5; - - @SuppressWarnings("serial") - private volatile java.lang.Object orderingKey_ = ""; - /** - * - * - *
-   * If non-empty, identifies related messages for which publish order should be
-   * respected. If a `Subscription` has `enable_message_ordering` set to `true`,
-   * messages published with the same non-empty `ordering_key` value will be
-   * delivered to subscribers in the order in which they are received by the
-   * Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
-   * must specify the same `ordering_key` value.
-   * For more information, see [ordering
-   * messages](https://cloud.google.com/pubsub/docs/ordering).
-   * 
- * - * string ordering_key = 5; - * - * @return The orderingKey. - */ - @java.lang.Override - public java.lang.String getOrderingKey() { - java.lang.Object ref = orderingKey_; - 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(); - orderingKey_ = s; - return s; - } - } - /** - * - * - *
-   * If non-empty, identifies related messages for which publish order should be
-   * respected. If a `Subscription` has `enable_message_ordering` set to `true`,
-   * messages published with the same non-empty `ordering_key` value will be
-   * delivered to subscribers in the order in which they are received by the
-   * Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
-   * must specify the same `ordering_key` value.
-   * For more information, see [ordering
-   * messages](https://cloud.google.com/pubsub/docs/ordering).
-   * 
- * - * string ordering_key = 5; - * - * @return The bytes for orderingKey. - */ - @java.lang.Override - public com.google.protobuf.ByteString getOrderingKeyBytes() { - java.lang.Object ref = orderingKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - orderingKey_ = 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 (!data_.isEmpty()) { - output.writeBytes(1, data_); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 2); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(messageId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, messageId_); - } - if (publishTime_ != null) { - output.writeMessage(4, getPublishTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderingKey_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderingKey_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!data_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, data_); - } - for (java.util.Map.Entry entry : - internalGetAttributes().getMap().entrySet()) { - com.google.protobuf.MapEntry attributes__ = - AttributesDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attributes__); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(messageId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, messageId_); - } - if (publishTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPublishTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderingKey_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderingKey_); - } - size += getUnknownFields().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.PubsubMessage)) { - return super.equals(obj); - } - com.google.pubsub.v1.PubsubMessage other = (com.google.pubsub.v1.PubsubMessage) obj; - - if (!getData().equals(other.getData())) return false; - if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; - if (!getMessageId().equals(other.getMessageId())) return false; - if (hasPublishTime() != other.hasPublishTime()) return false; - if (hasPublishTime()) { - if (!getPublishTime().equals(other.getPublishTime())) return false; - } - if (!getOrderingKey().equals(other.getOrderingKey())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DATA_FIELD_NUMBER; - hash = (53 * hash) + getData().hashCode(); - if (!internalGetAttributes().getMap().isEmpty()) { - hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttributes().hashCode(); - } - hash = (37 * hash) + MESSAGE_ID_FIELD_NUMBER; - hash = (53 * hash) + getMessageId().hashCode(); - if (hasPublishTime()) { - hash = (37 * hash) + PUBLISH_TIME_FIELD_NUMBER; - hash = (53 * hash) + getPublishTime().hashCode(); - } - hash = (37 * hash) + ORDERING_KEY_FIELD_NUMBER; - hash = (53 * hash) + getOrderingKey().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.PubsubMessage parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PubsubMessage 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.PubsubMessage parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PubsubMessage 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.PubsubMessage parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PubsubMessage parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.PubsubMessage parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PubsubMessage 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.PubsubMessage parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PubsubMessage 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.PubsubMessage parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PubsubMessage 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.PubsubMessage 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 message that is published by publishers and consumed by subscribers. The
-   * message must contain either a non-empty data field or at least one attribute.
-   * Note that client libraries represent this object differently
-   * depending on the language. See the corresponding [client library
-   * documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for
-   * more information. See [quotas and limits]
-   * (https://cloud.google.com/pubsub/quotas) for more information about message
-   * limits.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.PubsubMessage} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PubsubMessage) - com.google.pubsub.v1.PubsubMessageOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PubsubMessage_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 2: - return internalGetMutableAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PubsubMessage.class, - com.google.pubsub.v1.PubsubMessage.Builder.class); - } - - // Construct using com.google.pubsub.v1.PubsubMessage.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - data_ = com.google.protobuf.ByteString.EMPTY; - internalGetMutableAttributes().clear(); - messageId_ = ""; - publishTime_ = null; - if (publishTimeBuilder_ != null) { - publishTimeBuilder_.dispose(); - publishTimeBuilder_ = null; - } - orderingKey_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PubsubMessage_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.PubsubMessage getDefaultInstanceForType() { - return com.google.pubsub.v1.PubsubMessage.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.PubsubMessage build() { - com.google.pubsub.v1.PubsubMessage result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.PubsubMessage buildPartial() { - com.google.pubsub.v1.PubsubMessage result = new com.google.pubsub.v1.PubsubMessage(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.PubsubMessage result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.data_ = data_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.attributes_ = internalGetAttributes(); - result.attributes_.makeImmutable(); - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.messageId_ = messageId_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.publishTime_ = - publishTimeBuilder_ == null ? publishTime_ : publishTimeBuilder_.build(); - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.orderingKey_ = orderingKey_; - } - } - - @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.PubsubMessage) { - return mergeFrom((com.google.pubsub.v1.PubsubMessage) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.PubsubMessage other) { - if (other == com.google.pubsub.v1.PubsubMessage.getDefaultInstance()) return this; - if (other.getData() != com.google.protobuf.ByteString.EMPTY) { - setData(other.getData()); - } - internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); - bitField0_ |= 0x00000002; - if (!other.getMessageId().isEmpty()) { - messageId_ = other.messageId_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (other.hasPublishTime()) { - mergePublishTime(other.getPublishTime()); - } - if (!other.getOrderingKey().isEmpty()) { - orderingKey_ = other.orderingKey_; - bitField0_ |= 0x00000010; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - data_ = input.readBytes(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - com.google.protobuf.MapEntry attributes__ = - input.readMessage( - AttributesDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableAttributes() - .getMutableMap() - .put(attributes__.getKey(), attributes__.getValue()); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - messageId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 34: - { - input.readMessage(getPublishTimeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000008; - break; - } // case 34 - case 42: - { - orderingKey_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000010; - break; - } // case 42 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; - /** - * - * - *
-     * The message data field. If this field is empty, the message must contain
-     * at least one attribute.
-     * 
- * - * bytes data = 1; - * - * @return The data. - */ - @java.lang.Override - public com.google.protobuf.ByteString getData() { - return data_; - } - /** - * - * - *
-     * The message data field. If this field is empty, the message must contain
-     * at least one attribute.
-     * 
- * - * bytes data = 1; - * - * @param value The data to set. - * @return This builder for chaining. - */ - public Builder setData(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - data_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The message data field. If this field is empty, the message must contain
-     * at least one attribute.
-     * 
- * - * bytes data = 1; - * - * @return This builder for chaining. - */ - public Builder clearData() { - bitField0_ = (bitField0_ & ~0x00000001); - data_ = getDefaultInstance().getData(); - onChanged(); - return this; - } - - private com.google.protobuf.MapField attributes_; - - private com.google.protobuf.MapField - internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } - - private com.google.protobuf.MapField - internalGetMutableAttributes() { - if (attributes_ == null) { - attributes_ = - com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); - } - if (!attributes_.isMutable()) { - attributes_ = attributes_.copy(); - } - bitField0_ |= 0x00000002; - onChanged(); - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); - } - /** - * - * - *
-     * Attributes for this message. If this field is empty, the message must
-     * contain non-empty data. This can be used to filter messages on the
-     * subscription.
-     * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public boolean containsAttributes(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetAttributes().getMap().containsKey(key); - } - /** Use {@link #getAttributesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getAttributes() { - return getAttributesMap(); - } - /** - * - * - *
-     * Attributes for this message. If this field is empty, the message must
-     * contain non-empty data. This can be used to filter messages on the
-     * subscription.
-     * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public java.util.Map getAttributesMap() { - return internalGetAttributes().getMap(); - } - /** - * - * - *
-     * Attributes for this message. If this field is empty, the message must
-     * contain non-empty data. This can be used to filter messages on the
-     * subscription.
-     * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public /* nullable */ java.lang.String getAttributesOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * Attributes for this message. If this field is empty, the message must
-     * contain non-empty data. This can be used to filter messages on the
-     * subscription.
-     * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public java.lang.String getAttributesOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttributes() { - bitField0_ = (bitField0_ & ~0x00000002); - internalGetMutableAttributes().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * Attributes for this message. If this field is empty, the message must
-     * contain non-empty data. This can be used to filter messages on the
-     * subscription.
-     * 
- * - * map<string, string> attributes = 2; - */ - public Builder removeAttributes(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableAttributes().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableAttributes() { - bitField0_ |= 0x00000002; - return internalGetMutableAttributes().getMutableMap(); - } - /** - * - * - *
-     * Attributes for this message. If this field is empty, the message must
-     * contain non-empty data. This can be used to filter messages on the
-     * subscription.
-     * 
- * - * map<string, string> attributes = 2; - */ - public Builder putAttributes(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new NullPointerException("map key"); - } - if (value == null) { - throw new NullPointerException("map value"); - } - internalGetMutableAttributes().getMutableMap().put(key, value); - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-     * Attributes for this message. If this field is empty, the message must
-     * contain non-empty data. This can be used to filter messages on the
-     * subscription.
-     * 
- * - * map<string, string> attributes = 2; - */ - public Builder putAllAttributes(java.util.Map values) { - internalGetMutableAttributes().getMutableMap().putAll(values); - bitField0_ |= 0x00000002; - return this; - } - - private java.lang.Object messageId_ = ""; - /** - * - * - *
-     * ID of this message, assigned by the server when the message is published.
-     * Guaranteed to be unique within the topic. This value may be read by a
-     * subscriber that receives a `PubsubMessage` via a `Pull` call or a push
-     * delivery. It must not be populated by the publisher in a `Publish` call.
-     * 
- * - * string message_id = 3; - * - * @return The messageId. - */ - public java.lang.String getMessageId() { - java.lang.Object ref = messageId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - messageId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * ID of this message, assigned by the server when the message is published.
-     * Guaranteed to be unique within the topic. This value may be read by a
-     * subscriber that receives a `PubsubMessage` via a `Pull` call or a push
-     * delivery. It must not be populated by the publisher in a `Publish` call.
-     * 
- * - * string message_id = 3; - * - * @return The bytes for messageId. - */ - public com.google.protobuf.ByteString getMessageIdBytes() { - java.lang.Object ref = messageId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - messageId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * ID of this message, assigned by the server when the message is published.
-     * Guaranteed to be unique within the topic. This value may be read by a
-     * subscriber that receives a `PubsubMessage` via a `Pull` call or a push
-     * delivery. It must not be populated by the publisher in a `Publish` call.
-     * 
- * - * string message_id = 3; - * - * @param value The messageId to set. - * @return This builder for chaining. - */ - public Builder setMessageId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - messageId_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * ID of this message, assigned by the server when the message is published.
-     * Guaranteed to be unique within the topic. This value may be read by a
-     * subscriber that receives a `PubsubMessage` via a `Pull` call or a push
-     * delivery. It must not be populated by the publisher in a `Publish` call.
-     * 
- * - * string message_id = 3; - * - * @return This builder for chaining. - */ - public Builder clearMessageId() { - messageId_ = getDefaultInstance().getMessageId(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-     * ID of this message, assigned by the server when the message is published.
-     * Guaranteed to be unique within the topic. This value may be read by a
-     * subscriber that receives a `PubsubMessage` via a `Pull` call or a push
-     * delivery. It must not be populated by the publisher in a `Publish` call.
-     * 
- * - * string message_id = 3; - * - * @param value The bytes for messageId to set. - * @return This builder for chaining. - */ - public Builder setMessageIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - messageId_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp publishTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - publishTimeBuilder_; - /** - * - * - *
-     * The time at which the message was published, populated by the server when
-     * it receives the `Publish` call. It must not be populated by the
-     * publisher in a `Publish` call.
-     * 
- * - * .google.protobuf.Timestamp publish_time = 4; - * - * @return Whether the publishTime field is set. - */ - public boolean hasPublishTime() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-     * The time at which the message was published, populated by the server when
-     * it receives the `Publish` call. It must not be populated by the
-     * publisher in a `Publish` call.
-     * 
- * - * .google.protobuf.Timestamp publish_time = 4; - * - * @return The publishTime. - */ - public com.google.protobuf.Timestamp getPublishTime() { - if (publishTimeBuilder_ == null) { - return publishTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : publishTime_; - } else { - return publishTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The time at which the message was published, populated by the server when
-     * it receives the `Publish` call. It must not be populated by the
-     * publisher in a `Publish` call.
-     * 
- * - * .google.protobuf.Timestamp publish_time = 4; - */ - public Builder setPublishTime(com.google.protobuf.Timestamp value) { - if (publishTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - publishTime_ = value; - } else { - publishTimeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * The time at which the message was published, populated by the server when
-     * it receives the `Publish` call. It must not be populated by the
-     * publisher in a `Publish` call.
-     * 
- * - * .google.protobuf.Timestamp publish_time = 4; - */ - public Builder setPublishTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (publishTimeBuilder_ == null) { - publishTime_ = builderForValue.build(); - } else { - publishTimeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * The time at which the message was published, populated by the server when
-     * it receives the `Publish` call. It must not be populated by the
-     * publisher in a `Publish` call.
-     * 
- * - * .google.protobuf.Timestamp publish_time = 4; - */ - public Builder mergePublishTime(com.google.protobuf.Timestamp value) { - if (publishTimeBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0) - && publishTime_ != null - && publishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - getPublishTimeBuilder().mergeFrom(value); - } else { - publishTime_ = value; - } - } else { - publishTimeBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * The time at which the message was published, populated by the server when
-     * it receives the `Publish` call. It must not be populated by the
-     * publisher in a `Publish` call.
-     * 
- * - * .google.protobuf.Timestamp publish_time = 4; - */ - public Builder clearPublishTime() { - bitField0_ = (bitField0_ & ~0x00000008); - publishTime_ = null; - if (publishTimeBuilder_ != null) { - publishTimeBuilder_.dispose(); - publishTimeBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * The time at which the message was published, populated by the server when
-     * it receives the `Publish` call. It must not be populated by the
-     * publisher in a `Publish` call.
-     * 
- * - * .google.protobuf.Timestamp publish_time = 4; - */ - public com.google.protobuf.Timestamp.Builder getPublishTimeBuilder() { - bitField0_ |= 0x00000008; - onChanged(); - return getPublishTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The time at which the message was published, populated by the server when
-     * it receives the `Publish` call. It must not be populated by the
-     * publisher in a `Publish` call.
-     * 
- * - * .google.protobuf.Timestamp publish_time = 4; - */ - public com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder() { - if (publishTimeBuilder_ != null) { - return publishTimeBuilder_.getMessageOrBuilder(); - } else { - return publishTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : publishTime_; - } - } - /** - * - * - *
-     * The time at which the message was published, populated by the server when
-     * it receives the `Publish` call. It must not be populated by the
-     * publisher in a `Publish` call.
-     * 
- * - * .google.protobuf.Timestamp publish_time = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getPublishTimeFieldBuilder() { - if (publishTimeBuilder_ == null) { - publishTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getPublishTime(), getParentForChildren(), isClean()); - publishTime_ = null; - } - return publishTimeBuilder_; - } - - private java.lang.Object orderingKey_ = ""; - /** - * - * - *
-     * If non-empty, identifies related messages for which publish order should be
-     * respected. If a `Subscription` has `enable_message_ordering` set to `true`,
-     * messages published with the same non-empty `ordering_key` value will be
-     * delivered to subscribers in the order in which they are received by the
-     * Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
-     * must specify the same `ordering_key` value.
-     * For more information, see [ordering
-     * messages](https://cloud.google.com/pubsub/docs/ordering).
-     * 
- * - * string ordering_key = 5; - * - * @return The orderingKey. - */ - public java.lang.String getOrderingKey() { - java.lang.Object ref = orderingKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - orderingKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * If non-empty, identifies related messages for which publish order should be
-     * respected. If a `Subscription` has `enable_message_ordering` set to `true`,
-     * messages published with the same non-empty `ordering_key` value will be
-     * delivered to subscribers in the order in which they are received by the
-     * Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
-     * must specify the same `ordering_key` value.
-     * For more information, see [ordering
-     * messages](https://cloud.google.com/pubsub/docs/ordering).
-     * 
- * - * string ordering_key = 5; - * - * @return The bytes for orderingKey. - */ - public com.google.protobuf.ByteString getOrderingKeyBytes() { - java.lang.Object ref = orderingKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - orderingKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * If non-empty, identifies related messages for which publish order should be
-     * respected. If a `Subscription` has `enable_message_ordering` set to `true`,
-     * messages published with the same non-empty `ordering_key` value will be
-     * delivered to subscribers in the order in which they are received by the
-     * Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
-     * must specify the same `ordering_key` value.
-     * For more information, see [ordering
-     * messages](https://cloud.google.com/pubsub/docs/ordering).
-     * 
- * - * string ordering_key = 5; - * - * @param value The orderingKey to set. - * @return This builder for chaining. - */ - public Builder setOrderingKey(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - orderingKey_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * If non-empty, identifies related messages for which publish order should be
-     * respected. If a `Subscription` has `enable_message_ordering` set to `true`,
-     * messages published with the same non-empty `ordering_key` value will be
-     * delivered to subscribers in the order in which they are received by the
-     * Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
-     * must specify the same `ordering_key` value.
-     * For more information, see [ordering
-     * messages](https://cloud.google.com/pubsub/docs/ordering).
-     * 
- * - * string ordering_key = 5; - * - * @return This builder for chaining. - */ - public Builder clearOrderingKey() { - orderingKey_ = getDefaultInstance().getOrderingKey(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; - } - /** - * - * - *
-     * If non-empty, identifies related messages for which publish order should be
-     * respected. If a `Subscription` has `enable_message_ordering` set to `true`,
-     * messages published with the same non-empty `ordering_key` value will be
-     * delivered to subscribers in the order in which they are received by the
-     * Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
-     * must specify the same `ordering_key` value.
-     * For more information, see [ordering
-     * messages](https://cloud.google.com/pubsub/docs/ordering).
-     * 
- * - * string ordering_key = 5; - * - * @param value The bytes for orderingKey to set. - * @return This builder for chaining. - */ - public Builder setOrderingKeyBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - orderingKey_ = value; - bitField0_ |= 0x00000010; - 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.PubsubMessage) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.PubsubMessage) - private static final com.google.pubsub.v1.PubsubMessage DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.PubsubMessage(); - } - - public static com.google.pubsub.v1.PubsubMessage getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PubsubMessage parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.PubsubMessage getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubMessageOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubMessageOrBuilder.java deleted file mode 100644 index 9e73913c8..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubMessageOrBuilder.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright 2023 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 PubsubMessageOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PubsubMessage) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The message data field. If this field is empty, the message must contain
-   * at least one attribute.
-   * 
- * - * bytes data = 1; - * - * @return The data. - */ - com.google.protobuf.ByteString getData(); - - /** - * - * - *
-   * Attributes for this message. If this field is empty, the message must
-   * contain non-empty data. This can be used to filter messages on the
-   * subscription.
-   * 
- * - * map<string, string> attributes = 2; - */ - int getAttributesCount(); - /** - * - * - *
-   * Attributes for this message. If this field is empty, the message must
-   * contain non-empty data. This can be used to filter messages on the
-   * subscription.
-   * 
- * - * map<string, string> attributes = 2; - */ - boolean containsAttributes(java.lang.String key); - /** Use {@link #getAttributesMap()} instead. */ - @java.lang.Deprecated - java.util.Map getAttributes(); - /** - * - * - *
-   * Attributes for this message. If this field is empty, the message must
-   * contain non-empty data. This can be used to filter messages on the
-   * subscription.
-   * 
- * - * map<string, string> attributes = 2; - */ - java.util.Map getAttributesMap(); - /** - * - * - *
-   * Attributes for this message. If this field is empty, the message must
-   * contain non-empty data. This can be used to filter messages on the
-   * subscription.
-   * 
- * - * map<string, string> attributes = 2; - */ - /* nullable */ - java.lang.String getAttributesOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue); - /** - * - * - *
-   * Attributes for this message. If this field is empty, the message must
-   * contain non-empty data. This can be used to filter messages on the
-   * subscription.
-   * 
- * - * map<string, string> attributes = 2; - */ - java.lang.String getAttributesOrThrow(java.lang.String key); - - /** - * - * - *
-   * ID of this message, assigned by the server when the message is published.
-   * Guaranteed to be unique within the topic. This value may be read by a
-   * subscriber that receives a `PubsubMessage` via a `Pull` call or a push
-   * delivery. It must not be populated by the publisher in a `Publish` call.
-   * 
- * - * string message_id = 3; - * - * @return The messageId. - */ - java.lang.String getMessageId(); - /** - * - * - *
-   * ID of this message, assigned by the server when the message is published.
-   * Guaranteed to be unique within the topic. This value may be read by a
-   * subscriber that receives a `PubsubMessage` via a `Pull` call or a push
-   * delivery. It must not be populated by the publisher in a `Publish` call.
-   * 
- * - * string message_id = 3; - * - * @return The bytes for messageId. - */ - com.google.protobuf.ByteString getMessageIdBytes(); - - /** - * - * - *
-   * The time at which the message was published, populated by the server when
-   * it receives the `Publish` call. It must not be populated by the
-   * publisher in a `Publish` call.
-   * 
- * - * .google.protobuf.Timestamp publish_time = 4; - * - * @return Whether the publishTime field is set. - */ - boolean hasPublishTime(); - /** - * - * - *
-   * The time at which the message was published, populated by the server when
-   * it receives the `Publish` call. It must not be populated by the
-   * publisher in a `Publish` call.
-   * 
- * - * .google.protobuf.Timestamp publish_time = 4; - * - * @return The publishTime. - */ - com.google.protobuf.Timestamp getPublishTime(); - /** - * - * - *
-   * The time at which the message was published, populated by the server when
-   * it receives the `Publish` call. It must not be populated by the
-   * publisher in a `Publish` call.
-   * 
- * - * .google.protobuf.Timestamp publish_time = 4; - */ - com.google.protobuf.TimestampOrBuilder getPublishTimeOrBuilder(); - - /** - * - * - *
-   * If non-empty, identifies related messages for which publish order should be
-   * respected. If a `Subscription` has `enable_message_ordering` set to `true`,
-   * messages published with the same non-empty `ordering_key` value will be
-   * delivered to subscribers in the order in which they are received by the
-   * Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
-   * must specify the same `ordering_key` value.
-   * For more information, see [ordering
-   * messages](https://cloud.google.com/pubsub/docs/ordering).
-   * 
- * - * string ordering_key = 5; - * - * @return The orderingKey. - */ - java.lang.String getOrderingKey(); - /** - * - * - *
-   * If non-empty, identifies related messages for which publish order should be
-   * respected. If a `Subscription` has `enable_message_ordering` set to `true`,
-   * messages published with the same non-empty `ordering_key` value will be
-   * delivered to subscribers in the order in which they are received by the
-   * Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest`
-   * must specify the same `ordering_key` value.
-   * For more information, see [ordering
-   * messages](https://cloud.google.com/pubsub/docs/ordering).
-   * 
- * - * string ordering_key = 5; - * - * @return The bytes for orderingKey. - */ - com.google.protobuf.ByteString getOrderingKeyBytes(); -} 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 deleted file mode 100644 index b680117a0..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java +++ /dev/null @@ -1,1171 +0,0 @@ -/* - * Copyright 2023 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 final class PubsubProto { - private PubsubProto() {} - - 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_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 - internal_static_google_pubsub_v1_Topic_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_Topic_LabelsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_Topic_LabelsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PubsubMessage_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_GetTopicRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_GetTopicRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_UpdateTopicRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_UpdateTopicRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PublishRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PublishRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PublishResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PublishResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListTopicsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListTopicsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListTopicsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListTopicsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_DeleteTopicRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_DetachSubscriptionRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_DetachSubscriptionRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_DetachSubscriptionResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_DetachSubscriptionResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_Subscription_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_Subscription_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_Subscription_LabelsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_Subscription_LabelsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_RetryPolicy_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_RetryPolicy_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_DeadLetterPolicy_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ExpirationPolicy_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ExpirationPolicy_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PushConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PushConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PushConfig_OidcToken_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PushConfig_OidcToken_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PushConfig_PubsubWrapper_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PushConfig_PubsubWrapper_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PushConfig_NoWrapper_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PushConfig_NoWrapper_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PushConfig_AttributesEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PushConfig_AttributesEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_BigQueryConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_BigQueryConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_CloudStorageConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_CloudStorageConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_CloudStorageConfig_AvroConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_CloudStorageConfig_AvroConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ReceivedMessage_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ReceivedMessage_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_GetSubscriptionRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_UpdateSubscriptionRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_UpdateSubscriptionRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListSubscriptionsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListSubscriptionsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_DeleteSubscriptionRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ModifyPushConfigRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PullRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PullRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_PullResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_PullResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_AcknowledgeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_StreamingPullRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_StreamingPullRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_StreamingPullResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_StreamingPullResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_StreamingPullResponse_AcknowledgeConfirmation_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_StreamingPullResponse_AcknowledgeConfirmation_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_StreamingPullResponse_ModifyAckDeadlineConfirmation_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_StreamingPullResponse_ModifyAckDeadlineConfirmation_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_StreamingPullResponse_SubscriptionProperties_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_StreamingPullResponse_SubscriptionProperties_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_CreateSnapshotRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_CreateSnapshotRequest_LabelsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_CreateSnapshotRequest_LabelsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_UpdateSnapshotRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_UpdateSnapshotRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_Snapshot_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_Snapshot_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_Snapshot_LabelsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_Snapshot_LabelsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_GetSnapshotRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_GetSnapshotRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListSnapshotsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListSnapshotsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListSnapshotsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListSnapshotsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_DeleteSnapshotRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_DeleteSnapshotRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_SeekRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_SeekRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_SeekResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_SeekResponse_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/pubsub.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\036google/protobuf/duration.proto\032\033go" - + "ogle/protobuf/empty.proto\032 google/protob" - + "uf/field_mask.proto\032\037google/protobuf/tim" - + "estamp.proto\032\035google/pubsub/v1/schema.pr" - + "oto\";\n\024MessageStoragePolicy\022#\n\033allowed_p" - + "ersistence_regions\030\001 \003(\t\"\252\001\n\016SchemaSetti" - + "ngs\0225\n\006schema\030\001 \001(\tB%\342A\001\002\372A\036\n\034pubsub.goo" - + "gleapis.com/Schema\022,\n\010encoding\030\002 \001(\0162\032.g" - + "oogle.pubsub.v1.Encoding\022\031\n\021first_revisi" - + "on_id\030\003 \001(\t\022\030\n\020last_revision_id\030\004 \001(\t\"\304\003" - + "\n\005Topic\022\022\n\004name\030\001 \001(\tB\004\342A\001\002\0223\n\006labels\030\002 " - + "\003(\0132#.google.pubsub.v1.Topic.LabelsEntry" - + "\022F\n\026message_storage_policy\030\003 \001(\0132&.googl" - + "e.pubsub.v1.MessageStoragePolicy\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\rsat" - + "isfies_pzs\030\007 \001(\010\022=\n\032message_retention_du" - + "ration\030\010 \001(\0132\031.google.protobuf.Duration\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/{topic}\022\017_de" - + "leted-topic_\"\361\001\n\rPubsubMessage\022\014\n\004data\030\001" - + " \001(\014\022C\n\nattributes\030\002 \003(\0132/.google.pubsub" - + ".v1.PubsubMessage.AttributesEntry\022\022\n\nmes" - + "sage_id\030\003 \001(\t\0220\n\014publish_time\030\004 \001(\0132\032.go" - + "ogle.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\"F\n\017GetTopicRequest\0223\n\005t" - + "opic\030\001 \001(\tB$\342A\001\002\372A\035\n\033pubsub.googleapis.c" - + "om/Topic\"y\n\022UpdateTopicRequest\022,\n\005topic\030" - + "\001 \001(\0132\027.google.pubsub.v1.TopicB\004\342A\001\002\0225\n\013" - + "update_mask\030\002 \001(\0132\032.google.protobuf.Fiel" - + "dMaskB\004\342A\001\002\"~\n\016PublishRequest\0223\n\005topic\030\001" - + " \001(\tB$\342A\001\002\372A\035\n\033pubsub.googleapis.com/Top" - + "ic\0227\n\010messages\030\002 \003(\0132\037.google.pubsub.v1." - + "PubsubMessageB\004\342A\001\002\"&\n\017PublishResponse\022\023" - + "\n\013message_ids\030\001 \003(\t\"\201\001\n\021ListTopicsReques" - + "t\022E\n\007project\030\001 \001(\tB4\342A\001\002\372A-\n+cloudresour" - + "cemanager.googleapis.com/Project\022\021\n\tpage" - + "_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"V\n\022ListT" - + "opicsResponse\022\'\n\006topics\030\001 \003(\0132\027.google.p" - + "ubsub.v1.Topic\022\027\n\017next_page_token\030\002 \001(\t\"" - + "{\n\035ListTopicSubscriptionsRequest\0223\n\005topi" - + "c\030\001 \001(\tB$\342A\001\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\rsubscriptions\030\001 \003(\tB\'\372A$\n\"pubsub.googl" - + "eapis.com/Subscription\022\027\n\017next_page_toke" - + "n\030\002 \001(\t\"w\n\031ListTopicSnapshotsRequest\0223\n\005" - + "topic\030\001 \001(\tB$\342A\001\002\372A\035\n\033pubsub.googleapis." - + "com/Topic\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_tok" - + "en\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\"I\n\022DeleteTopicRequest\0223\n\005topic\030\001 \001(\tB" - + "$\342A\001\002\372A\035\n\033pubsub.googleapis.com/Topic\"^\n" - + "\031DetachSubscriptionRequest\022A\n\014subscripti" - + "on\030\001 \001(\tB+\342A\001\002\372A$\n\"pubsub.googleapis.com" - + "/Subscription\"\034\n\032DetachSubscriptionRespo" - + "nse\"\255\010\n\014Subscription\022\022\n\004name\030\001 \001(\tB\004\342A\001\002" - + "\0223\n\005topic\030\002 \001(\tB$\342A\001\002\372A\035\n\033pubsub.googlea" - + "pis.com/Topic\0221\n\013push_config\030\004 \001(\0132\034.goo" - + "gle.pubsub.v1.PushConfig\0229\n\017bigquery_con" - + "fig\030\022 \001(\0132 .google.pubsub.v1.BigQueryCon" - + "fig\022B\n\024cloud_storage_config\030\026 \001(\0132$.goog" - + "le.pubsub.v1.CloudStorageConfig\022\034\n\024ack_d" - + "eadline_seconds\030\005 \001(\005\022\035\n\025retain_acked_me" - + "ssages\030\007 \001(\010\022=\n\032message_retention_durati" - + "on\030\010 \001(\0132\031.google.protobuf.Duration\022:\n\006l" - + "abels\030\t \003(\0132*.google.pubsub.v1.Subscript" - + "ion.LabelsEntry\022\037\n\027enable_message_orderi" - + "ng\030\n \001(\010\022=\n\021expiration_policy\030\013 \001(\0132\".go" - + "ogle.pubsub.v1.ExpirationPolicy\022\016\n\006filte" - + "r\030\014 \001(\t\022>\n\022dead_letter_policy\030\r \001(\0132\".go" - + "ogle.pubsub.v1.DeadLetterPolicy\0223\n\014retry" - + "_policy\030\016 \001(\0132\035.google.pubsub.v1.RetryPo" - + "licy\022\020\n\010detached\030\017 \001(\010\022$\n\034enable_exactly" - + "_once_delivery\030\020 \001(\010\022I\n topic_message_re" - + "tention_duration\030\021 \001(\0132\031.google.protobuf" - + ".DurationB\004\342A\001\003\0229\n\005state\030\023 \001(\0162$.google." - + "pubsub.v1.Subscription.StateB\004\342A\001\003\032-\n\013La" - + "belsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" - + "\001\">\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006ACT" - + "IVE\020\001\022\022\n\016RESOURCE_ERROR\020\002:X\352AU\n\"pubsub.g" - + "oogleapis.com/Subscription\022/projects/{pr" - + "oject}/subscriptions/{subscription}\"u\n\013R" - + "etryPolicy\0222\n\017minimum_backoff\030\001 \001(\0132\031.go" - + "ogle.protobuf.Duration\0222\n\017maximum_backof" - + "f\030\002 \001(\0132\031.google.protobuf.Duration\"L\n\020De" - + "adLetterPolicy\022\031\n\021dead_letter_topic\030\001 \001(" - + "\t\022\035\n\025max_delivery_attempts\030\002 \001(\005\":\n\020Expi" - + "rationPolicy\022&\n\003ttl\030\001 \001(\0132\031.google.proto" - + "buf.Duration\"\362\003\n\nPushConfig\022\025\n\rpush_endp" - + "oint\030\001 \001(\t\022@\n\nattributes\030\002 \003(\0132,.google." - + "pubsub.v1.PushConfig.AttributesEntry\022<\n\n" - + "oidc_token\030\003 \001(\0132&.google.pubsub.v1.Push" - + "Config.OidcTokenH\000\022D\n\016pubsub_wrapper\030\004 \001" - + "(\0132*.google.pubsub.v1.PushConfig.PubsubW" - + "rapperH\001\022<\n\nno_wrapper\030\005 \001(\0132&.google.pu" - + "bsub.v1.PushConfig.NoWrapperH\001\032<\n\tOidcTo" - + "ken\022\035\n\025service_account_email\030\001 \001(\t\022\020\n\010au" - + "dience\030\002 \001(\t\032\017\n\rPubsubWrapper\032#\n\tNoWrapp" - + "er\022\026\n\016write_metadata\030\001 \001(\010\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_methodB\t\n\007wrapper\"\270\002\n\016Bi" - + "gQueryConfig\022\r\n\005table\030\001 \001(\t\022\036\n\020use_topic" - + "_schema\030\002 \001(\010B\004\342A\001\001\022\026\n\016write_metadata\030\003 " - + "\001(\010\022\033\n\023drop_unknown_fields\030\004 \001(\010\022;\n\005stat" - + "e\030\005 \001(\0162&.google.pubsub.v1.BigQueryConfi" - + "g.StateB\004\342A\001\003\022\036\n\020use_table_schema\030\006 \001(\010B" - + "\004\342A\001\001\"e\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n" - + "\006ACTIVE\020\001\022\025\n\021PERMISSION_DENIED\020\002\022\r\n\tNOT_" - + "FOUND\020\003\022\023\n\017SCHEMA_MISMATCH\020\004\"\210\004\n\022CloudSt" - + "orageConfig\022\024\n\006bucket\030\001 \001(\tB\004\342A\001\002\022\027\n\017fil" - + "ename_prefix\030\002 \001(\t\022\027\n\017filename_suffix\030\003 " - + "\001(\t\022F\n\013text_config\030\004 \001(\0132/.google.pubsub" - + ".v1.CloudStorageConfig.TextConfigH\000\022F\n\013a" - + "vro_config\030\005 \001(\0132/.google.pubsub.v1.Clou" - + "dStorageConfig.AvroConfigH\000\022/\n\014max_durat" - + "ion\030\006 \001(\0132\031.google.protobuf.Duration\022\021\n\t" - + "max_bytes\030\007 \001(\003\022?\n\005state\030\t \001(\0162*.google." - + "pubsub.v1.CloudStorageConfig.StateB\004\342A\001\003" - + "\032\014\n\nTextConfig\032$\n\nAvroConfig\022\026\n\016write_me" - + "tadata\030\001 \001(\010\"P\n\005State\022\025\n\021STATE_UNSPECIFI" - + "ED\020\000\022\n\n\006ACTIVE\020\001\022\025\n\021PERMISSION_DENIED\020\002\022" - + "\r\n\tNOT_FOUND\020\003B\017\n\routput_format\"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\"[\n\026GetSubscriptio" - + "nRequest\022A\n\014subscription\030\001 \001(\tB+\342A\001\002\372A$\n" - + "\"pubsub.googleapis.com/Subscription\"\216\001\n\031" - + "UpdateSubscriptionRequest\022:\n\014subscriptio" - + "n\030\001 \001(\0132\036.google.pubsub.v1.SubscriptionB" - + "\004\342A\001\002\0225\n\013update_mask\030\002 \001(\0132\032.google.prot" - + "obuf.FieldMaskB\004\342A\001\002\"\210\001\n\030ListSubscriptio" - + "nsRequest\022E\n\007project\030\001 \001(\tB4\342A\001\002\372A-\n+clo" - + "udresourcemanager.googleapis.com/Project" - + "\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"" - + "k\n\031ListSubscriptionsResponse\0225\n\rsubscrip" - + "tions\030\001 \003(\0132\036.google.pubsub.v1.Subscript" - + "ion\022\027\n\017next_page_token\030\002 \001(\t\"^\n\031DeleteSu" - + "bscriptionRequest\022A\n\014subscription\030\001 \001(\tB" - + "+\342A\001\002\372A$\n\"pubsub.googleapis.com/Subscrip" - + "tion\"\225\001\n\027ModifyPushConfigRequest\022A\n\014subs" - + "cription\030\001 \001(\tB+\342A\001\002\372A$\n\"pubsub.googleap" - + "is.com/Subscription\0227\n\013push_config\030\002 \001(\013" - + "2\034.google.pubsub.v1.PushConfigB\004\342A\001\002\"\220\001\n" - + "\013PullRequest\022A\n\014subscription\030\001 \001(\tB+\342A\001\002" - + "\372A$\n\"pubsub.googleapis.com/Subscription\022" - + "\"\n\022return_immediately\030\002 \001(\010B\006\030\001\342A\001\001\022\032\n\014m" - + "ax_messages\030\003 \001(\005B\004\342A\001\002\"L\n\014PullResponse\022" - + "<\n\021received_messages\030\001 \003(\0132!.google.pubs" - + "ub.v1.ReceivedMessage\"\230\001\n\030ModifyAckDeadl" - + "ineRequest\022A\n\014subscription\030\001 \001(\tB+\342A\001\002\372A" - + "$\n\"pubsub.googleapis.com/Subscription\022\025\n" - + "\007ack_ids\030\004 \003(\tB\004\342A\001\002\022\"\n\024ack_deadline_sec" - + "onds\030\003 \001(\005B\004\342A\001\002\"n\n\022AcknowledgeRequest\022A" - + "\n\014subscription\030\001 \001(\tB+\342A\001\002\372A$\n\"pubsub.go" - + "ogleapis.com/Subscription\022\025\n\007ack_ids\030\002 \003" - + "(\tB\004\342A\001\002\"\253\002\n\024StreamingPullRequest\022A\n\014sub" - + "scription\030\001 \001(\tB+\342A\001\002\372A$\n\"pubsub.googlea" - + "pis.com/Subscription\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_ids\030\004 \003(\t\022)\n\033stream_ack_de" - + "adline_seconds\030\005 \001(\005B\004\342A\001\002\022\021\n\tclient_id\030" - + "\006 \001(\t\022 \n\030max_outstanding_messages\030\007 \001(\003\022" - + "\035\n\025max_outstanding_bytes\030\010 \001(\003\"\335\005\n\025Strea" - + "mingPullResponse\022<\n\021received_messages\030\001 " - + "\003(\0132!.google.pubsub.v1.ReceivedMessage\022a" - + "\n\030acknowledge_confirmation\030\005 \001(\0132?.googl" - + "e.pubsub.v1.StreamingPullResponse.Acknow" - + "ledgeConfirmation\022o\n modify_ack_deadline" - + "_confirmation\030\003 \001(\0132E.google.pubsub.v1.S" - + "treamingPullResponse.ModifyAckDeadlineCo" - + "nfirmation\022_\n\027subscription_properties\030\004 " - + "\001(\0132>.google.pubsub.v1.StreamingPullResp" - + "onse.SubscriptionProperties\032\200\001\n\027Acknowle" - + "dgeConfirmation\022\017\n\007ack_ids\030\001 \003(\t\022\027\n\017inva" - + "lid_ack_ids\030\002 \003(\t\022\031\n\021unordered_ack_ids\030\003" - + " \003(\t\022 \n\030temporary_failed_ack_ids\030\004 \003(\t\032k" - + "\n\035ModifyAckDeadlineConfirmation\022\017\n\007ack_i" - + "ds\030\001 \003(\t\022\027\n\017invalid_ack_ids\030\002 \003(\t\022 \n\030tem" - + "porary_failed_ack_ids\030\003 \003(\t\032a\n\026Subscript" - + "ionProperties\022%\n\035exactly_once_delivery_e" - + "nabled\030\001 \001(\010\022 \n\030message_ordering_enabled" - + "\030\002 \001(\010\"\205\002\n\025CreateSnapshotRequest\0225\n\004name" - + "\030\001 \001(\tB\'\342A\001\002\372A \n\036pubsub.googleapis.com/S" - + "napshot\022A\n\014subscription\030\002 \001(\tB+\342A\001\002\372A$\n\"" - + "pubsub.googleapis.com/Subscription\022C\n\006la" - + "bels\030\003 \003(\01323.google.pubsub.v1.CreateSnap" - + "shotRequest.LabelsEntry\032-\n\013LabelsEntry\022\013" - + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\202\001\n\025Updat" - + "eSnapshotRequest\0222\n\010snapshot\030\001 \001(\0132\032.goo" - + "gle.pubsub.v1.SnapshotB\004\342A\001\002\0225\n\013update_m" - + "ask\030\002 \001(\0132\032.google.protobuf.FieldMaskB\004\342" - + "A\001\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.T" - + "imestamp\0226\n\006labels\030\004 \003(\0132&.google.pubsub" - + ".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\036pu" - + "bsub.googleapis.com/Snapshot\022\'projects/{" - + "project}/snapshots/{snapshot}\"O\n\022GetSnap" - + "shotRequest\0229\n\010snapshot\030\001 \001(\tB\'\342A\001\002\372A \n\036" - + "pubsub.googleapis.com/Snapshot\"\204\001\n\024ListS" - + "napshotsRequest\022E\n\007project\030\001 \001(\tB4\342A\001\002\372A" - + "-\n+cloudresourcemanager.googleapis.com/P" - + "roject\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030" - + "\003 \001(\t\"_\n\025ListSnapshotsResponse\022-\n\tsnapsh" - + "ots\030\001 \003(\0132\032.google.pubsub.v1.Snapshot\022\027\n" - + "\017next_page_token\030\002 \001(\t\"R\n\025DeleteSnapshot" - + "Request\0229\n\010snapshot\030\001 \001(\tB\'\342A\001\002\372A \n\036pubs" - + "ub.googleapis.com/Snapshot\"\277\001\n\013SeekReque" - + "st\022A\n\014subscription\030\001 \001(\tB+\342A\001\002\372A$\n\"pubsu" - + "b.googleapis.com/Subscription\022*\n\004time\030\002 " - + "\001(\0132\032.google.protobuf.TimestampH\000\0227\n\010sna" - + "pshot\030\003 \001(\tB#\372A \n\036pubsub.googleapis.com/" - + "SnapshotH\000B\010\n\006target\"\016\n\014SeekResponse2\270\013\n" - + "\tPublisher\022q\n\013CreateTopic\022\027.google.pubsu" - + "b.v1.Topic\032\027.google.pubsub.v1.Topic\"0\332A\004" - + "name\202\323\344\223\002#\032\036/v1/{name=projects/*/topics/" - + "*}:\001*\022\221\001\n\013UpdateTopic\022$.google.pubsub.v1" - + ".UpdateTopicRequest\032\027.google.pubsub.v1.T" - + "opic\"C\332A\021topic,update_mask\202\323\344\223\002)2$/v1/{t" - + "opic.name=projects/*/topics/*}:\001*\022\223\001\n\007Pu" - + "blish\022 .google.pubsub.v1.PublishRequest\032" - + "!.google.pubsub.v1.PublishResponse\"C\332A\016t" - + "opic,messages\202\323\344\223\002,\"\'/v1/{topic=projects" - + "/*/topics/*}:publish:\001*\022w\n\010GetTopic\022!.go" - + "ogle.pubsub.v1.GetTopicRequest\032\027.google." - + "pubsub.v1.Topic\"/\332A\005topic\202\323\344\223\002!\022\037/v1/{to" - + "pic=projects/*/topics/*}\022\212\001\n\nListTopics\022" - + "#.google.pubsub.v1.ListTopicsRequest\032$.g" - + "oogle.pubsub.v1.ListTopicsResponse\"1\332A\007p" - + "roject\202\323\344\223\002!\022\037/v1/{project=projects/*}/t" - + "opics\022\272\001\n\026ListTopicSubscriptions\022/.googl" - + "e.pubsub.v1.ListTopicSubscriptionsReques" - + "t\0320.google.pubsub.v1.ListTopicSubscripti" - + "onsResponse\"=\332A\005topic\202\323\344\223\002/\022-/v1/{topic=" - + "projects/*/topics/*}/subscriptions\022\252\001\n\022L" - + "istTopicSnapshots\022+.google.pubsub.v1.Lis" - + "tTopicSnapshotsRequest\032,.google.pubsub.v" - + "1.ListTopicSnapshotsResponse\"9\332A\005topic\202\323" - + "\344\223\002+\022)/v1/{topic=projects/*/topics/*}/sn" - + "apshots\022|\n\013DeleteTopic\022$.google.pubsub.v" - + "1.DeleteTopicRequest\032\026.google.protobuf.E" - + "mpty\"/\332A\005topic\202\323\344\223\002!*\037/v1/{topic=project" - + "s/*/topics/*}\022\255\001\n\022DetachSubscription\022+.g" - + "oogle.pubsub.v1.DetachSubscriptionReques" - + "t\032,.google.pubsub.v1.DetachSubscriptionR" - + "esponse\"<\202\323\344\223\0026\"4/v1/{subscription=proje" - + "cts/*/subscriptions/*}:detach\032p\312A\025pubsub" - + ".googleapis.com\322AUhttps://www.googleapis" - + ".com/auth/cloud-platform,https://www.goo" - + "gleapis.com/auth/pubsub2\322\025\n\nSubscriber\022\264" - + "\001\n\022CreateSubscription\022\036.google.pubsub.v1" - + ".Subscription\032\036.google.pubsub.v1.Subscri" - + "ption\"^\332A+name,topic,push_config,ack_dea" - + "dline_seconds\202\323\344\223\002*\032%/v1/{name=projects/" - + "*/subscriptions/*}:\001*\022\241\001\n\017GetSubscriptio" - + "n\022(.google.pubsub.v1.GetSubscriptionRequ" - + "est\032\036.google.pubsub.v1.Subscription\"D\332A\014" - + "subscription\202\323\344\223\002/\022-/v1/{subscription=pr" - + "ojects/*/subscriptions/*}\022\273\001\n\022UpdateSubs" - + "cription\022+.google.pubsub.v1.UpdateSubscr" - + "iptionRequest\032\036.google.pubsub.v1.Subscri" - + "ption\"X\332A\030subscription,update_mask\202\323\344\223\0027" - + "22/v1/{subscription.name=projects/*/subs" - + "criptions/*}:\001*\022\246\001\n\021ListSubscriptions\022*." - + "google.pubsub.v1.ListSubscriptionsReques" - + "t\032+.google.pubsub.v1.ListSubscriptionsRe" - + "sponse\"8\332A\007project\202\323\344\223\002(\022&/v1/{project=p" - + "rojects/*}/subscriptions\022\237\001\n\022DeleteSubsc" - + "ription\022+.google.pubsub.v1.DeleteSubscri" - + "ptionRequest\032\026.google.protobuf.Empty\"D\332A" - + "\014subscription\202\323\344\223\002/*-/v1/{subscription=p" - + "rojects/*/subscriptions/*}\022\317\001\n\021ModifyAck" - + "Deadline\022*.google.pubsub.v1.ModifyAckDea" - + "dlineRequest\032\026.google.protobuf.Empty\"v\332A" - + ")subscription,ack_ids,ack_deadline_secon" - + "ds\202\323\344\223\002D\"?/v1/{subscription=projects/*/s" - + "ubscriptions/*}:modifyAckDeadline:\001*\022\250\001\n" - + "\013Acknowledge\022$.google.pubsub.v1.Acknowle" - + "dgeRequest\032\026.google.protobuf.Empty\"[\332A\024s" - + "ubscription,ack_ids\202\323\344\223\002>\"9/v1/{subscrip" - + "tion=projects/*/subscriptions/*}:acknowl" - + "edge:\001*\022\320\001\n\004Pull\022\035.google.pubsub.v1.Pull" - + "Request\032\036.google.pubsub.v1.PullResponse\"" - + "\210\001\332A,subscription,return_immediately,max" - + "_messages\332A\031subscription,max_messages\202\323\344" - + "\223\0027\"2/v1/{subscription=projects/*/subscr" - + "iptions/*}:pull:\001*\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\332A\030subscription,push_config\202" - + "\323\344\223\002C\">/v1/{subscription=projects/*/subs" - + "criptions/*}:modifyPushConfig:\001*\022\211\001\n\013Get" - + "Snapshot\022$.google.pubsub.v1.GetSnapshotR" - + "equest\032\032.google.pubsub.v1.Snapshot\"8\332A\010s" - + "napshot\202\323\344\223\002\'\022%/v1/{snapshot=projects/*/" - + "snapshots/*}\022\226\001\n\rListSnapshots\022&.google." - + "pubsub.v1.ListSnapshotsRequest\032\'.google." - + "pubsub.v1.ListSnapshotsResponse\"4\332A\007proj" - + "ect\202\323\344\223\002$\022\"/v1/{project=projects/*}/snap" - + "shots\022\227\001\n\016CreateSnapshot\022\'.google.pubsub" - + ".v1.CreateSnapshotRequest\032\032.google.pubsu" - + "b.v1.Snapshot\"@\332A\021name,subscription\202\323\344\223\002" - + "&\032!/v1/{name=projects/*/snapshots/*}:\001*\022" - + "\243\001\n\016UpdateSnapshot\022\'.google.pubsub.v1.Up" - + "dateSnapshotRequest\032\032.google.pubsub.v1.S" - + "napshot\"L\332A\024snapshot,update_mask\202\323\344\223\002/2*" - + "/v1/{snapshot.name=projects/*/snapshots/" - + "*}:\001*\022\213\001\n\016DeleteSnapshot\022\'.google.pubsub" - + ".v1.DeleteSnapshotRequest\032\026.google.proto" - + "buf.Empty\"8\332A\010snapshot\202\323\344\223\002\'*%/v1/{snaps" - + "hot=projects/*/snapshots/*}\022\204\001\n\004Seek\022\035.g" - + "oogle.pubsub.v1.SeekRequest\032\036.google.pub" - + "sub.v1.SeekResponse\"=\202\323\344\223\0027\"2/v1/{subscr" - + "iption=projects/*/subscriptions/*}:seek:" - + "\001*\032p\312A\025pubsub.googleapis.com\322AUhttps://w" - + "ww.googleapis.com/auth/cloud-platform,ht" - + "tps://www.googleapis.com/auth/pubsubB\252\001\n" - + "\024com.google.pubsub.v1B\013PubsubProtoP\001Z2cl" - + "oud.google.com/go/pubsub/apiv1/pubsubpb;" - + "pubsubpb\370\001\001\252\002\026Google.Cloud.PubSub.V1\312\002\026G" - + "oogle\\Cloud\\PubSub\\V1\352\002\031Google::Cloud::P" - + "ubSub::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.DurationProto.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); - internal_static_google_pubsub_v1_MessageStoragePolicy_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_MessageStoragePolicy_descriptor, - new java.lang.String[] { - "AllowedPersistenceRegions", - }); - 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", "FirstRevisionId", "LastRevisionId", - }); - 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", - "SchemaSettings", - "SatisfiesPzs", - "MessageRetentionDuration", - }); - internal_static_google_pubsub_v1_Topic_LabelsEntry_descriptor = - internal_static_google_pubsub_v1_Topic_descriptor.getNestedTypes().get(0); - internal_static_google_pubsub_v1_Topic_LabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_Topic_LabelsEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_pubsub_v1_PubsubMessage_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_pubsub_v1_PubsubMessage_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PubsubMessage_descriptor, - new java.lang.String[] { - "Data", "Attributes", "MessageId", "PublishTime", "OrderingKey", - }); - internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_descriptor = - internal_static_google_pubsub_v1_PubsubMessage_descriptor.getNestedTypes().get(0); - internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PubsubMessage_AttributesEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_pubsub_v1_GetTopicRequest_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_pubsub_v1_GetTopicRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_GetTopicRequest_descriptor, - new java.lang.String[] { - "Topic", - }); - internal_static_google_pubsub_v1_UpdateTopicRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_pubsub_v1_UpdateTopicRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_UpdateTopicRequest_descriptor, - new java.lang.String[] { - "Topic", "UpdateMask", - }); - internal_static_google_pubsub_v1_PublishRequest_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_pubsub_v1_PublishRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PublishRequest_descriptor, - new java.lang.String[] { - "Topic", "Messages", - }); - internal_static_google_pubsub_v1_PublishResponse_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_pubsub_v1_PublishResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PublishResponse_descriptor, - new java.lang.String[] { - "MessageIds", - }); - internal_static_google_pubsub_v1_ListTopicsRequest_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_pubsub_v1_ListTopicsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListTopicsRequest_descriptor, - new java.lang.String[] { - "Project", "PageSize", "PageToken", - }); - internal_static_google_pubsub_v1_ListTopicsResponse_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_pubsub_v1_ListTopicsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListTopicsResponse_descriptor, - new java.lang.String[] { - "Topics", "NextPageToken", - }); - internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListTopicSubscriptionsRequest_descriptor, - new java.lang.String[] { - "Topic", "PageSize", "PageToken", - }); - internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListTopicSubscriptionsResponse_descriptor, - new java.lang.String[] { - "Subscriptions", "NextPageToken", - }); - internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListTopicSnapshotsRequest_descriptor, - new java.lang.String[] { - "Topic", "PageSize", "PageToken", - }); - internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_descriptor = - getDescriptor().getMessageTypes().get(13); - internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListTopicSnapshotsResponse_descriptor, - new java.lang.String[] { - "Snapshots", "NextPageToken", - }); - internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor = - getDescriptor().getMessageTypes().get(14); - internal_static_google_pubsub_v1_DeleteTopicRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_DeleteTopicRequest_descriptor, - new java.lang.String[] { - "Topic", - }); - internal_static_google_pubsub_v1_DetachSubscriptionRequest_descriptor = - getDescriptor().getMessageTypes().get(15); - internal_static_google_pubsub_v1_DetachSubscriptionRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_DetachSubscriptionRequest_descriptor, - new java.lang.String[] { - "Subscription", - }); - internal_static_google_pubsub_v1_DetachSubscriptionResponse_descriptor = - 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(17); - internal_static_google_pubsub_v1_Subscription_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_Subscription_descriptor, - new java.lang.String[] { - "Name", - "Topic", - "PushConfig", - "BigqueryConfig", - "CloudStorageConfig", - "AckDeadlineSeconds", - "RetainAckedMessages", - "MessageRetentionDuration", - "Labels", - "EnableMessageOrdering", - "ExpirationPolicy", - "Filter", - "DeadLetterPolicy", - "RetryPolicy", - "Detached", - "EnableExactlyOnceDelivery", - "TopicMessageRetentionDuration", - "State", - }); - internal_static_google_pubsub_v1_Subscription_LabelsEntry_descriptor = - internal_static_google_pubsub_v1_Subscription_descriptor.getNestedTypes().get(0); - internal_static_google_pubsub_v1_Subscription_LabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_Subscription_LabelsEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_pubsub_v1_RetryPolicy_descriptor = - getDescriptor().getMessageTypes().get(18); - internal_static_google_pubsub_v1_RetryPolicy_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_RetryPolicy_descriptor, - new java.lang.String[] { - "MinimumBackoff", "MaximumBackoff", - }); - internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor = - getDescriptor().getMessageTypes().get(19); - internal_static_google_pubsub_v1_DeadLetterPolicy_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor, - new java.lang.String[] { - "DeadLetterTopic", "MaxDeliveryAttempts", - }); - internal_static_google_pubsub_v1_ExpirationPolicy_descriptor = - getDescriptor().getMessageTypes().get(20); - internal_static_google_pubsub_v1_ExpirationPolicy_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ExpirationPolicy_descriptor, - new java.lang.String[] { - "Ttl", - }); - internal_static_google_pubsub_v1_PushConfig_descriptor = - getDescriptor().getMessageTypes().get(21); - internal_static_google_pubsub_v1_PushConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PushConfig_descriptor, - new java.lang.String[] { - "PushEndpoint", - "Attributes", - "OidcToken", - "PubsubWrapper", - "NoWrapper", - "AuthenticationMethod", - "Wrapper", - }); - internal_static_google_pubsub_v1_PushConfig_OidcToken_descriptor = - internal_static_google_pubsub_v1_PushConfig_descriptor.getNestedTypes().get(0); - internal_static_google_pubsub_v1_PushConfig_OidcToken_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PushConfig_OidcToken_descriptor, - new java.lang.String[] { - "ServiceAccountEmail", "Audience", - }); - internal_static_google_pubsub_v1_PushConfig_PubsubWrapper_descriptor = - internal_static_google_pubsub_v1_PushConfig_descriptor.getNestedTypes().get(1); - internal_static_google_pubsub_v1_PushConfig_PubsubWrapper_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PushConfig_PubsubWrapper_descriptor, - new java.lang.String[] {}); - internal_static_google_pubsub_v1_PushConfig_NoWrapper_descriptor = - internal_static_google_pubsub_v1_PushConfig_descriptor.getNestedTypes().get(2); - internal_static_google_pubsub_v1_PushConfig_NoWrapper_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PushConfig_NoWrapper_descriptor, - new java.lang.String[] { - "WriteMetadata", - }); - internal_static_google_pubsub_v1_PushConfig_AttributesEntry_descriptor = - internal_static_google_pubsub_v1_PushConfig_descriptor.getNestedTypes().get(3); - internal_static_google_pubsub_v1_PushConfig_AttributesEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PushConfig_AttributesEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_pubsub_v1_BigQueryConfig_descriptor = - getDescriptor().getMessageTypes().get(22); - internal_static_google_pubsub_v1_BigQueryConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_BigQueryConfig_descriptor, - new java.lang.String[] { - "Table", - "UseTopicSchema", - "WriteMetadata", - "DropUnknownFields", - "State", - "UseTableSchema", - }); - internal_static_google_pubsub_v1_CloudStorageConfig_descriptor = - getDescriptor().getMessageTypes().get(23); - internal_static_google_pubsub_v1_CloudStorageConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_CloudStorageConfig_descriptor, - new java.lang.String[] { - "Bucket", - "FilenamePrefix", - "FilenameSuffix", - "TextConfig", - "AvroConfig", - "MaxDuration", - "MaxBytes", - "State", - "OutputFormat", - }); - internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_descriptor = - internal_static_google_pubsub_v1_CloudStorageConfig_descriptor.getNestedTypes().get(0); - internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_descriptor, - new java.lang.String[] {}); - internal_static_google_pubsub_v1_CloudStorageConfig_AvroConfig_descriptor = - internal_static_google_pubsub_v1_CloudStorageConfig_descriptor.getNestedTypes().get(1); - internal_static_google_pubsub_v1_CloudStorageConfig_AvroConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_CloudStorageConfig_AvroConfig_descriptor, - new java.lang.String[] { - "WriteMetadata", - }); - internal_static_google_pubsub_v1_ReceivedMessage_descriptor = - getDescriptor().getMessageTypes().get(24); - internal_static_google_pubsub_v1_ReceivedMessage_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ReceivedMessage_descriptor, - new java.lang.String[] { - "AckId", "Message", "DeliveryAttempt", - }); - internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor = - getDescriptor().getMessageTypes().get(25); - internal_static_google_pubsub_v1_GetSubscriptionRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor, - new java.lang.String[] { - "Subscription", - }); - internal_static_google_pubsub_v1_UpdateSubscriptionRequest_descriptor = - getDescriptor().getMessageTypes().get(26); - internal_static_google_pubsub_v1_UpdateSubscriptionRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_UpdateSubscriptionRequest_descriptor, - new java.lang.String[] { - "Subscription", "UpdateMask", - }); - internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor = - getDescriptor().getMessageTypes().get(27); - internal_static_google_pubsub_v1_ListSubscriptionsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor, - new java.lang.String[] { - "Project", "PageSize", "PageToken", - }); - internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor = - getDescriptor().getMessageTypes().get(28); - internal_static_google_pubsub_v1_ListSubscriptionsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor, - new java.lang.String[] { - "Subscriptions", "NextPageToken", - }); - internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor = - getDescriptor().getMessageTypes().get(29); - internal_static_google_pubsub_v1_DeleteSubscriptionRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor, - new java.lang.String[] { - "Subscription", - }); - internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor = - getDescriptor().getMessageTypes().get(30); - internal_static_google_pubsub_v1_ModifyPushConfigRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor, - new java.lang.String[] { - "Subscription", "PushConfig", - }); - internal_static_google_pubsub_v1_PullRequest_descriptor = - getDescriptor().getMessageTypes().get(31); - internal_static_google_pubsub_v1_PullRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PullRequest_descriptor, - new java.lang.String[] { - "Subscription", "ReturnImmediately", "MaxMessages", - }); - internal_static_google_pubsub_v1_PullResponse_descriptor = - getDescriptor().getMessageTypes().get(32); - internal_static_google_pubsub_v1_PullResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_PullResponse_descriptor, - new java.lang.String[] { - "ReceivedMessages", - }); - internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor = - getDescriptor().getMessageTypes().get(33); - internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor, - new java.lang.String[] { - "Subscription", "AckIds", "AckDeadlineSeconds", - }); - internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor = - getDescriptor().getMessageTypes().get(34); - internal_static_google_pubsub_v1_AcknowledgeRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor, - new java.lang.String[] { - "Subscription", "AckIds", - }); - internal_static_google_pubsub_v1_StreamingPullRequest_descriptor = - getDescriptor().getMessageTypes().get(35); - internal_static_google_pubsub_v1_StreamingPullRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_StreamingPullRequest_descriptor, - new java.lang.String[] { - "Subscription", - "AckIds", - "ModifyDeadlineSeconds", - "ModifyDeadlineAckIds", - "StreamAckDeadlineSeconds", - "ClientId", - "MaxOutstandingMessages", - "MaxOutstandingBytes", - }); - internal_static_google_pubsub_v1_StreamingPullResponse_descriptor = - getDescriptor().getMessageTypes().get(36); - internal_static_google_pubsub_v1_StreamingPullResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_StreamingPullResponse_descriptor, - new java.lang.String[] { - "ReceivedMessages", - "AcknowledgeConfirmation", - "ModifyAckDeadlineConfirmation", - "SubscriptionProperties", - }); - internal_static_google_pubsub_v1_StreamingPullResponse_AcknowledgeConfirmation_descriptor = - internal_static_google_pubsub_v1_StreamingPullResponse_descriptor.getNestedTypes().get(0); - internal_static_google_pubsub_v1_StreamingPullResponse_AcknowledgeConfirmation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_StreamingPullResponse_AcknowledgeConfirmation_descriptor, - new java.lang.String[] { - "AckIds", "InvalidAckIds", "UnorderedAckIds", "TemporaryFailedAckIds", - }); - internal_static_google_pubsub_v1_StreamingPullResponse_ModifyAckDeadlineConfirmation_descriptor = - internal_static_google_pubsub_v1_StreamingPullResponse_descriptor.getNestedTypes().get(1); - internal_static_google_pubsub_v1_StreamingPullResponse_ModifyAckDeadlineConfirmation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_StreamingPullResponse_ModifyAckDeadlineConfirmation_descriptor, - new java.lang.String[] { - "AckIds", "InvalidAckIds", "TemporaryFailedAckIds", - }); - internal_static_google_pubsub_v1_StreamingPullResponse_SubscriptionProperties_descriptor = - internal_static_google_pubsub_v1_StreamingPullResponse_descriptor.getNestedTypes().get(2); - internal_static_google_pubsub_v1_StreamingPullResponse_SubscriptionProperties_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_StreamingPullResponse_SubscriptionProperties_descriptor, - new java.lang.String[] { - "ExactlyOnceDeliveryEnabled", "MessageOrderingEnabled", - }); - internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor = - getDescriptor().getMessageTypes().get(37); - internal_static_google_pubsub_v1_CreateSnapshotRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor, - new java.lang.String[] { - "Name", "Subscription", "Labels", - }); - internal_static_google_pubsub_v1_CreateSnapshotRequest_LabelsEntry_descriptor = - internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor.getNestedTypes().get(0); - internal_static_google_pubsub_v1_CreateSnapshotRequest_LabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_CreateSnapshotRequest_LabelsEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_pubsub_v1_UpdateSnapshotRequest_descriptor = - getDescriptor().getMessageTypes().get(38); - internal_static_google_pubsub_v1_UpdateSnapshotRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_UpdateSnapshotRequest_descriptor, - new java.lang.String[] { - "Snapshot", "UpdateMask", - }); - internal_static_google_pubsub_v1_Snapshot_descriptor = - getDescriptor().getMessageTypes().get(39); - internal_static_google_pubsub_v1_Snapshot_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_Snapshot_descriptor, - new java.lang.String[] { - "Name", "Topic", "ExpireTime", "Labels", - }); - internal_static_google_pubsub_v1_Snapshot_LabelsEntry_descriptor = - internal_static_google_pubsub_v1_Snapshot_descriptor.getNestedTypes().get(0); - internal_static_google_pubsub_v1_Snapshot_LabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_Snapshot_LabelsEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_pubsub_v1_GetSnapshotRequest_descriptor = - getDescriptor().getMessageTypes().get(40); - internal_static_google_pubsub_v1_GetSnapshotRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_GetSnapshotRequest_descriptor, - new java.lang.String[] { - "Snapshot", - }); - internal_static_google_pubsub_v1_ListSnapshotsRequest_descriptor = - getDescriptor().getMessageTypes().get(41); - internal_static_google_pubsub_v1_ListSnapshotsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListSnapshotsRequest_descriptor, - new java.lang.String[] { - "Project", "PageSize", "PageToken", - }); - internal_static_google_pubsub_v1_ListSnapshotsResponse_descriptor = - getDescriptor().getMessageTypes().get(42); - internal_static_google_pubsub_v1_ListSnapshotsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListSnapshotsResponse_descriptor, - new java.lang.String[] { - "Snapshots", "NextPageToken", - }); - internal_static_google_pubsub_v1_DeleteSnapshotRequest_descriptor = - getDescriptor().getMessageTypes().get(43); - internal_static_google_pubsub_v1_DeleteSnapshotRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_DeleteSnapshotRequest_descriptor, - new java.lang.String[] { - "Snapshot", - }); - internal_static_google_pubsub_v1_SeekRequest_descriptor = - getDescriptor().getMessageTypes().get(44); - internal_static_google_pubsub_v1_SeekRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_SeekRequest_descriptor, - new java.lang.String[] { - "Subscription", "Time", "Snapshot", "Target", - }); - internal_static_google_pubsub_v1_SeekResponse_descriptor = - getDescriptor().getMessageTypes().get(45); - internal_static_google_pubsub_v1_SeekResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_SeekResponse_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.DurationProto.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/PullRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullRequest.java deleted file mode 100644 index 30c5431b8..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullRequest.java +++ /dev/null @@ -1,876 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `Pull` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.PullRequest} - */ -public final class PullRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.PullRequest) - PullRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use PullRequest.newBuilder() to construct. - private PullRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PullRequest() { - subscription_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PullRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PullRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PullRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PullRequest.class, com.google.pubsub.v1.PullRequest.Builder.class); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object subscription_ = ""; - /** - * - * - *
-   * Required. The subscription from which messages should be pulled.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - @java.lang.Override - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - 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(); - subscription_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The subscription from which messages should be pulled.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RETURN_IMMEDIATELY_FIELD_NUMBER = 2; - private boolean returnImmediately_ = false; - /** - * - * - *
-   * Optional. If this field set to true, the system will respond immediately
-   * even if it there are no messages available to return in the `Pull`
-   * response. Otherwise, the system may wait (for a bounded amount of time)
-   * until at least one message is available, rather than returning no messages.
-   * Warning: setting this field to `true` is discouraged because it adversely
-   * impacts the performance of `Pull` operations. We recommend that users do
-   * not set this field.
-   * 
- * - * bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.PullRequest.return_immediately is deprecated. See - * google/pubsub/v1/pubsub.proto;l=1233 - * @return The returnImmediately. - */ - @java.lang.Override - @java.lang.Deprecated - public boolean getReturnImmediately() { - return returnImmediately_; - } - - public static final int MAX_MESSAGES_FIELD_NUMBER = 3; - private int maxMessages_ = 0; - /** - * - * - *
-   * Required. The maximum number of messages to return for this request. Must
-   * be a positive integer. The Pub/Sub system may return fewer than the number
-   * specified.
-   * 
- * - * int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The maxMessages. - */ - @java.lang.Override - public int getMaxMessages() { - return maxMessages_; - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); - } - if (returnImmediately_ != false) { - output.writeBool(2, returnImmediately_); - } - if (maxMessages_ != 0) { - output.writeInt32(3, maxMessages_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_); - } - if (returnImmediately_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, returnImmediately_); - } - if (maxMessages_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxMessages_); - } - size += getUnknownFields().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.PullRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.PullRequest other = (com.google.pubsub.v1.PullRequest) obj; - - if (!getSubscription().equals(other.getSubscription())) return false; - if (getReturnImmediately() != other.getReturnImmediately()) return false; - if (getMaxMessages() != other.getMaxMessages()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - hash = (37 * hash) + RETURN_IMMEDIATELY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReturnImmediately()); - hash = (37 * hash) + MAX_MESSAGES_FIELD_NUMBER; - hash = (53 * hash) + getMaxMessages(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.PullRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PullRequest 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.PullRequest parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PullRequest 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.PullRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PullRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.PullRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PullRequest 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.PullRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PullRequest 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.PullRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PullRequest 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.PullRequest 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 `Pull` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.PullRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PullRequest) - com.google.pubsub.v1.PullRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PullRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PullRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PullRequest.class, - com.google.pubsub.v1.PullRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.PullRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscription_ = ""; - returnImmediately_ = false; - maxMessages_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PullRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.PullRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.PullRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.PullRequest build() { - com.google.pubsub.v1.PullRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.PullRequest buildPartial() { - com.google.pubsub.v1.PullRequest result = new com.google.pubsub.v1.PullRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.PullRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.subscription_ = subscription_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.returnImmediately_ = returnImmediately_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.maxMessages_ = maxMessages_; - } - } - - @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.PullRequest) { - return mergeFrom((com.google.pubsub.v1.PullRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.PullRequest other) { - if (other == com.google.pubsub.v1.PullRequest.getDefaultInstance()) return this; - if (!other.getSubscription().isEmpty()) { - subscription_ = other.subscription_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getReturnImmediately() != false) { - setReturnImmediately(other.getReturnImmediately()); - } - if (other.getMaxMessages() != 0) { - setMaxMessages(other.getMaxMessages()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - subscription_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - returnImmediately_ = input.readBool(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: - { - maxMessages_ = input.readInt32(); - bitField0_ |= 0x00000004; - break; - } // case 24 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object subscription_ = ""; - /** - * - * - *
-     * Required. The subscription from which messages should be pulled.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The subscription from which messages should be pulled.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The subscription from which messages should be pulled.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription from which messages should be pulled.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSubscription() { - subscription_ = getDefaultInstance().getSubscription(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription from which messages should be pulled.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private boolean returnImmediately_; - /** - * - * - *
-     * Optional. If this field set to true, the system will respond immediately
-     * even if it there are no messages available to return in the `Pull`
-     * response. Otherwise, the system may wait (for a bounded amount of time)
-     * until at least one message is available, rather than returning no messages.
-     * Warning: setting this field to `true` is discouraged because it adversely
-     * impacts the performance of `Pull` operations. We recommend that users do
-     * not set this field.
-     * 
- * - * - * bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.PullRequest.return_immediately is deprecated. See - * google/pubsub/v1/pubsub.proto;l=1233 - * @return The returnImmediately. - */ - @java.lang.Override - @java.lang.Deprecated - public boolean getReturnImmediately() { - return returnImmediately_; - } - /** - * - * - *
-     * Optional. If this field set to true, the system will respond immediately
-     * even if it there are no messages available to return in the `Pull`
-     * response. Otherwise, the system may wait (for a bounded amount of time)
-     * until at least one message is available, rather than returning no messages.
-     * Warning: setting this field to `true` is discouraged because it adversely
-     * impacts the performance of `Pull` operations. We recommend that users do
-     * not set this field.
-     * 
- * - * - * bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.PullRequest.return_immediately is deprecated. See - * google/pubsub/v1/pubsub.proto;l=1233 - * @param value The returnImmediately to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder setReturnImmediately(boolean value) { - - returnImmediately_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. If this field set to true, the system will respond immediately
-     * even if it there are no messages available to return in the `Pull`
-     * response. Otherwise, the system may wait (for a bounded amount of time)
-     * until at least one message is available, rather than returning no messages.
-     * Warning: setting this field to `true` is discouraged because it adversely
-     * impacts the performance of `Pull` operations. We recommend that users do
-     * not set this field.
-     * 
- * - * - * bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.PullRequest.return_immediately is deprecated. See - * google/pubsub/v1/pubsub.proto;l=1233 - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder clearReturnImmediately() { - bitField0_ = (bitField0_ & ~0x00000002); - returnImmediately_ = false; - onChanged(); - return this; - } - - private int maxMessages_; - /** - * - * - *
-     * Required. The maximum number of messages to return for this request. Must
-     * be a positive integer. The Pub/Sub system may return fewer than the number
-     * specified.
-     * 
- * - * int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The maxMessages. - */ - @java.lang.Override - public int getMaxMessages() { - return maxMessages_; - } - /** - * - * - *
-     * Required. The maximum number of messages to return for this request. Must
-     * be a positive integer. The Pub/Sub system may return fewer than the number
-     * specified.
-     * 
- * - * int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The maxMessages to set. - * @return This builder for chaining. - */ - public Builder setMaxMessages(int value) { - - maxMessages_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The maximum number of messages to return for this request. Must
-     * be a positive integer. The Pub/Sub system may return fewer than the number
-     * specified.
-     * 
- * - * int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearMaxMessages() { - bitField0_ = (bitField0_ & ~0x00000004); - maxMessages_ = 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.PullRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.PullRequest) - private static final com.google.pubsub.v1.PullRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.PullRequest(); - } - - public static com.google.pubsub.v1.PullRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PullRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.PullRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullRequestOrBuilder.java deleted file mode 100644 index 9f9ccf387..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullRequestOrBuilder.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2023 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 PullRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PullRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The subscription from which messages should be pulled.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - java.lang.String getSubscription(); - /** - * - * - *
-   * Required. The subscription from which messages should be pulled.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - com.google.protobuf.ByteString getSubscriptionBytes(); - - /** - * - * - *
-   * Optional. If this field set to true, the system will respond immediately
-   * even if it there are no messages available to return in the `Pull`
-   * response. Otherwise, the system may wait (for a bounded amount of time)
-   * until at least one message is available, rather than returning no messages.
-   * Warning: setting this field to `true` is discouraged because it adversely
-   * impacts the performance of `Pull` operations. We recommend that users do
-   * not set this field.
-   * 
- * - * bool return_immediately = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; - * - * - * @deprecated google.pubsub.v1.PullRequest.return_immediately is deprecated. See - * google/pubsub/v1/pubsub.proto;l=1233 - * @return The returnImmediately. - */ - @java.lang.Deprecated - boolean getReturnImmediately(); - - /** - * - * - *
-   * Required. The maximum number of messages to return for this request. Must
-   * be a positive integer. The Pub/Sub system may return fewer than the number
-   * specified.
-   * 
- * - * int32 max_messages = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The maxMessages. - */ - int getMaxMessages(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullResponse.java deleted file mode 100644 index 65b827fd0..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullResponse.java +++ /dev/null @@ -1,1027 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Response for the `Pull` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.PullResponse} - */ -public final class PullResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.PullResponse) - PullResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use PullResponse.newBuilder() to construct. - private PullResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PullResponse() { - receivedMessages_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PullResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PullResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PullResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PullResponse.class, - com.google.pubsub.v1.PullResponse.Builder.class); - } - - public static final int RECEIVED_MESSAGES_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private java.util.List receivedMessages_; - /** - * - * - *
-   * Received Pub/Sub messages. The list will be empty if there are no more
-   * messages available in the backlog, or if no messages could be returned
-   * before the request timeout. For JSON, the response can be entirely
-   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-   * even if there are more messages available in the backlog.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - @java.lang.Override - public java.util.List getReceivedMessagesList() { - return receivedMessages_; - } - /** - * - * - *
-   * Received Pub/Sub messages. The list will be empty if there are no more
-   * messages available in the backlog, or if no messages could be returned
-   * before the request timeout. For JSON, the response can be entirely
-   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-   * even if there are more messages available in the backlog.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - @java.lang.Override - public java.util.List - getReceivedMessagesOrBuilderList() { - return receivedMessages_; - } - /** - * - * - *
-   * Received Pub/Sub messages. The list will be empty if there are no more
-   * messages available in the backlog, or if no messages could be returned
-   * before the request timeout. For JSON, the response can be entirely
-   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-   * even if there are more messages available in the backlog.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - @java.lang.Override - public int getReceivedMessagesCount() { - return receivedMessages_.size(); - } - /** - * - * - *
-   * Received Pub/Sub messages. The list will be empty if there are no more
-   * messages available in the backlog, or if no messages could be returned
-   * before the request timeout. For JSON, the response can be entirely
-   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-   * even if there are more messages available in the backlog.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.ReceivedMessage getReceivedMessages(int index) { - return receivedMessages_.get(index); - } - /** - * - * - *
-   * Received Pub/Sub messages. The list will be empty if there are no more
-   * messages available in the backlog, or if no messages could be returned
-   * before the request timeout. For JSON, the response can be entirely
-   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-   * even if there are more messages available in the backlog.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.ReceivedMessageOrBuilder getReceivedMessagesOrBuilder(int index) { - return receivedMessages_.get(index); - } - - 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 < receivedMessages_.size(); i++) { - output.writeMessage(1, receivedMessages_.get(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < receivedMessages_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, receivedMessages_.get(i)); - } - size += getUnknownFields().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.PullResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.PullResponse other = (com.google.pubsub.v1.PullResponse) obj; - - if (!getReceivedMessagesList().equals(other.getReceivedMessagesList())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getReceivedMessagesCount() > 0) { - hash = (37 * hash) + RECEIVED_MESSAGES_FIELD_NUMBER; - hash = (53 * hash) + getReceivedMessagesList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.PullResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PullResponse 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.PullResponse parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PullResponse 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.PullResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PullResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.PullResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PullResponse 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.PullResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PullResponse 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.PullResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PullResponse 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.PullResponse 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 `Pull` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.PullResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PullResponse) - com.google.pubsub.v1.PullResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PullResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PullResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PullResponse.class, - com.google.pubsub.v1.PullResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.PullResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (receivedMessagesBuilder_ == null) { - receivedMessages_ = java.util.Collections.emptyList(); - } else { - receivedMessages_ = null; - receivedMessagesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PullResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.PullResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.PullResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.PullResponse build() { - com.google.pubsub.v1.PullResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.PullResponse buildPartial() { - com.google.pubsub.v1.PullResponse result = new com.google.pubsub.v1.PullResponse(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(com.google.pubsub.v1.PullResponse result) { - if (receivedMessagesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - receivedMessages_ = java.util.Collections.unmodifiableList(receivedMessages_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.receivedMessages_ = receivedMessages_; - } else { - result.receivedMessages_ = receivedMessagesBuilder_.build(); - } - } - - private void buildPartial0(com.google.pubsub.v1.PullResponse result) { - int from_bitField0_ = bitField0_; - } - - @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.PullResponse) { - return mergeFrom((com.google.pubsub.v1.PullResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.PullResponse other) { - if (other == com.google.pubsub.v1.PullResponse.getDefaultInstance()) return this; - if (receivedMessagesBuilder_ == null) { - if (!other.receivedMessages_.isEmpty()) { - if (receivedMessages_.isEmpty()) { - receivedMessages_ = other.receivedMessages_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureReceivedMessagesIsMutable(); - receivedMessages_.addAll(other.receivedMessages_); - } - onChanged(); - } - } else { - if (!other.receivedMessages_.isEmpty()) { - if (receivedMessagesBuilder_.isEmpty()) { - receivedMessagesBuilder_.dispose(); - receivedMessagesBuilder_ = null; - receivedMessages_ = other.receivedMessages_; - bitField0_ = (bitField0_ & ~0x00000001); - receivedMessagesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getReceivedMessagesFieldBuilder() - : null; - } else { - receivedMessagesBuilder_.addAllMessages(other.receivedMessages_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.pubsub.v1.ReceivedMessage m = - input.readMessage( - com.google.pubsub.v1.ReceivedMessage.parser(), extensionRegistry); - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - receivedMessages_.add(m); - } else { - receivedMessagesBuilder_.addMessage(m); - } - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List receivedMessages_ = - java.util.Collections.emptyList(); - - private void ensureReceivedMessagesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - receivedMessages_ = - new java.util.ArrayList(receivedMessages_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.ReceivedMessage, - com.google.pubsub.v1.ReceivedMessage.Builder, - com.google.pubsub.v1.ReceivedMessageOrBuilder> - receivedMessagesBuilder_; - - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public java.util.List getReceivedMessagesList() { - if (receivedMessagesBuilder_ == null) { - return java.util.Collections.unmodifiableList(receivedMessages_); - } else { - return receivedMessagesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public int getReceivedMessagesCount() { - if (receivedMessagesBuilder_ == null) { - return receivedMessages_.size(); - } else { - return receivedMessagesBuilder_.getCount(); - } - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public com.google.pubsub.v1.ReceivedMessage getReceivedMessages(int index) { - if (receivedMessagesBuilder_ == null) { - return receivedMessages_.get(index); - } else { - return receivedMessagesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder setReceivedMessages(int index, com.google.pubsub.v1.ReceivedMessage value) { - if (receivedMessagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReceivedMessagesIsMutable(); - receivedMessages_.set(index, value); - onChanged(); - } else { - receivedMessagesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder setReceivedMessages( - int index, com.google.pubsub.v1.ReceivedMessage.Builder builderForValue) { - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - receivedMessages_.set(index, builderForValue.build()); - onChanged(); - } else { - receivedMessagesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder addReceivedMessages(com.google.pubsub.v1.ReceivedMessage value) { - if (receivedMessagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReceivedMessagesIsMutable(); - receivedMessages_.add(value); - onChanged(); - } else { - receivedMessagesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder addReceivedMessages(int index, com.google.pubsub.v1.ReceivedMessage value) { - if (receivedMessagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReceivedMessagesIsMutable(); - receivedMessages_.add(index, value); - onChanged(); - } else { - receivedMessagesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder addReceivedMessages( - com.google.pubsub.v1.ReceivedMessage.Builder builderForValue) { - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - receivedMessages_.add(builderForValue.build()); - onChanged(); - } else { - receivedMessagesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder addReceivedMessages( - int index, com.google.pubsub.v1.ReceivedMessage.Builder builderForValue) { - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - receivedMessages_.add(index, builderForValue.build()); - onChanged(); - } else { - receivedMessagesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder addAllReceivedMessages( - java.lang.Iterable values) { - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, receivedMessages_); - onChanged(); - } else { - receivedMessagesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder clearReceivedMessages() { - if (receivedMessagesBuilder_ == null) { - receivedMessages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - receivedMessagesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder removeReceivedMessages(int index) { - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - receivedMessages_.remove(index); - onChanged(); - } else { - receivedMessagesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public com.google.pubsub.v1.ReceivedMessage.Builder getReceivedMessagesBuilder(int index) { - return getReceivedMessagesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public com.google.pubsub.v1.ReceivedMessageOrBuilder getReceivedMessagesOrBuilder(int index) { - if (receivedMessagesBuilder_ == null) { - return receivedMessages_.get(index); - } else { - return receivedMessagesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public java.util.List - getReceivedMessagesOrBuilderList() { - if (receivedMessagesBuilder_ != null) { - return receivedMessagesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(receivedMessages_); - } - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public com.google.pubsub.v1.ReceivedMessage.Builder addReceivedMessagesBuilder() { - return getReceivedMessagesFieldBuilder() - .addBuilder(com.google.pubsub.v1.ReceivedMessage.getDefaultInstance()); - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public com.google.pubsub.v1.ReceivedMessage.Builder addReceivedMessagesBuilder(int index) { - return getReceivedMessagesFieldBuilder() - .addBuilder(index, com.google.pubsub.v1.ReceivedMessage.getDefaultInstance()); - } - /** - * - * - *
-     * Received Pub/Sub messages. The list will be empty if there are no more
-     * messages available in the backlog, or if no messages could be returned
-     * before the request timeout. For JSON, the response can be entirely
-     * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-     * even if there are more messages available in the backlog.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public java.util.List - getReceivedMessagesBuilderList() { - return getReceivedMessagesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.ReceivedMessage, - com.google.pubsub.v1.ReceivedMessage.Builder, - com.google.pubsub.v1.ReceivedMessageOrBuilder> - getReceivedMessagesFieldBuilder() { - if (receivedMessagesBuilder_ == null) { - receivedMessagesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.ReceivedMessage, - com.google.pubsub.v1.ReceivedMessage.Builder, - com.google.pubsub.v1.ReceivedMessageOrBuilder>( - receivedMessages_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - receivedMessages_ = null; - } - return receivedMessagesBuilder_; - } - - @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.PullResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.PullResponse) - private static final com.google.pubsub.v1.PullResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.PullResponse(); - } - - public static com.google.pubsub.v1.PullResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PullResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.PullResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullResponseOrBuilder.java deleted file mode 100644 index 16d1f7e5a..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullResponseOrBuilder.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2023 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 PullResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PullResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Received Pub/Sub messages. The list will be empty if there are no more
-   * messages available in the backlog, or if no messages could be returned
-   * before the request timeout. For JSON, the response can be entirely
-   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-   * even if there are more messages available in the backlog.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - java.util.List getReceivedMessagesList(); - /** - * - * - *
-   * Received Pub/Sub messages. The list will be empty if there are no more
-   * messages available in the backlog, or if no messages could be returned
-   * before the request timeout. For JSON, the response can be entirely
-   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-   * even if there are more messages available in the backlog.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - com.google.pubsub.v1.ReceivedMessage getReceivedMessages(int index); - /** - * - * - *
-   * Received Pub/Sub messages. The list will be empty if there are no more
-   * messages available in the backlog, or if no messages could be returned
-   * before the request timeout. For JSON, the response can be entirely
-   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-   * even if there are more messages available in the backlog.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - int getReceivedMessagesCount(); - /** - * - * - *
-   * Received Pub/Sub messages. The list will be empty if there are no more
-   * messages available in the backlog, or if no messages could be returned
-   * before the request timeout. For JSON, the response can be entirely
-   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-   * even if there are more messages available in the backlog.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - java.util.List - getReceivedMessagesOrBuilderList(); - /** - * - * - *
-   * Received Pub/Sub messages. The list will be empty if there are no more
-   * messages available in the backlog, or if no messages could be returned
-   * before the request timeout. For JSON, the response can be entirely
-   * empty. The Pub/Sub system may return fewer than the `maxMessages` requested
-   * even if there are more messages available in the backlog.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - com.google.pubsub.v1.ReceivedMessageOrBuilder getReceivedMessagesOrBuilder(int index); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java deleted file mode 100644 index 7124ca38f..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java +++ /dev/null @@ -1,4161 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Configuration for a push delivery endpoint.
- * 
- * - * Protobuf type {@code google.pubsub.v1.PushConfig} - */ -public final class PushConfig extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.PushConfig) - PushConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use PushConfig.newBuilder() to construct. - private PushConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PushConfig() { - pushEndpoint_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PushConfig(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_PushConfig_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PushConfig.class, com.google.pubsub.v1.PushConfig.Builder.class); - } - - public interface OidcTokenOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PushConfig.OidcToken) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * [Service account
-     * email](https://cloud.google.com/iam/docs/service-accounts)
-     * used for generating the OIDC token. For more information
-     * on setting up authentication, see
-     * [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
-     * 
- * - * string service_account_email = 1; - * - * @return The serviceAccountEmail. - */ - java.lang.String getServiceAccountEmail(); - /** - * - * - *
-     * [Service account
-     * email](https://cloud.google.com/iam/docs/service-accounts)
-     * used for generating the OIDC token. For more information
-     * on setting up authentication, see
-     * [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
-     * 
- * - * string service_account_email = 1; - * - * @return The bytes for serviceAccountEmail. - */ - com.google.protobuf.ByteString getServiceAccountEmailBytes(); - - /** - * - * - *
-     * Audience to be used when generating OIDC token. The audience claim
-     * identifies the recipients that the JWT is intended for. The audience
-     * value is a single case-sensitive string. Having multiple values (array)
-     * for the audience field is not supported. More info about the OIDC JWT
-     * token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
-     * Note: if not specified, the Push endpoint URL will be used.
-     * 
- * - * string audience = 2; - * - * @return The audience. - */ - java.lang.String getAudience(); - /** - * - * - *
-     * Audience to be used when generating OIDC token. The audience claim
-     * identifies the recipients that the JWT is intended for. The audience
-     * value is a single case-sensitive string. Having multiple values (array)
-     * for the audience field is not supported. More info about the OIDC JWT
-     * token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
-     * Note: if not specified, the Push endpoint URL will be used.
-     * 
- * - * string audience = 2; - * - * @return The bytes for audience. - */ - com.google.protobuf.ByteString getAudienceBytes(); - } - /** - * - * - *
-   * Contains information needed for generating an
-   * [OpenID Connect
-   * token](https://developers.google.com/identity/protocols/OpenIDConnect).
-   * 
- * - * Protobuf type {@code google.pubsub.v1.PushConfig.OidcToken} - */ - public static final class OidcToken extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.PushConfig.OidcToken) - OidcTokenOrBuilder { - private static final long serialVersionUID = 0L; - // Use OidcToken.newBuilder() to construct. - private OidcToken(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private OidcToken() { - serviceAccountEmail_ = ""; - audience_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new OidcToken(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_OidcToken_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_OidcToken_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PushConfig.OidcToken.class, - com.google.pubsub.v1.PushConfig.OidcToken.Builder.class); - } - - public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object serviceAccountEmail_ = ""; - /** - * - * - *
-     * [Service account
-     * email](https://cloud.google.com/iam/docs/service-accounts)
-     * used for generating the OIDC token. For more information
-     * on setting up authentication, see
-     * [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
-     * 
- * - * string service_account_email = 1; - * - * @return The serviceAccountEmail. - */ - @java.lang.Override - public java.lang.String getServiceAccountEmail() { - java.lang.Object ref = serviceAccountEmail_; - 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(); - serviceAccountEmail_ = s; - return s; - } - } - /** - * - * - *
-     * [Service account
-     * email](https://cloud.google.com/iam/docs/service-accounts)
-     * used for generating the OIDC token. For more information
-     * on setting up authentication, see
-     * [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
-     * 
- * - * string service_account_email = 1; - * - * @return The bytes for serviceAccountEmail. - */ - @java.lang.Override - public com.google.protobuf.ByteString getServiceAccountEmailBytes() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - serviceAccountEmail_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int AUDIENCE_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object audience_ = ""; - /** - * - * - *
-     * Audience to be used when generating OIDC token. The audience claim
-     * identifies the recipients that the JWT is intended for. The audience
-     * value is a single case-sensitive string. Having multiple values (array)
-     * for the audience field is not supported. More info about the OIDC JWT
-     * token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
-     * Note: if not specified, the Push endpoint URL will be used.
-     * 
- * - * string audience = 2; - * - * @return The audience. - */ - @java.lang.Override - public java.lang.String getAudience() { - java.lang.Object ref = audience_; - 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(); - audience_ = s; - return s; - } - } - /** - * - * - *
-     * Audience to be used when generating OIDC token. The audience claim
-     * identifies the recipients that the JWT is intended for. The audience
-     * value is a single case-sensitive string. Having multiple values (array)
-     * for the audience field is not supported. More info about the OIDC JWT
-     * token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
-     * Note: if not specified, the Push endpoint URL will be used.
-     * 
- * - * string audience = 2; - * - * @return The bytes for audience. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAudienceBytes() { - java.lang.Object ref = audience_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - audience_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, serviceAccountEmail_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audience_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audience_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, serviceAccountEmail_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audience_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audience_); - } - size += getUnknownFields().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.PushConfig.OidcToken)) { - return super.equals(obj); - } - com.google.pubsub.v1.PushConfig.OidcToken other = - (com.google.pubsub.v1.PushConfig.OidcToken) obj; - - if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; - if (!getAudience().equals(other.getAudience())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; - hash = (53 * hash) + getServiceAccountEmail().hashCode(); - hash = (37 * hash) + AUDIENCE_FIELD_NUMBER; - hash = (53 * hash) + getAudience().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.PushConfig.OidcToken parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig.OidcToken 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.PushConfig.OidcToken parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig.OidcToken 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.PushConfig.OidcToken parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig.OidcToken parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.PushConfig.OidcToken parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig.OidcToken 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.PushConfig.OidcToken parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig.OidcToken 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.PushConfig.OidcToken parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig.OidcToken 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.PushConfig.OidcToken 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; - } - /** - * - * - *
-     * Contains information needed for generating an
-     * [OpenID Connect
-     * token](https://developers.google.com/identity/protocols/OpenIDConnect).
-     * 
- * - * Protobuf type {@code google.pubsub.v1.PushConfig.OidcToken} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PushConfig.OidcToken) - com.google.pubsub.v1.PushConfig.OidcTokenOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_OidcToken_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_OidcToken_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PushConfig.OidcToken.class, - com.google.pubsub.v1.PushConfig.OidcToken.Builder.class); - } - - // Construct using com.google.pubsub.v1.PushConfig.OidcToken.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - serviceAccountEmail_ = ""; - audience_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_OidcToken_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig.OidcToken getDefaultInstanceForType() { - return com.google.pubsub.v1.PushConfig.OidcToken.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig.OidcToken build() { - com.google.pubsub.v1.PushConfig.OidcToken result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig.OidcToken buildPartial() { - com.google.pubsub.v1.PushConfig.OidcToken result = - new com.google.pubsub.v1.PushConfig.OidcToken(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.PushConfig.OidcToken result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.serviceAccountEmail_ = serviceAccountEmail_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.audience_ = audience_; - } - } - - @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.PushConfig.OidcToken) { - return mergeFrom((com.google.pubsub.v1.PushConfig.OidcToken) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.PushConfig.OidcToken other) { - if (other == com.google.pubsub.v1.PushConfig.OidcToken.getDefaultInstance()) return this; - if (!other.getServiceAccountEmail().isEmpty()) { - serviceAccountEmail_ = other.serviceAccountEmail_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getAudience().isEmpty()) { - audience_ = other.audience_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - serviceAccountEmail_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - audience_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object serviceAccountEmail_ = ""; - /** - * - * - *
-       * [Service account
-       * email](https://cloud.google.com/iam/docs/service-accounts)
-       * used for generating the OIDC token. For more information
-       * on setting up authentication, see
-       * [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
-       * 
- * - * string service_account_email = 1; - * - * @return The serviceAccountEmail. - */ - public java.lang.String getServiceAccountEmail() { - java.lang.Object ref = serviceAccountEmail_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serviceAccountEmail_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * [Service account
-       * email](https://cloud.google.com/iam/docs/service-accounts)
-       * used for generating the OIDC token. For more information
-       * on setting up authentication, see
-       * [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
-       * 
- * - * string service_account_email = 1; - * - * @return The bytes for serviceAccountEmail. - */ - public com.google.protobuf.ByteString getServiceAccountEmailBytes() { - java.lang.Object ref = serviceAccountEmail_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - serviceAccountEmail_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * [Service account
-       * email](https://cloud.google.com/iam/docs/service-accounts)
-       * used for generating the OIDC token. For more information
-       * on setting up authentication, see
-       * [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
-       * 
- * - * string service_account_email = 1; - * - * @param value The serviceAccountEmail to set. - * @return This builder for chaining. - */ - public Builder setServiceAccountEmail(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - serviceAccountEmail_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * [Service account
-       * email](https://cloud.google.com/iam/docs/service-accounts)
-       * used for generating the OIDC token. For more information
-       * on setting up authentication, see
-       * [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
-       * 
- * - * string service_account_email = 1; - * - * @return This builder for chaining. - */ - public Builder clearServiceAccountEmail() { - serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-       * [Service account
-       * email](https://cloud.google.com/iam/docs/service-accounts)
-       * used for generating the OIDC token. For more information
-       * on setting up authentication, see
-       * [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
-       * 
- * - * string service_account_email = 1; - * - * @param value The bytes for serviceAccountEmail to set. - * @return This builder for chaining. - */ - public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - serviceAccountEmail_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object audience_ = ""; - /** - * - * - *
-       * Audience to be used when generating OIDC token. The audience claim
-       * identifies the recipients that the JWT is intended for. The audience
-       * value is a single case-sensitive string. Having multiple values (array)
-       * for the audience field is not supported. More info about the OIDC JWT
-       * token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
-       * Note: if not specified, the Push endpoint URL will be used.
-       * 
- * - * string audience = 2; - * - * @return The audience. - */ - public java.lang.String getAudience() { - java.lang.Object ref = audience_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - audience_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Audience to be used when generating OIDC token. The audience claim
-       * identifies the recipients that the JWT is intended for. The audience
-       * value is a single case-sensitive string. Having multiple values (array)
-       * for the audience field is not supported. More info about the OIDC JWT
-       * token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
-       * Note: if not specified, the Push endpoint URL will be used.
-       * 
- * - * string audience = 2; - * - * @return The bytes for audience. - */ - public com.google.protobuf.ByteString getAudienceBytes() { - java.lang.Object ref = audience_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - audience_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Audience to be used when generating OIDC token. The audience claim
-       * identifies the recipients that the JWT is intended for. The audience
-       * value is a single case-sensitive string. Having multiple values (array)
-       * for the audience field is not supported. More info about the OIDC JWT
-       * token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
-       * Note: if not specified, the Push endpoint URL will be used.
-       * 
- * - * string audience = 2; - * - * @param value The audience to set. - * @return This builder for chaining. - */ - public Builder setAudience(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - audience_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-       * Audience to be used when generating OIDC token. The audience claim
-       * identifies the recipients that the JWT is intended for. The audience
-       * value is a single case-sensitive string. Having multiple values (array)
-       * for the audience field is not supported. More info about the OIDC JWT
-       * token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
-       * Note: if not specified, the Push endpoint URL will be used.
-       * 
- * - * string audience = 2; - * - * @return This builder for chaining. - */ - public Builder clearAudience() { - audience_ = getDefaultInstance().getAudience(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-       * Audience to be used when generating OIDC token. The audience claim
-       * identifies the recipients that the JWT is intended for. The audience
-       * value is a single case-sensitive string. Having multiple values (array)
-       * for the audience field is not supported. More info about the OIDC JWT
-       * token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
-       * Note: if not specified, the Push endpoint URL will be used.
-       * 
- * - * string audience = 2; - * - * @param value The bytes for audience to set. - * @return This builder for chaining. - */ - public Builder setAudienceBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - audience_ = value; - bitField0_ |= 0x00000002; - 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.PushConfig.OidcToken) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.PushConfig.OidcToken) - private static final com.google.pubsub.v1.PushConfig.OidcToken DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.PushConfig.OidcToken(); - } - - public static com.google.pubsub.v1.PushConfig.OidcToken getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OidcToken parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.PushConfig.OidcToken getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface PubsubWrapperOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PushConfig.PubsubWrapper) - com.google.protobuf.MessageOrBuilder {} - /** - * - * - *
-   * The payload to the push endpoint is in the form of the JSON representation
-   * of a PubsubMessage
-   * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-   * 
- * - * Protobuf type {@code google.pubsub.v1.PushConfig.PubsubWrapper} - */ - public static final class PubsubWrapper extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.PushConfig.PubsubWrapper) - PubsubWrapperOrBuilder { - private static final long serialVersionUID = 0L; - // Use PubsubWrapper.newBuilder() to construct. - private PubsubWrapper(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PubsubWrapper() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PubsubWrapper(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_PubsubWrapper_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_PubsubWrapper_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PushConfig.PubsubWrapper.class, - com.google.pubsub.v1.PushConfig.PubsubWrapper.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 { - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += getUnknownFields().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.PushConfig.PubsubWrapper)) { - return super.equals(obj); - } - com.google.pubsub.v1.PushConfig.PubsubWrapper other = - (com.google.pubsub.v1.PushConfig.PubsubWrapper) obj; - - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.PushConfig.PubsubWrapper parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig.PubsubWrapper 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.PushConfig.PubsubWrapper parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig.PubsubWrapper 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.PushConfig.PubsubWrapper parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig.PubsubWrapper parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.PushConfig.PubsubWrapper parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig.PubsubWrapper 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.PushConfig.PubsubWrapper parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig.PubsubWrapper 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.PushConfig.PubsubWrapper parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig.PubsubWrapper 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.PushConfig.PubsubWrapper 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; - } - /** - * - * - *
-     * The payload to the push endpoint is in the form of the JSON representation
-     * of a PubsubMessage
-     * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-     * 
- * - * Protobuf type {@code google.pubsub.v1.PushConfig.PubsubWrapper} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PushConfig.PubsubWrapper) - com.google.pubsub.v1.PushConfig.PubsubWrapperOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_PubsubWrapper_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_PubsubWrapper_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PushConfig.PubsubWrapper.class, - com.google.pubsub.v1.PushConfig.PubsubWrapper.Builder.class); - } - - // Construct using com.google.pubsub.v1.PushConfig.PubsubWrapper.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @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.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_PubsubWrapper_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig.PubsubWrapper getDefaultInstanceForType() { - return com.google.pubsub.v1.PushConfig.PubsubWrapper.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig.PubsubWrapper build() { - com.google.pubsub.v1.PushConfig.PubsubWrapper result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig.PubsubWrapper buildPartial() { - com.google.pubsub.v1.PushConfig.PubsubWrapper result = - new com.google.pubsub.v1.PushConfig.PubsubWrapper(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.PushConfig.PubsubWrapper) { - return mergeFrom((com.google.pubsub.v1.PushConfig.PubsubWrapper) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.PushConfig.PubsubWrapper other) { - if (other == com.google.pubsub.v1.PushConfig.PubsubWrapper.getDefaultInstance()) - return this; - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - 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.PushConfig.PubsubWrapper) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.PushConfig.PubsubWrapper) - private static final com.google.pubsub.v1.PushConfig.PubsubWrapper DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.PushConfig.PubsubWrapper(); - } - - public static com.google.pubsub.v1.PushConfig.PubsubWrapper getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PubsubWrapper parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.PushConfig.PubsubWrapper getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface NoWrapperOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PushConfig.NoWrapper) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * When true, writes the Pub/Sub message metadata to
-     * `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
-     * Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
-     * 
- * - * bool write_metadata = 1; - * - * @return The writeMetadata. - */ - boolean getWriteMetadata(); - } - /** - * - * - *
-   * Sets the `data` field as the HTTP body for delivery.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.PushConfig.NoWrapper} - */ - public static final class NoWrapper extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.PushConfig.NoWrapper) - NoWrapperOrBuilder { - private static final long serialVersionUID = 0L; - // Use NoWrapper.newBuilder() to construct. - private NoWrapper(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private NoWrapper() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new NoWrapper(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_NoWrapper_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_NoWrapper_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PushConfig.NoWrapper.class, - com.google.pubsub.v1.PushConfig.NoWrapper.Builder.class); - } - - public static final int WRITE_METADATA_FIELD_NUMBER = 1; - private boolean writeMetadata_ = false; - /** - * - * - *
-     * When true, writes the Pub/Sub message metadata to
-     * `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
-     * Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
-     * 
- * - * bool write_metadata = 1; - * - * @return The writeMetadata. - */ - @java.lang.Override - public boolean getWriteMetadata() { - return writeMetadata_; - } - - 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 (writeMetadata_ != false) { - output.writeBool(1, writeMetadata_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (writeMetadata_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, writeMetadata_); - } - size += getUnknownFields().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.PushConfig.NoWrapper)) { - return super.equals(obj); - } - com.google.pubsub.v1.PushConfig.NoWrapper other = - (com.google.pubsub.v1.PushConfig.NoWrapper) obj; - - if (getWriteMetadata() != other.getWriteMetadata()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + WRITE_METADATA_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getWriteMetadata()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.PushConfig.NoWrapper parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig.NoWrapper 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.PushConfig.NoWrapper parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig.NoWrapper 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.PushConfig.NoWrapper parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig.NoWrapper parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.PushConfig.NoWrapper parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig.NoWrapper 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.PushConfig.NoWrapper parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig.NoWrapper 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.PushConfig.NoWrapper parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig.NoWrapper 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.PushConfig.NoWrapper 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; - } - /** - * - * - *
-     * Sets the `data` field as the HTTP body for delivery.
-     * 
- * - * Protobuf type {@code google.pubsub.v1.PushConfig.NoWrapper} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PushConfig.NoWrapper) - com.google.pubsub.v1.PushConfig.NoWrapperOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_NoWrapper_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_NoWrapper_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PushConfig.NoWrapper.class, - com.google.pubsub.v1.PushConfig.NoWrapper.Builder.class); - } - - // Construct using com.google.pubsub.v1.PushConfig.NoWrapper.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - writeMetadata_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_NoWrapper_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig.NoWrapper getDefaultInstanceForType() { - return com.google.pubsub.v1.PushConfig.NoWrapper.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig.NoWrapper build() { - com.google.pubsub.v1.PushConfig.NoWrapper result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig.NoWrapper buildPartial() { - com.google.pubsub.v1.PushConfig.NoWrapper result = - new com.google.pubsub.v1.PushConfig.NoWrapper(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.PushConfig.NoWrapper result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.writeMetadata_ = writeMetadata_; - } - } - - @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.PushConfig.NoWrapper) { - return mergeFrom((com.google.pubsub.v1.PushConfig.NoWrapper) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.PushConfig.NoWrapper other) { - if (other == com.google.pubsub.v1.PushConfig.NoWrapper.getDefaultInstance()) return this; - if (other.getWriteMetadata() != false) { - setWriteMetadata(other.getWriteMetadata()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - writeMetadata_ = input.readBool(); - bitField0_ |= 0x00000001; - break; - } // case 8 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private boolean writeMetadata_; - /** - * - * - *
-       * When true, writes the Pub/Sub message metadata to
-       * `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
-       * Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
-       * 
- * - * bool write_metadata = 1; - * - * @return The writeMetadata. - */ - @java.lang.Override - public boolean getWriteMetadata() { - return writeMetadata_; - } - /** - * - * - *
-       * When true, writes the Pub/Sub message metadata to
-       * `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
-       * Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
-       * 
- * - * bool write_metadata = 1; - * - * @param value The writeMetadata to set. - * @return This builder for chaining. - */ - public Builder setWriteMetadata(boolean value) { - - writeMetadata_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * When true, writes the Pub/Sub message metadata to
-       * `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
-       * Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
-       * 
- * - * bool write_metadata = 1; - * - * @return This builder for chaining. - */ - public Builder clearWriteMetadata() { - bitField0_ = (bitField0_ & ~0x00000001); - writeMetadata_ = false; - 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.PushConfig.NoWrapper) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.PushConfig.NoWrapper) - private static final com.google.pubsub.v1.PushConfig.NoWrapper DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.PushConfig.NoWrapper(); - } - - public static com.google.pubsub.v1.PushConfig.NoWrapper getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NoWrapper parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.PushConfig.NoWrapper getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private int authenticationMethodCase_ = 0; - - @SuppressWarnings("serial") - private java.lang.Object authenticationMethod_; - - public enum AuthenticationMethodCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - OIDC_TOKEN(3), - AUTHENTICATIONMETHOD_NOT_SET(0); - private final int value; - - private AuthenticationMethodCase(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 AuthenticationMethodCase valueOf(int value) { - return forNumber(value); - } - - public static AuthenticationMethodCase forNumber(int value) { - switch (value) { - case 3: - return OIDC_TOKEN; - case 0: - return AUTHENTICATIONMETHOD_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public AuthenticationMethodCase getAuthenticationMethodCase() { - return AuthenticationMethodCase.forNumber(authenticationMethodCase_); - } - - private int wrapperCase_ = 0; - - @SuppressWarnings("serial") - private java.lang.Object wrapper_; - - public enum WrapperCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - PUBSUB_WRAPPER(4), - NO_WRAPPER(5), - WRAPPER_NOT_SET(0); - private final int value; - - private WrapperCase(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 WrapperCase valueOf(int value) { - return forNumber(value); - } - - public static WrapperCase forNumber(int value) { - switch (value) { - case 4: - return PUBSUB_WRAPPER; - case 5: - return NO_WRAPPER; - case 0: - return WRAPPER_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public WrapperCase getWrapperCase() { - return WrapperCase.forNumber(wrapperCase_); - } - - public static final int PUSH_ENDPOINT_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object pushEndpoint_ = ""; - /** - * - * - *
-   * A URL locating the endpoint to which messages should be pushed.
-   * For example, a Webhook endpoint might use `https://example.com/push`.
-   * 
- * - * string push_endpoint = 1; - * - * @return The pushEndpoint. - */ - @java.lang.Override - public java.lang.String getPushEndpoint() { - java.lang.Object ref = pushEndpoint_; - 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(); - pushEndpoint_ = s; - return s; - } - } - /** - * - * - *
-   * A URL locating the endpoint to which messages should be pushed.
-   * For example, a Webhook endpoint might use `https://example.com/push`.
-   * 
- * - * string push_endpoint = 1; - * - * @return The bytes for pushEndpoint. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPushEndpointBytes() { - java.lang.Object ref = pushEndpoint_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pushEndpoint_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ATTRIBUTES_FIELD_NUMBER = 2; - - private static final class AttributesDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_AttributesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - @SuppressWarnings("serial") - private com.google.protobuf.MapField attributes_; - - private com.google.protobuf.MapField internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); - } - /** - * - * - *
-   * Endpoint configuration attributes that can be used to control different
-   * aspects of the message delivery.
-   *
-   * The only currently supported attribute is `x-goog-version`, which you can
-   * use to change the format of the pushed message. This attribute
-   * indicates the version of the data expected by the endpoint. This
-   * controls the shape of the pushed message (i.e., its fields and metadata).
-   *
-   * If not present during the `CreateSubscription` call, it will default to
-   * the version of the Pub/Sub API used to make such call. If not present in a
-   * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-   * calls will always return a valid version, even if the subscription was
-   * created without this attribute.
-   *
-   * The only supported values for the `x-goog-version` attribute are:
-   *
-   * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-   * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-   *
-   * For example:
-   * `attributes { "x-goog-version": "v1" }`
-   * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public boolean containsAttributes(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetAttributes().getMap().containsKey(key); - } - /** Use {@link #getAttributesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getAttributes() { - return getAttributesMap(); - } - /** - * - * - *
-   * Endpoint configuration attributes that can be used to control different
-   * aspects of the message delivery.
-   *
-   * The only currently supported attribute is `x-goog-version`, which you can
-   * use to change the format of the pushed message. This attribute
-   * indicates the version of the data expected by the endpoint. This
-   * controls the shape of the pushed message (i.e., its fields and metadata).
-   *
-   * If not present during the `CreateSubscription` call, it will default to
-   * the version of the Pub/Sub API used to make such call. If not present in a
-   * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-   * calls will always return a valid version, even if the subscription was
-   * created without this attribute.
-   *
-   * The only supported values for the `x-goog-version` attribute are:
-   *
-   * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-   * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-   *
-   * For example:
-   * `attributes { "x-goog-version": "v1" }`
-   * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public java.util.Map getAttributesMap() { - return internalGetAttributes().getMap(); - } - /** - * - * - *
-   * Endpoint configuration attributes that can be used to control different
-   * aspects of the message delivery.
-   *
-   * The only currently supported attribute is `x-goog-version`, which you can
-   * use to change the format of the pushed message. This attribute
-   * indicates the version of the data expected by the endpoint. This
-   * controls the shape of the pushed message (i.e., its fields and metadata).
-   *
-   * If not present during the `CreateSubscription` call, it will default to
-   * the version of the Pub/Sub API used to make such call. If not present in a
-   * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-   * calls will always return a valid version, even if the subscription was
-   * created without this attribute.
-   *
-   * The only supported values for the `x-goog-version` attribute are:
-   *
-   * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-   * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-   *
-   * For example:
-   * `attributes { "x-goog-version": "v1" }`
-   * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public /* nullable */ java.lang.String getAttributesOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * Endpoint configuration attributes that can be used to control different
-   * aspects of the message delivery.
-   *
-   * The only currently supported attribute is `x-goog-version`, which you can
-   * use to change the format of the pushed message. This attribute
-   * indicates the version of the data expected by the endpoint. This
-   * controls the shape of the pushed message (i.e., its fields and metadata).
-   *
-   * If not present during the `CreateSubscription` call, it will default to
-   * the version of the Pub/Sub API used to make such call. If not present in a
-   * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-   * calls will always return a valid version, even if the subscription was
-   * created without this attribute.
-   *
-   * The only supported values for the `x-goog-version` attribute are:
-   *
-   * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-   * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-   *
-   * For example:
-   * `attributes { "x-goog-version": "v1" }`
-   * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public java.lang.String getAttributesOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int OIDC_TOKEN_FIELD_NUMBER = 3; - /** - * - * - *
-   * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-   * `Authorization` header in the HTTP request for every pushed message.
-   * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - * - * @return Whether the oidcToken field is set. - */ - @java.lang.Override - public boolean hasOidcToken() { - return authenticationMethodCase_ == 3; - } - /** - * - * - *
-   * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-   * `Authorization` header in the HTTP request for every pushed message.
-   * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - * - * @return The oidcToken. - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.OidcToken getOidcToken() { - if (authenticationMethodCase_ == 3) { - return (com.google.pubsub.v1.PushConfig.OidcToken) authenticationMethod_; - } - return com.google.pubsub.v1.PushConfig.OidcToken.getDefaultInstance(); - } - /** - * - * - *
-   * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-   * `Authorization` header in the HTTP request for every pushed message.
-   * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.OidcTokenOrBuilder getOidcTokenOrBuilder() { - if (authenticationMethodCase_ == 3) { - return (com.google.pubsub.v1.PushConfig.OidcToken) authenticationMethod_; - } - return com.google.pubsub.v1.PushConfig.OidcToken.getDefaultInstance(); - } - - public static final int PUBSUB_WRAPPER_FIELD_NUMBER = 4; - /** - * - * - *
-   * When set, the payload to the push endpoint is in the form of the JSON
-   * representation of a PubsubMessage
-   * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-   * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - * - * @return Whether the pubsubWrapper field is set. - */ - @java.lang.Override - public boolean hasPubsubWrapper() { - return wrapperCase_ == 4; - } - /** - * - * - *
-   * When set, the payload to the push endpoint is in the form of the JSON
-   * representation of a PubsubMessage
-   * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-   * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - * - * @return The pubsubWrapper. - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.PubsubWrapper getPubsubWrapper() { - if (wrapperCase_ == 4) { - return (com.google.pubsub.v1.PushConfig.PubsubWrapper) wrapper_; - } - return com.google.pubsub.v1.PushConfig.PubsubWrapper.getDefaultInstance(); - } - /** - * - * - *
-   * When set, the payload to the push endpoint is in the form of the JSON
-   * representation of a PubsubMessage
-   * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-   * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.PubsubWrapperOrBuilder getPubsubWrapperOrBuilder() { - if (wrapperCase_ == 4) { - return (com.google.pubsub.v1.PushConfig.PubsubWrapper) wrapper_; - } - return com.google.pubsub.v1.PushConfig.PubsubWrapper.getDefaultInstance(); - } - - public static final int NO_WRAPPER_FIELD_NUMBER = 5; - /** - * - * - *
-   * When set, the payload to the push endpoint is not wrapped.
-   * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - * - * @return Whether the noWrapper field is set. - */ - @java.lang.Override - public boolean hasNoWrapper() { - return wrapperCase_ == 5; - } - /** - * - * - *
-   * When set, the payload to the push endpoint is not wrapped.
-   * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - * - * @return The noWrapper. - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.NoWrapper getNoWrapper() { - if (wrapperCase_ == 5) { - return (com.google.pubsub.v1.PushConfig.NoWrapper) wrapper_; - } - return com.google.pubsub.v1.PushConfig.NoWrapper.getDefaultInstance(); - } - /** - * - * - *
-   * When set, the payload to the push endpoint is not wrapped.
-   * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.NoWrapperOrBuilder getNoWrapperOrBuilder() { - if (wrapperCase_ == 5) { - return (com.google.pubsub.v1.PushConfig.NoWrapper) wrapper_; - } - return com.google.pubsub.v1.PushConfig.NoWrapper.getDefaultInstance(); - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pushEndpoint_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pushEndpoint_); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 2); - if (authenticationMethodCase_ == 3) { - output.writeMessage(3, (com.google.pubsub.v1.PushConfig.OidcToken) authenticationMethod_); - } - if (wrapperCase_ == 4) { - output.writeMessage(4, (com.google.pubsub.v1.PushConfig.PubsubWrapper) wrapper_); - } - if (wrapperCase_ == 5) { - output.writeMessage(5, (com.google.pubsub.v1.PushConfig.NoWrapper) wrapper_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pushEndpoint_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pushEndpoint_); - } - for (java.util.Map.Entry entry : - internalGetAttributes().getMap().entrySet()) { - com.google.protobuf.MapEntry attributes__ = - AttributesDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attributes__); - } - if (authenticationMethodCase_ == 3) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 3, (com.google.pubsub.v1.PushConfig.OidcToken) authenticationMethod_); - } - if (wrapperCase_ == 4) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 4, (com.google.pubsub.v1.PushConfig.PubsubWrapper) wrapper_); - } - if (wrapperCase_ == 5) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 5, (com.google.pubsub.v1.PushConfig.NoWrapper) wrapper_); - } - size += getUnknownFields().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.PushConfig)) { - return super.equals(obj); - } - com.google.pubsub.v1.PushConfig other = (com.google.pubsub.v1.PushConfig) obj; - - if (!getPushEndpoint().equals(other.getPushEndpoint())) return false; - if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; - if (!getAuthenticationMethodCase().equals(other.getAuthenticationMethodCase())) return false; - switch (authenticationMethodCase_) { - case 3: - if (!getOidcToken().equals(other.getOidcToken())) return false; - break; - case 0: - default: - } - if (!getWrapperCase().equals(other.getWrapperCase())) return false; - switch (wrapperCase_) { - case 4: - if (!getPubsubWrapper().equals(other.getPubsubWrapper())) return false; - break; - case 5: - if (!getNoWrapper().equals(other.getNoWrapper())) return false; - break; - case 0: - default: - } - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PUSH_ENDPOINT_FIELD_NUMBER; - hash = (53 * hash) + getPushEndpoint().hashCode(); - if (!internalGetAttributes().getMap().isEmpty()) { - hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttributes().hashCode(); - } - switch (authenticationMethodCase_) { - case 3: - hash = (37 * hash) + OIDC_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getOidcToken().hashCode(); - break; - case 0: - default: - } - switch (wrapperCase_) { - case 4: - hash = (37 * hash) + PUBSUB_WRAPPER_FIELD_NUMBER; - hash = (53 * hash) + getPubsubWrapper().hashCode(); - break; - case 5: - hash = (37 * hash) + NO_WRAPPER_FIELD_NUMBER; - hash = (53 * hash) + getNoWrapper().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.PushConfig parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig 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.PushConfig parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig 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.PushConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.PushConfig parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.PushConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig 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.PushConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig 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.PushConfig parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.PushConfig 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.PushConfig 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; - } - /** - * - * - *
-   * Configuration for a push delivery endpoint.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.PushConfig} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.PushConfig) - com.google.pubsub.v1.PushConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 2: - return internalGetMutableAttributes(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.PushConfig.class, com.google.pubsub.v1.PushConfig.Builder.class); - } - - // Construct using com.google.pubsub.v1.PushConfig.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - pushEndpoint_ = ""; - internalGetMutableAttributes().clear(); - if (oidcTokenBuilder_ != null) { - oidcTokenBuilder_.clear(); - } - if (pubsubWrapperBuilder_ != null) { - pubsubWrapperBuilder_.clear(); - } - if (noWrapperBuilder_ != null) { - noWrapperBuilder_.clear(); - } - authenticationMethodCase_ = 0; - authenticationMethod_ = null; - wrapperCase_ = 0; - wrapper_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_PushConfig_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig getDefaultInstanceForType() { - return com.google.pubsub.v1.PushConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig build() { - com.google.pubsub.v1.PushConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.PushConfig buildPartial() { - com.google.pubsub.v1.PushConfig result = new com.google.pubsub.v1.PushConfig(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.PushConfig result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.pushEndpoint_ = pushEndpoint_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.attributes_ = internalGetAttributes(); - result.attributes_.makeImmutable(); - } - } - - private void buildPartialOneofs(com.google.pubsub.v1.PushConfig result) { - result.authenticationMethodCase_ = authenticationMethodCase_; - result.authenticationMethod_ = this.authenticationMethod_; - if (authenticationMethodCase_ == 3 && oidcTokenBuilder_ != null) { - result.authenticationMethod_ = oidcTokenBuilder_.build(); - } - result.wrapperCase_ = wrapperCase_; - result.wrapper_ = this.wrapper_; - if (wrapperCase_ == 4 && pubsubWrapperBuilder_ != null) { - result.wrapper_ = pubsubWrapperBuilder_.build(); - } - if (wrapperCase_ == 5 && noWrapperBuilder_ != null) { - result.wrapper_ = noWrapperBuilder_.build(); - } - } - - @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.PushConfig) { - return mergeFrom((com.google.pubsub.v1.PushConfig) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.PushConfig other) { - if (other == com.google.pubsub.v1.PushConfig.getDefaultInstance()) return this; - if (!other.getPushEndpoint().isEmpty()) { - pushEndpoint_ = other.pushEndpoint_; - bitField0_ |= 0x00000001; - onChanged(); - } - internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); - bitField0_ |= 0x00000002; - switch (other.getAuthenticationMethodCase()) { - case OIDC_TOKEN: - { - mergeOidcToken(other.getOidcToken()); - break; - } - case AUTHENTICATIONMETHOD_NOT_SET: - { - break; - } - } - switch (other.getWrapperCase()) { - case PUBSUB_WRAPPER: - { - mergePubsubWrapper(other.getPubsubWrapper()); - break; - } - case NO_WRAPPER: - { - mergeNoWrapper(other.getNoWrapper()); - break; - } - case WRAPPER_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - pushEndpoint_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - com.google.protobuf.MapEntry attributes__ = - input.readMessage( - AttributesDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableAttributes() - .getMutableMap() - .put(attributes__.getKey(), attributes__.getValue()); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - input.readMessage(getOidcTokenFieldBuilder().getBuilder(), extensionRegistry); - authenticationMethodCase_ = 3; - break; - } // case 26 - case 34: - { - input.readMessage(getPubsubWrapperFieldBuilder().getBuilder(), extensionRegistry); - wrapperCase_ = 4; - break; - } // case 34 - case 42: - { - input.readMessage(getNoWrapperFieldBuilder().getBuilder(), extensionRegistry); - wrapperCase_ = 5; - break; - } // case 42 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int authenticationMethodCase_ = 0; - private java.lang.Object authenticationMethod_; - - public AuthenticationMethodCase getAuthenticationMethodCase() { - return AuthenticationMethodCase.forNumber(authenticationMethodCase_); - } - - public Builder clearAuthenticationMethod() { - authenticationMethodCase_ = 0; - authenticationMethod_ = null; - onChanged(); - return this; - } - - private int wrapperCase_ = 0; - private java.lang.Object wrapper_; - - public WrapperCase getWrapperCase() { - return WrapperCase.forNumber(wrapperCase_); - } - - public Builder clearWrapper() { - wrapperCase_ = 0; - wrapper_ = null; - onChanged(); - return this; - } - - private int bitField0_; - - private java.lang.Object pushEndpoint_ = ""; - /** - * - * - *
-     * A URL locating the endpoint to which messages should be pushed.
-     * For example, a Webhook endpoint might use `https://example.com/push`.
-     * 
- * - * string push_endpoint = 1; - * - * @return The pushEndpoint. - */ - public java.lang.String getPushEndpoint() { - java.lang.Object ref = pushEndpoint_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pushEndpoint_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * A URL locating the endpoint to which messages should be pushed.
-     * For example, a Webhook endpoint might use `https://example.com/push`.
-     * 
- * - * string push_endpoint = 1; - * - * @return The bytes for pushEndpoint. - */ - public com.google.protobuf.ByteString getPushEndpointBytes() { - java.lang.Object ref = pushEndpoint_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pushEndpoint_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * A URL locating the endpoint to which messages should be pushed.
-     * For example, a Webhook endpoint might use `https://example.com/push`.
-     * 
- * - * string push_endpoint = 1; - * - * @param value The pushEndpoint to set. - * @return This builder for chaining. - */ - public Builder setPushEndpoint(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - pushEndpoint_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * A URL locating the endpoint to which messages should be pushed.
-     * For example, a Webhook endpoint might use `https://example.com/push`.
-     * 
- * - * string push_endpoint = 1; - * - * @return This builder for chaining. - */ - public Builder clearPushEndpoint() { - pushEndpoint_ = getDefaultInstance().getPushEndpoint(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * A URL locating the endpoint to which messages should be pushed.
-     * For example, a Webhook endpoint might use `https://example.com/push`.
-     * 
- * - * string push_endpoint = 1; - * - * @param value The bytes for pushEndpoint to set. - * @return This builder for chaining. - */ - public Builder setPushEndpointBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - pushEndpoint_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.protobuf.MapField attributes_; - - private com.google.protobuf.MapField - internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } - - private com.google.protobuf.MapField - internalGetMutableAttributes() { - if (attributes_ == null) { - attributes_ = - com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); - } - if (!attributes_.isMutable()) { - attributes_ = attributes_.copy(); - } - bitField0_ |= 0x00000002; - onChanged(); - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); - } - /** - * - * - *
-     * Endpoint configuration attributes that can be used to control different
-     * aspects of the message delivery.
-     *
-     * The only currently supported attribute is `x-goog-version`, which you can
-     * use to change the format of the pushed message. This attribute
-     * indicates the version of the data expected by the endpoint. This
-     * controls the shape of the pushed message (i.e., its fields and metadata).
-     *
-     * If not present during the `CreateSubscription` call, it will default to
-     * the version of the Pub/Sub API used to make such call. If not present in a
-     * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-     * calls will always return a valid version, even if the subscription was
-     * created without this attribute.
-     *
-     * The only supported values for the `x-goog-version` attribute are:
-     *
-     * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-     * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-     *
-     * For example:
-     * `attributes { "x-goog-version": "v1" }`
-     * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public boolean containsAttributes(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetAttributes().getMap().containsKey(key); - } - /** Use {@link #getAttributesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getAttributes() { - return getAttributesMap(); - } - /** - * - * - *
-     * Endpoint configuration attributes that can be used to control different
-     * aspects of the message delivery.
-     *
-     * The only currently supported attribute is `x-goog-version`, which you can
-     * use to change the format of the pushed message. This attribute
-     * indicates the version of the data expected by the endpoint. This
-     * controls the shape of the pushed message (i.e., its fields and metadata).
-     *
-     * If not present during the `CreateSubscription` call, it will default to
-     * the version of the Pub/Sub API used to make such call. If not present in a
-     * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-     * calls will always return a valid version, even if the subscription was
-     * created without this attribute.
-     *
-     * The only supported values for the `x-goog-version` attribute are:
-     *
-     * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-     * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-     *
-     * For example:
-     * `attributes { "x-goog-version": "v1" }`
-     * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public java.util.Map getAttributesMap() { - return internalGetAttributes().getMap(); - } - /** - * - * - *
-     * Endpoint configuration attributes that can be used to control different
-     * aspects of the message delivery.
-     *
-     * The only currently supported attribute is `x-goog-version`, which you can
-     * use to change the format of the pushed message. This attribute
-     * indicates the version of the data expected by the endpoint. This
-     * controls the shape of the pushed message (i.e., its fields and metadata).
-     *
-     * If not present during the `CreateSubscription` call, it will default to
-     * the version of the Pub/Sub API used to make such call. If not present in a
-     * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-     * calls will always return a valid version, even if the subscription was
-     * created without this attribute.
-     *
-     * The only supported values for the `x-goog-version` attribute are:
-     *
-     * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-     * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-     *
-     * For example:
-     * `attributes { "x-goog-version": "v1" }`
-     * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public /* nullable */ java.lang.String getAttributesOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * Endpoint configuration attributes that can be used to control different
-     * aspects of the message delivery.
-     *
-     * The only currently supported attribute is `x-goog-version`, which you can
-     * use to change the format of the pushed message. This attribute
-     * indicates the version of the data expected by the endpoint. This
-     * controls the shape of the pushed message (i.e., its fields and metadata).
-     *
-     * If not present during the `CreateSubscription` call, it will default to
-     * the version of the Pub/Sub API used to make such call. If not present in a
-     * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-     * calls will always return a valid version, even if the subscription was
-     * created without this attribute.
-     *
-     * The only supported values for the `x-goog-version` attribute are:
-     *
-     * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-     * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-     *
-     * For example:
-     * `attributes { "x-goog-version": "v1" }`
-     * 
- * - * map<string, string> attributes = 2; - */ - @java.lang.Override - public java.lang.String getAttributesOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttributes() { - bitField0_ = (bitField0_ & ~0x00000002); - internalGetMutableAttributes().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * Endpoint configuration attributes that can be used to control different
-     * aspects of the message delivery.
-     *
-     * The only currently supported attribute is `x-goog-version`, which you can
-     * use to change the format of the pushed message. This attribute
-     * indicates the version of the data expected by the endpoint. This
-     * controls the shape of the pushed message (i.e., its fields and metadata).
-     *
-     * If not present during the `CreateSubscription` call, it will default to
-     * the version of the Pub/Sub API used to make such call. If not present in a
-     * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-     * calls will always return a valid version, even if the subscription was
-     * created without this attribute.
-     *
-     * The only supported values for the `x-goog-version` attribute are:
-     *
-     * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-     * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-     *
-     * For example:
-     * `attributes { "x-goog-version": "v1" }`
-     * 
- * - * map<string, string> attributes = 2; - */ - public Builder removeAttributes(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableAttributes().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableAttributes() { - bitField0_ |= 0x00000002; - return internalGetMutableAttributes().getMutableMap(); - } - /** - * - * - *
-     * Endpoint configuration attributes that can be used to control different
-     * aspects of the message delivery.
-     *
-     * The only currently supported attribute is `x-goog-version`, which you can
-     * use to change the format of the pushed message. This attribute
-     * indicates the version of the data expected by the endpoint. This
-     * controls the shape of the pushed message (i.e., its fields and metadata).
-     *
-     * If not present during the `CreateSubscription` call, it will default to
-     * the version of the Pub/Sub API used to make such call. If not present in a
-     * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-     * calls will always return a valid version, even if the subscription was
-     * created without this attribute.
-     *
-     * The only supported values for the `x-goog-version` attribute are:
-     *
-     * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-     * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-     *
-     * For example:
-     * `attributes { "x-goog-version": "v1" }`
-     * 
- * - * map<string, string> attributes = 2; - */ - public Builder putAttributes(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new NullPointerException("map key"); - } - if (value == null) { - throw new NullPointerException("map value"); - } - internalGetMutableAttributes().getMutableMap().put(key, value); - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-     * Endpoint configuration attributes that can be used to control different
-     * aspects of the message delivery.
-     *
-     * The only currently supported attribute is `x-goog-version`, which you can
-     * use to change the format of the pushed message. This attribute
-     * indicates the version of the data expected by the endpoint. This
-     * controls the shape of the pushed message (i.e., its fields and metadata).
-     *
-     * If not present during the `CreateSubscription` call, it will default to
-     * the version of the Pub/Sub API used to make such call. If not present in a
-     * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-     * calls will always return a valid version, even if the subscription was
-     * created without this attribute.
-     *
-     * The only supported values for the `x-goog-version` attribute are:
-     *
-     * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-     * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-     *
-     * For example:
-     * `attributes { "x-goog-version": "v1" }`
-     * 
- * - * map<string, string> attributes = 2; - */ - public Builder putAllAttributes(java.util.Map values) { - internalGetMutableAttributes().getMutableMap().putAll(values); - bitField0_ |= 0x00000002; - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig.OidcToken, - com.google.pubsub.v1.PushConfig.OidcToken.Builder, - com.google.pubsub.v1.PushConfig.OidcTokenOrBuilder> - oidcTokenBuilder_; - /** - * - * - *
-     * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-     * `Authorization` header in the HTTP request for every pushed message.
-     * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - * - * @return Whether the oidcToken field is set. - */ - @java.lang.Override - public boolean hasOidcToken() { - return authenticationMethodCase_ == 3; - } - /** - * - * - *
-     * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-     * `Authorization` header in the HTTP request for every pushed message.
-     * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - * - * @return The oidcToken. - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.OidcToken getOidcToken() { - if (oidcTokenBuilder_ == null) { - if (authenticationMethodCase_ == 3) { - return (com.google.pubsub.v1.PushConfig.OidcToken) authenticationMethod_; - } - return com.google.pubsub.v1.PushConfig.OidcToken.getDefaultInstance(); - } else { - if (authenticationMethodCase_ == 3) { - return oidcTokenBuilder_.getMessage(); - } - return com.google.pubsub.v1.PushConfig.OidcToken.getDefaultInstance(); - } - } - /** - * - * - *
-     * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-     * `Authorization` header in the HTTP request for every pushed message.
-     * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - */ - public Builder setOidcToken(com.google.pubsub.v1.PushConfig.OidcToken value) { - if (oidcTokenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - authenticationMethod_ = value; - onChanged(); - } else { - oidcTokenBuilder_.setMessage(value); - } - authenticationMethodCase_ = 3; - return this; - } - /** - * - * - *
-     * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-     * `Authorization` header in the HTTP request for every pushed message.
-     * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - */ - public Builder setOidcToken(com.google.pubsub.v1.PushConfig.OidcToken.Builder builderForValue) { - if (oidcTokenBuilder_ == null) { - authenticationMethod_ = builderForValue.build(); - onChanged(); - } else { - oidcTokenBuilder_.setMessage(builderForValue.build()); - } - authenticationMethodCase_ = 3; - return this; - } - /** - * - * - *
-     * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-     * `Authorization` header in the HTTP request for every pushed message.
-     * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - */ - public Builder mergeOidcToken(com.google.pubsub.v1.PushConfig.OidcToken value) { - if (oidcTokenBuilder_ == null) { - if (authenticationMethodCase_ == 3 - && authenticationMethod_ - != com.google.pubsub.v1.PushConfig.OidcToken.getDefaultInstance()) { - authenticationMethod_ = - com.google.pubsub.v1.PushConfig.OidcToken.newBuilder( - (com.google.pubsub.v1.PushConfig.OidcToken) authenticationMethod_) - .mergeFrom(value) - .buildPartial(); - } else { - authenticationMethod_ = value; - } - onChanged(); - } else { - if (authenticationMethodCase_ == 3) { - oidcTokenBuilder_.mergeFrom(value); - } else { - oidcTokenBuilder_.setMessage(value); - } - } - authenticationMethodCase_ = 3; - return this; - } - /** - * - * - *
-     * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-     * `Authorization` header in the HTTP request for every pushed message.
-     * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - */ - public Builder clearOidcToken() { - if (oidcTokenBuilder_ == null) { - if (authenticationMethodCase_ == 3) { - authenticationMethodCase_ = 0; - authenticationMethod_ = null; - onChanged(); - } - } else { - if (authenticationMethodCase_ == 3) { - authenticationMethodCase_ = 0; - authenticationMethod_ = null; - } - oidcTokenBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-     * `Authorization` header in the HTTP request for every pushed message.
-     * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - */ - public com.google.pubsub.v1.PushConfig.OidcToken.Builder getOidcTokenBuilder() { - return getOidcTokenFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-     * `Authorization` header in the HTTP request for every pushed message.
-     * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.OidcTokenOrBuilder getOidcTokenOrBuilder() { - if ((authenticationMethodCase_ == 3) && (oidcTokenBuilder_ != null)) { - return oidcTokenBuilder_.getMessageOrBuilder(); - } else { - if (authenticationMethodCase_ == 3) { - return (com.google.pubsub.v1.PushConfig.OidcToken) authenticationMethod_; - } - return com.google.pubsub.v1.PushConfig.OidcToken.getDefaultInstance(); - } - } - /** - * - * - *
-     * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-     * `Authorization` header in the HTTP request for every pushed message.
-     * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig.OidcToken, - com.google.pubsub.v1.PushConfig.OidcToken.Builder, - com.google.pubsub.v1.PushConfig.OidcTokenOrBuilder> - getOidcTokenFieldBuilder() { - if (oidcTokenBuilder_ == null) { - if (!(authenticationMethodCase_ == 3)) { - authenticationMethod_ = com.google.pubsub.v1.PushConfig.OidcToken.getDefaultInstance(); - } - oidcTokenBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig.OidcToken, - com.google.pubsub.v1.PushConfig.OidcToken.Builder, - com.google.pubsub.v1.PushConfig.OidcTokenOrBuilder>( - (com.google.pubsub.v1.PushConfig.OidcToken) authenticationMethod_, - getParentForChildren(), - isClean()); - authenticationMethod_ = null; - } - authenticationMethodCase_ = 3; - onChanged(); - return oidcTokenBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig.PubsubWrapper, - com.google.pubsub.v1.PushConfig.PubsubWrapper.Builder, - com.google.pubsub.v1.PushConfig.PubsubWrapperOrBuilder> - pubsubWrapperBuilder_; - /** - * - * - *
-     * When set, the payload to the push endpoint is in the form of the JSON
-     * representation of a PubsubMessage
-     * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-     * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - * - * @return Whether the pubsubWrapper field is set. - */ - @java.lang.Override - public boolean hasPubsubWrapper() { - return wrapperCase_ == 4; - } - /** - * - * - *
-     * When set, the payload to the push endpoint is in the form of the JSON
-     * representation of a PubsubMessage
-     * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-     * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - * - * @return The pubsubWrapper. - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.PubsubWrapper getPubsubWrapper() { - if (pubsubWrapperBuilder_ == null) { - if (wrapperCase_ == 4) { - return (com.google.pubsub.v1.PushConfig.PubsubWrapper) wrapper_; - } - return com.google.pubsub.v1.PushConfig.PubsubWrapper.getDefaultInstance(); - } else { - if (wrapperCase_ == 4) { - return pubsubWrapperBuilder_.getMessage(); - } - return com.google.pubsub.v1.PushConfig.PubsubWrapper.getDefaultInstance(); - } - } - /** - * - * - *
-     * When set, the payload to the push endpoint is in the form of the JSON
-     * representation of a PubsubMessage
-     * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-     * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - */ - public Builder setPubsubWrapper(com.google.pubsub.v1.PushConfig.PubsubWrapper value) { - if (pubsubWrapperBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - wrapper_ = value; - onChanged(); - } else { - pubsubWrapperBuilder_.setMessage(value); - } - wrapperCase_ = 4; - return this; - } - /** - * - * - *
-     * When set, the payload to the push endpoint is in the form of the JSON
-     * representation of a PubsubMessage
-     * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-     * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - */ - public Builder setPubsubWrapper( - com.google.pubsub.v1.PushConfig.PubsubWrapper.Builder builderForValue) { - if (pubsubWrapperBuilder_ == null) { - wrapper_ = builderForValue.build(); - onChanged(); - } else { - pubsubWrapperBuilder_.setMessage(builderForValue.build()); - } - wrapperCase_ = 4; - return this; - } - /** - * - * - *
-     * When set, the payload to the push endpoint is in the form of the JSON
-     * representation of a PubsubMessage
-     * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-     * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - */ - public Builder mergePubsubWrapper(com.google.pubsub.v1.PushConfig.PubsubWrapper value) { - if (pubsubWrapperBuilder_ == null) { - if (wrapperCase_ == 4 - && wrapper_ != com.google.pubsub.v1.PushConfig.PubsubWrapper.getDefaultInstance()) { - wrapper_ = - com.google.pubsub.v1.PushConfig.PubsubWrapper.newBuilder( - (com.google.pubsub.v1.PushConfig.PubsubWrapper) wrapper_) - .mergeFrom(value) - .buildPartial(); - } else { - wrapper_ = value; - } - onChanged(); - } else { - if (wrapperCase_ == 4) { - pubsubWrapperBuilder_.mergeFrom(value); - } else { - pubsubWrapperBuilder_.setMessage(value); - } - } - wrapperCase_ = 4; - return this; - } - /** - * - * - *
-     * When set, the payload to the push endpoint is in the form of the JSON
-     * representation of a PubsubMessage
-     * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-     * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - */ - public Builder clearPubsubWrapper() { - if (pubsubWrapperBuilder_ == null) { - if (wrapperCase_ == 4) { - wrapperCase_ = 0; - wrapper_ = null; - onChanged(); - } - } else { - if (wrapperCase_ == 4) { - wrapperCase_ = 0; - wrapper_ = null; - } - pubsubWrapperBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * When set, the payload to the push endpoint is in the form of the JSON
-     * representation of a PubsubMessage
-     * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-     * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - */ - public com.google.pubsub.v1.PushConfig.PubsubWrapper.Builder getPubsubWrapperBuilder() { - return getPubsubWrapperFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * When set, the payload to the push endpoint is in the form of the JSON
-     * representation of a PubsubMessage
-     * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-     * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.PubsubWrapperOrBuilder getPubsubWrapperOrBuilder() { - if ((wrapperCase_ == 4) && (pubsubWrapperBuilder_ != null)) { - return pubsubWrapperBuilder_.getMessageOrBuilder(); - } else { - if (wrapperCase_ == 4) { - return (com.google.pubsub.v1.PushConfig.PubsubWrapper) wrapper_; - } - return com.google.pubsub.v1.PushConfig.PubsubWrapper.getDefaultInstance(); - } - } - /** - * - * - *
-     * When set, the payload to the push endpoint is in the form of the JSON
-     * representation of a PubsubMessage
-     * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-     * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig.PubsubWrapper, - com.google.pubsub.v1.PushConfig.PubsubWrapper.Builder, - com.google.pubsub.v1.PushConfig.PubsubWrapperOrBuilder> - getPubsubWrapperFieldBuilder() { - if (pubsubWrapperBuilder_ == null) { - if (!(wrapperCase_ == 4)) { - wrapper_ = com.google.pubsub.v1.PushConfig.PubsubWrapper.getDefaultInstance(); - } - pubsubWrapperBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig.PubsubWrapper, - com.google.pubsub.v1.PushConfig.PubsubWrapper.Builder, - com.google.pubsub.v1.PushConfig.PubsubWrapperOrBuilder>( - (com.google.pubsub.v1.PushConfig.PubsubWrapper) wrapper_, - getParentForChildren(), - isClean()); - wrapper_ = null; - } - wrapperCase_ = 4; - onChanged(); - return pubsubWrapperBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig.NoWrapper, - com.google.pubsub.v1.PushConfig.NoWrapper.Builder, - com.google.pubsub.v1.PushConfig.NoWrapperOrBuilder> - noWrapperBuilder_; - /** - * - * - *
-     * When set, the payload to the push endpoint is not wrapped.
-     * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - * - * @return Whether the noWrapper field is set. - */ - @java.lang.Override - public boolean hasNoWrapper() { - return wrapperCase_ == 5; - } - /** - * - * - *
-     * When set, the payload to the push endpoint is not wrapped.
-     * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - * - * @return The noWrapper. - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.NoWrapper getNoWrapper() { - if (noWrapperBuilder_ == null) { - if (wrapperCase_ == 5) { - return (com.google.pubsub.v1.PushConfig.NoWrapper) wrapper_; - } - return com.google.pubsub.v1.PushConfig.NoWrapper.getDefaultInstance(); - } else { - if (wrapperCase_ == 5) { - return noWrapperBuilder_.getMessage(); - } - return com.google.pubsub.v1.PushConfig.NoWrapper.getDefaultInstance(); - } - } - /** - * - * - *
-     * When set, the payload to the push endpoint is not wrapped.
-     * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - */ - public Builder setNoWrapper(com.google.pubsub.v1.PushConfig.NoWrapper value) { - if (noWrapperBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - wrapper_ = value; - onChanged(); - } else { - noWrapperBuilder_.setMessage(value); - } - wrapperCase_ = 5; - return this; - } - /** - * - * - *
-     * When set, the payload to the push endpoint is not wrapped.
-     * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - */ - public Builder setNoWrapper(com.google.pubsub.v1.PushConfig.NoWrapper.Builder builderForValue) { - if (noWrapperBuilder_ == null) { - wrapper_ = builderForValue.build(); - onChanged(); - } else { - noWrapperBuilder_.setMessage(builderForValue.build()); - } - wrapperCase_ = 5; - return this; - } - /** - * - * - *
-     * When set, the payload to the push endpoint is not wrapped.
-     * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - */ - public Builder mergeNoWrapper(com.google.pubsub.v1.PushConfig.NoWrapper value) { - if (noWrapperBuilder_ == null) { - if (wrapperCase_ == 5 - && wrapper_ != com.google.pubsub.v1.PushConfig.NoWrapper.getDefaultInstance()) { - wrapper_ = - com.google.pubsub.v1.PushConfig.NoWrapper.newBuilder( - (com.google.pubsub.v1.PushConfig.NoWrapper) wrapper_) - .mergeFrom(value) - .buildPartial(); - } else { - wrapper_ = value; - } - onChanged(); - } else { - if (wrapperCase_ == 5) { - noWrapperBuilder_.mergeFrom(value); - } else { - noWrapperBuilder_.setMessage(value); - } - } - wrapperCase_ = 5; - return this; - } - /** - * - * - *
-     * When set, the payload to the push endpoint is not wrapped.
-     * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - */ - public Builder clearNoWrapper() { - if (noWrapperBuilder_ == null) { - if (wrapperCase_ == 5) { - wrapperCase_ = 0; - wrapper_ = null; - onChanged(); - } - } else { - if (wrapperCase_ == 5) { - wrapperCase_ = 0; - wrapper_ = null; - } - noWrapperBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * When set, the payload to the push endpoint is not wrapped.
-     * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - */ - public com.google.pubsub.v1.PushConfig.NoWrapper.Builder getNoWrapperBuilder() { - return getNoWrapperFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * When set, the payload to the push endpoint is not wrapped.
-     * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig.NoWrapperOrBuilder getNoWrapperOrBuilder() { - if ((wrapperCase_ == 5) && (noWrapperBuilder_ != null)) { - return noWrapperBuilder_.getMessageOrBuilder(); - } else { - if (wrapperCase_ == 5) { - return (com.google.pubsub.v1.PushConfig.NoWrapper) wrapper_; - } - return com.google.pubsub.v1.PushConfig.NoWrapper.getDefaultInstance(); - } - } - /** - * - * - *
-     * When set, the payload to the push endpoint is not wrapped.
-     * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig.NoWrapper, - com.google.pubsub.v1.PushConfig.NoWrapper.Builder, - com.google.pubsub.v1.PushConfig.NoWrapperOrBuilder> - getNoWrapperFieldBuilder() { - if (noWrapperBuilder_ == null) { - if (!(wrapperCase_ == 5)) { - wrapper_ = com.google.pubsub.v1.PushConfig.NoWrapper.getDefaultInstance(); - } - noWrapperBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig.NoWrapper, - com.google.pubsub.v1.PushConfig.NoWrapper.Builder, - com.google.pubsub.v1.PushConfig.NoWrapperOrBuilder>( - (com.google.pubsub.v1.PushConfig.NoWrapper) wrapper_, - getParentForChildren(), - isClean()); - wrapper_ = null; - } - wrapperCase_ = 5; - onChanged(); - return noWrapperBuilder_; - } - - @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.PushConfig) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.PushConfig) - private static final com.google.pubsub.v1.PushConfig DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.PushConfig(); - } - - public static com.google.pubsub.v1.PushConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PushConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.PushConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java deleted file mode 100644 index dade5167a..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright 2023 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 PushConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.PushConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * A URL locating the endpoint to which messages should be pushed.
-   * For example, a Webhook endpoint might use `https://example.com/push`.
-   * 
- * - * string push_endpoint = 1; - * - * @return The pushEndpoint. - */ - java.lang.String getPushEndpoint(); - /** - * - * - *
-   * A URL locating the endpoint to which messages should be pushed.
-   * For example, a Webhook endpoint might use `https://example.com/push`.
-   * 
- * - * string push_endpoint = 1; - * - * @return The bytes for pushEndpoint. - */ - com.google.protobuf.ByteString getPushEndpointBytes(); - - /** - * - * - *
-   * Endpoint configuration attributes that can be used to control different
-   * aspects of the message delivery.
-   *
-   * The only currently supported attribute is `x-goog-version`, which you can
-   * use to change the format of the pushed message. This attribute
-   * indicates the version of the data expected by the endpoint. This
-   * controls the shape of the pushed message (i.e., its fields and metadata).
-   *
-   * If not present during the `CreateSubscription` call, it will default to
-   * the version of the Pub/Sub API used to make such call. If not present in a
-   * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-   * calls will always return a valid version, even if the subscription was
-   * created without this attribute.
-   *
-   * The only supported values for the `x-goog-version` attribute are:
-   *
-   * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-   * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-   *
-   * For example:
-   * `attributes { "x-goog-version": "v1" }`
-   * 
- * - * map<string, string> attributes = 2; - */ - int getAttributesCount(); - /** - * - * - *
-   * Endpoint configuration attributes that can be used to control different
-   * aspects of the message delivery.
-   *
-   * The only currently supported attribute is `x-goog-version`, which you can
-   * use to change the format of the pushed message. This attribute
-   * indicates the version of the data expected by the endpoint. This
-   * controls the shape of the pushed message (i.e., its fields and metadata).
-   *
-   * If not present during the `CreateSubscription` call, it will default to
-   * the version of the Pub/Sub API used to make such call. If not present in a
-   * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-   * calls will always return a valid version, even if the subscription was
-   * created without this attribute.
-   *
-   * The only supported values for the `x-goog-version` attribute are:
-   *
-   * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-   * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-   *
-   * For example:
-   * `attributes { "x-goog-version": "v1" }`
-   * 
- * - * map<string, string> attributes = 2; - */ - boolean containsAttributes(java.lang.String key); - /** Use {@link #getAttributesMap()} instead. */ - @java.lang.Deprecated - java.util.Map getAttributes(); - /** - * - * - *
-   * Endpoint configuration attributes that can be used to control different
-   * aspects of the message delivery.
-   *
-   * The only currently supported attribute is `x-goog-version`, which you can
-   * use to change the format of the pushed message. This attribute
-   * indicates the version of the data expected by the endpoint. This
-   * controls the shape of the pushed message (i.e., its fields and metadata).
-   *
-   * If not present during the `CreateSubscription` call, it will default to
-   * the version of the Pub/Sub API used to make such call. If not present in a
-   * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-   * calls will always return a valid version, even if the subscription was
-   * created without this attribute.
-   *
-   * The only supported values for the `x-goog-version` attribute are:
-   *
-   * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-   * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-   *
-   * For example:
-   * `attributes { "x-goog-version": "v1" }`
-   * 
- * - * map<string, string> attributes = 2; - */ - java.util.Map getAttributesMap(); - /** - * - * - *
-   * Endpoint configuration attributes that can be used to control different
-   * aspects of the message delivery.
-   *
-   * The only currently supported attribute is `x-goog-version`, which you can
-   * use to change the format of the pushed message. This attribute
-   * indicates the version of the data expected by the endpoint. This
-   * controls the shape of the pushed message (i.e., its fields and metadata).
-   *
-   * If not present during the `CreateSubscription` call, it will default to
-   * the version of the Pub/Sub API used to make such call. If not present in a
-   * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-   * calls will always return a valid version, even if the subscription was
-   * created without this attribute.
-   *
-   * The only supported values for the `x-goog-version` attribute are:
-   *
-   * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-   * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-   *
-   * For example:
-   * `attributes { "x-goog-version": "v1" }`
-   * 
- * - * map<string, string> attributes = 2; - */ - /* nullable */ - java.lang.String getAttributesOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue); - /** - * - * - *
-   * Endpoint configuration attributes that can be used to control different
-   * aspects of the message delivery.
-   *
-   * The only currently supported attribute is `x-goog-version`, which you can
-   * use to change the format of the pushed message. This attribute
-   * indicates the version of the data expected by the endpoint. This
-   * controls the shape of the pushed message (i.e., its fields and metadata).
-   *
-   * If not present during the `CreateSubscription` call, it will default to
-   * the version of the Pub/Sub API used to make such call. If not present in a
-   * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
-   * calls will always return a valid version, even if the subscription was
-   * created without this attribute.
-   *
-   * The only supported values for the `x-goog-version` attribute are:
-   *
-   * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
-   * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
-   *
-   * For example:
-   * `attributes { "x-goog-version": "v1" }`
-   * 
- * - * map<string, string> attributes = 2; - */ - java.lang.String getAttributesOrThrow(java.lang.String key); - - /** - * - * - *
-   * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-   * `Authorization` header in the HTTP request for every pushed message.
-   * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - * - * @return Whether the oidcToken field is set. - */ - boolean hasOidcToken(); - /** - * - * - *
-   * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-   * `Authorization` header in the HTTP request for every pushed message.
-   * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - * - * @return The oidcToken. - */ - com.google.pubsub.v1.PushConfig.OidcToken getOidcToken(); - /** - * - * - *
-   * If specified, Pub/Sub will generate and attach an OIDC JWT token as an
-   * `Authorization` header in the HTTP request for every pushed message.
-   * 
- * - * .google.pubsub.v1.PushConfig.OidcToken oidc_token = 3; - */ - com.google.pubsub.v1.PushConfig.OidcTokenOrBuilder getOidcTokenOrBuilder(); - - /** - * - * - *
-   * When set, the payload to the push endpoint is in the form of the JSON
-   * representation of a PubsubMessage
-   * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-   * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - * - * @return Whether the pubsubWrapper field is set. - */ - boolean hasPubsubWrapper(); - /** - * - * - *
-   * When set, the payload to the push endpoint is in the form of the JSON
-   * representation of a PubsubMessage
-   * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-   * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - * - * @return The pubsubWrapper. - */ - com.google.pubsub.v1.PushConfig.PubsubWrapper getPubsubWrapper(); - /** - * - * - *
-   * When set, the payload to the push endpoint is in the form of the JSON
-   * representation of a PubsubMessage
-   * (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
-   * 
- * - * .google.pubsub.v1.PushConfig.PubsubWrapper pubsub_wrapper = 4; - */ - com.google.pubsub.v1.PushConfig.PubsubWrapperOrBuilder getPubsubWrapperOrBuilder(); - - /** - * - * - *
-   * When set, the payload to the push endpoint is not wrapped.
-   * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - * - * @return Whether the noWrapper field is set. - */ - boolean hasNoWrapper(); - /** - * - * - *
-   * When set, the payload to the push endpoint is not wrapped.
-   * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - * - * @return The noWrapper. - */ - com.google.pubsub.v1.PushConfig.NoWrapper getNoWrapper(); - /** - * - * - *
-   * When set, the payload to the push endpoint is not wrapped.
-   * 
- * - * .google.pubsub.v1.PushConfig.NoWrapper no_wrapper = 5; - */ - com.google.pubsub.v1.PushConfig.NoWrapperOrBuilder getNoWrapperOrBuilder(); - - com.google.pubsub.v1.PushConfig.AuthenticationMethodCase getAuthenticationMethodCase(); - - com.google.pubsub.v1.PushConfig.WrapperCase getWrapperCase(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java deleted file mode 100644 index 3e70473df..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java +++ /dev/null @@ -1,1033 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * A message and its corresponding acknowledgment ID.
- * 
- * - * Protobuf type {@code google.pubsub.v1.ReceivedMessage} - */ -public final class ReceivedMessage extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.ReceivedMessage) - ReceivedMessageOrBuilder { - private static final long serialVersionUID = 0L; - // Use ReceivedMessage.newBuilder() to construct. - private ReceivedMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ReceivedMessage() { - ackId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ReceivedMessage(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ReceivedMessage_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ReceivedMessage_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ReceivedMessage.class, - com.google.pubsub.v1.ReceivedMessage.Builder.class); - } - - public static final int ACK_ID_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object ackId_ = ""; - /** - * - * - *
-   * This ID can be used to acknowledge the received message.
-   * 
- * - * string ack_id = 1; - * - * @return The ackId. - */ - @java.lang.Override - public java.lang.String getAckId() { - java.lang.Object ref = ackId_; - 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(); - ackId_ = s; - return s; - } - } - /** - * - * - *
-   * This ID can be used to acknowledge the received message.
-   * 
- * - * string ack_id = 1; - * - * @return The bytes for ackId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAckIdBytes() { - java.lang.Object ref = ackId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - ackId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MESSAGE_FIELD_NUMBER = 2; - private com.google.pubsub.v1.PubsubMessage message_; - /** - * - * - *
-   * The message.
-   * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - * - * @return Whether the message field is set. - */ - @java.lang.Override - public boolean hasMessage() { - return message_ != null; - } - /** - * - * - *
-   * The message.
-   * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - * - * @return The message. - */ - @java.lang.Override - public com.google.pubsub.v1.PubsubMessage getMessage() { - return message_ == null ? com.google.pubsub.v1.PubsubMessage.getDefaultInstance() : message_; - } - /** - * - * - *
-   * The message.
-   * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - */ - @java.lang.Override - public com.google.pubsub.v1.PubsubMessageOrBuilder getMessageOrBuilder() { - return message_ == null ? com.google.pubsub.v1.PubsubMessage.getDefaultInstance() : message_; - } - - public static final int DELIVERY_ATTEMPT_FIELD_NUMBER = 3; - private int deliveryAttempt_ = 0; - /** - * - * - *
-   * The approximate number of times that Cloud Pub/Sub has attempted to deliver
-   * the associated message to a subscriber.
-   *
-   * More precisely, this is 1 + (number of NACKs) +
-   * (number of ack_deadline exceeds) for this message.
-   *
-   * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
-   * exceeds event is whenever a message is not acknowledged within
-   * ack_deadline. Note that ack_deadline is initially
-   * Subscription.ackDeadlineSeconds, but may get extended automatically by
-   * the client library.
-   *
-   * Upon the first delivery of a given message, `delivery_attempt` will have a
-   * value of 1. The value is calculated at best effort and is approximate.
-   *
-   * If a DeadLetterPolicy is not set on the subscription, this will be 0.
-   * 
- * - * int32 delivery_attempt = 3; - * - * @return The deliveryAttempt. - */ - @java.lang.Override - public int getDeliveryAttempt() { - return deliveryAttempt_; - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ackId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ackId_); - } - if (message_ != null) { - output.writeMessage(2, getMessage()); - } - if (deliveryAttempt_ != 0) { - output.writeInt32(3, deliveryAttempt_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ackId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ackId_); - } - if (message_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMessage()); - } - if (deliveryAttempt_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, deliveryAttempt_); - } - size += getUnknownFields().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.ReceivedMessage)) { - return super.equals(obj); - } - com.google.pubsub.v1.ReceivedMessage other = (com.google.pubsub.v1.ReceivedMessage) obj; - - if (!getAckId().equals(other.getAckId())) return false; - if (hasMessage() != other.hasMessage()) return false; - if (hasMessage()) { - if (!getMessage().equals(other.getMessage())) return false; - } - if (getDeliveryAttempt() != other.getDeliveryAttempt()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ACK_ID_FIELD_NUMBER; - hash = (53 * hash) + getAckId().hashCode(); - if (hasMessage()) { - hash = (37 * hash) + MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getMessage().hashCode(); - } - hash = (37 * hash) + DELIVERY_ATTEMPT_FIELD_NUMBER; - hash = (53 * hash) + getDeliveryAttempt(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.ReceivedMessage parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ReceivedMessage 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.ReceivedMessage parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ReceivedMessage 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.ReceivedMessage parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.ReceivedMessage parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.ReceivedMessage parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ReceivedMessage 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.ReceivedMessage parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ReceivedMessage 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.ReceivedMessage parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.ReceivedMessage 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.ReceivedMessage 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 message and its corresponding acknowledgment ID.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.ReceivedMessage} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.ReceivedMessage) - com.google.pubsub.v1.ReceivedMessageOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ReceivedMessage_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ReceivedMessage_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.ReceivedMessage.class, - com.google.pubsub.v1.ReceivedMessage.Builder.class); - } - - // Construct using com.google.pubsub.v1.ReceivedMessage.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - ackId_ = ""; - message_ = null; - if (messageBuilder_ != null) { - messageBuilder_.dispose(); - messageBuilder_ = null; - } - deliveryAttempt_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_ReceivedMessage_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.ReceivedMessage getDefaultInstanceForType() { - return com.google.pubsub.v1.ReceivedMessage.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.ReceivedMessage build() { - com.google.pubsub.v1.ReceivedMessage result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.ReceivedMessage buildPartial() { - com.google.pubsub.v1.ReceivedMessage result = new com.google.pubsub.v1.ReceivedMessage(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ReceivedMessage result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ackId_ = ackId_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.message_ = messageBuilder_ == null ? message_ : messageBuilder_.build(); - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.deliveryAttempt_ = deliveryAttempt_; - } - } - - @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.ReceivedMessage) { - return mergeFrom((com.google.pubsub.v1.ReceivedMessage) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.ReceivedMessage other) { - if (other == com.google.pubsub.v1.ReceivedMessage.getDefaultInstance()) return this; - if (!other.getAckId().isEmpty()) { - ackId_ = other.ackId_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.hasMessage()) { - mergeMessage(other.getMessage()); - } - if (other.getDeliveryAttempt() != 0) { - setDeliveryAttempt(other.getDeliveryAttempt()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - ackId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getMessageFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 24: - { - deliveryAttempt_ = input.readInt32(); - bitField0_ |= 0x00000004; - break; - } // case 24 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object ackId_ = ""; - /** - * - * - *
-     * This ID can be used to acknowledge the received message.
-     * 
- * - * string ack_id = 1; - * - * @return The ackId. - */ - public java.lang.String getAckId() { - java.lang.Object ref = ackId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - ackId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * This ID can be used to acknowledge the received message.
-     * 
- * - * string ack_id = 1; - * - * @return The bytes for ackId. - */ - public com.google.protobuf.ByteString getAckIdBytes() { - java.lang.Object ref = ackId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - ackId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * This ID can be used to acknowledge the received message.
-     * 
- * - * string ack_id = 1; - * - * @param value The ackId to set. - * @return This builder for chaining. - */ - public Builder setAckId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ackId_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * This ID can be used to acknowledge the received message.
-     * 
- * - * string ack_id = 1; - * - * @return This builder for chaining. - */ - public Builder clearAckId() { - ackId_ = getDefaultInstance().getAckId(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * This ID can be used to acknowledge the received message.
-     * 
- * - * string ack_id = 1; - * - * @param value The bytes for ackId to set. - * @return This builder for chaining. - */ - public Builder setAckIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ackId_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.pubsub.v1.PubsubMessage message_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PubsubMessage, - com.google.pubsub.v1.PubsubMessage.Builder, - com.google.pubsub.v1.PubsubMessageOrBuilder> - messageBuilder_; - /** - * - * - *
-     * The message.
-     * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - * - * @return Whether the message field is set. - */ - public boolean hasMessage() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * The message.
-     * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - * - * @return The message. - */ - public com.google.pubsub.v1.PubsubMessage getMessage() { - if (messageBuilder_ == null) { - return message_ == null - ? com.google.pubsub.v1.PubsubMessage.getDefaultInstance() - : message_; - } else { - return messageBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The message.
-     * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - */ - public Builder setMessage(com.google.pubsub.v1.PubsubMessage value) { - if (messageBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - message_ = value; - } else { - messageBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The message.
-     * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - */ - public Builder setMessage(com.google.pubsub.v1.PubsubMessage.Builder builderForValue) { - if (messageBuilder_ == null) { - message_ = builderForValue.build(); - } else { - messageBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The message.
-     * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - */ - public Builder mergeMessage(com.google.pubsub.v1.PubsubMessage value) { - if (messageBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) - && message_ != null - && message_ != com.google.pubsub.v1.PubsubMessage.getDefaultInstance()) { - getMessageBuilder().mergeFrom(value); - } else { - message_ = value; - } - } else { - messageBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The message.
-     * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - */ - public Builder clearMessage() { - bitField0_ = (bitField0_ & ~0x00000002); - message_ = null; - if (messageBuilder_ != null) { - messageBuilder_.dispose(); - messageBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * The message.
-     * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - */ - public com.google.pubsub.v1.PubsubMessage.Builder getMessageBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getMessageFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The message.
-     * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - */ - public com.google.pubsub.v1.PubsubMessageOrBuilder getMessageOrBuilder() { - if (messageBuilder_ != null) { - return messageBuilder_.getMessageOrBuilder(); - } else { - return message_ == null - ? com.google.pubsub.v1.PubsubMessage.getDefaultInstance() - : message_; - } - } - /** - * - * - *
-     * The message.
-     * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PubsubMessage, - com.google.pubsub.v1.PubsubMessage.Builder, - com.google.pubsub.v1.PubsubMessageOrBuilder> - getMessageFieldBuilder() { - if (messageBuilder_ == null) { - messageBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PubsubMessage, - com.google.pubsub.v1.PubsubMessage.Builder, - com.google.pubsub.v1.PubsubMessageOrBuilder>( - getMessage(), getParentForChildren(), isClean()); - message_ = null; - } - return messageBuilder_; - } - - private int deliveryAttempt_; - /** - * - * - *
-     * The approximate number of times that Cloud Pub/Sub has attempted to deliver
-     * the associated message to a subscriber.
-     *
-     * More precisely, this is 1 + (number of NACKs) +
-     * (number of ack_deadline exceeds) for this message.
-     *
-     * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
-     * exceeds event is whenever a message is not acknowledged within
-     * ack_deadline. Note that ack_deadline is initially
-     * Subscription.ackDeadlineSeconds, but may get extended automatically by
-     * the client library.
-     *
-     * Upon the first delivery of a given message, `delivery_attempt` will have a
-     * value of 1. The value is calculated at best effort and is approximate.
-     *
-     * If a DeadLetterPolicy is not set on the subscription, this will be 0.
-     * 
- * - * int32 delivery_attempt = 3; - * - * @return The deliveryAttempt. - */ - @java.lang.Override - public int getDeliveryAttempt() { - return deliveryAttempt_; - } - /** - * - * - *
-     * The approximate number of times that Cloud Pub/Sub has attempted to deliver
-     * the associated message to a subscriber.
-     *
-     * More precisely, this is 1 + (number of NACKs) +
-     * (number of ack_deadline exceeds) for this message.
-     *
-     * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
-     * exceeds event is whenever a message is not acknowledged within
-     * ack_deadline. Note that ack_deadline is initially
-     * Subscription.ackDeadlineSeconds, but may get extended automatically by
-     * the client library.
-     *
-     * Upon the first delivery of a given message, `delivery_attempt` will have a
-     * value of 1. The value is calculated at best effort and is approximate.
-     *
-     * If a DeadLetterPolicy is not set on the subscription, this will be 0.
-     * 
- * - * int32 delivery_attempt = 3; - * - * @param value The deliveryAttempt to set. - * @return This builder for chaining. - */ - public Builder setDeliveryAttempt(int value) { - - deliveryAttempt_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The approximate number of times that Cloud Pub/Sub has attempted to deliver
-     * the associated message to a subscriber.
-     *
-     * More precisely, this is 1 + (number of NACKs) +
-     * (number of ack_deadline exceeds) for this message.
-     *
-     * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
-     * exceeds event is whenever a message is not acknowledged within
-     * ack_deadline. Note that ack_deadline is initially
-     * Subscription.ackDeadlineSeconds, but may get extended automatically by
-     * the client library.
-     *
-     * Upon the first delivery of a given message, `delivery_attempt` will have a
-     * value of 1. The value is calculated at best effort and is approximate.
-     *
-     * If a DeadLetterPolicy is not set on the subscription, this will be 0.
-     * 
- * - * int32 delivery_attempt = 3; - * - * @return This builder for chaining. - */ - public Builder clearDeliveryAttempt() { - bitField0_ = (bitField0_ & ~0x00000004); - deliveryAttempt_ = 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.ReceivedMessage) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.ReceivedMessage) - private static final com.google.pubsub.v1.ReceivedMessage DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.ReceivedMessage(); - } - - public static com.google.pubsub.v1.ReceivedMessage getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ReceivedMessage parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.ReceivedMessage getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java deleted file mode 100644 index d5617c652..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2023 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 ReceivedMessageOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.ReceivedMessage) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * This ID can be used to acknowledge the received message.
-   * 
- * - * string ack_id = 1; - * - * @return The ackId. - */ - java.lang.String getAckId(); - /** - * - * - *
-   * This ID can be used to acknowledge the received message.
-   * 
- * - * string ack_id = 1; - * - * @return The bytes for ackId. - */ - com.google.protobuf.ByteString getAckIdBytes(); - - /** - * - * - *
-   * The message.
-   * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - * - * @return Whether the message field is set. - */ - boolean hasMessage(); - /** - * - * - *
-   * The message.
-   * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - * - * @return The message. - */ - com.google.pubsub.v1.PubsubMessage getMessage(); - /** - * - * - *
-   * The message.
-   * 
- * - * .google.pubsub.v1.PubsubMessage message = 2; - */ - com.google.pubsub.v1.PubsubMessageOrBuilder getMessageOrBuilder(); - - /** - * - * - *
-   * The approximate number of times that Cloud Pub/Sub has attempted to deliver
-   * the associated message to a subscriber.
-   *
-   * More precisely, this is 1 + (number of NACKs) +
-   * (number of ack_deadline exceeds) for this message.
-   *
-   * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
-   * exceeds event is whenever a message is not acknowledged within
-   * ack_deadline. Note that ack_deadline is initially
-   * Subscription.ackDeadlineSeconds, but may get extended automatically by
-   * the client library.
-   *
-   * Upon the first delivery of a given message, `delivery_attempt` will have a
-   * value of 1. The value is calculated at best effort and is approximate.
-   *
-   * If a DeadLetterPolicy is not set on the subscription, this will be 0.
-   * 
- * - * int32 delivery_attempt = 3; - * - * @return The deliveryAttempt. - */ - int getDeliveryAttempt(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicy.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicy.java deleted file mode 100644 index aee326393..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicy.java +++ /dev/null @@ -1,1009 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * A policy that specifies how Cloud Pub/Sub retries message delivery.
- *
- * Retry delay will be exponential based on provided minimum and maximum
- * backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.
- *
- * RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
- * events for a given message.
- *
- * Retry Policy is implemented on a best effort basis. At times, the delay
- * between consecutive deliveries may not match the configuration. That is,
- * delay can be more or less than configured backoff.
- * 
- * - * Protobuf type {@code google.pubsub.v1.RetryPolicy} - */ -public final class RetryPolicy extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.RetryPolicy) - RetryPolicyOrBuilder { - private static final long serialVersionUID = 0L; - // Use RetryPolicy.newBuilder() to construct. - private RetryPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RetryPolicy() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RetryPolicy(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_RetryPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_RetryPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.RetryPolicy.class, com.google.pubsub.v1.RetryPolicy.Builder.class); - } - - public static final int MINIMUM_BACKOFF_FIELD_NUMBER = 1; - private com.google.protobuf.Duration minimumBackoff_; - /** - * - * - *
-   * The minimum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-   * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - * - * @return Whether the minimumBackoff field is set. - */ - @java.lang.Override - public boolean hasMinimumBackoff() { - return minimumBackoff_ != null; - } - /** - * - * - *
-   * The minimum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-   * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - * - * @return The minimumBackoff. - */ - @java.lang.Override - public com.google.protobuf.Duration getMinimumBackoff() { - return minimumBackoff_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : minimumBackoff_; - } - /** - * - * - *
-   * The minimum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-   * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getMinimumBackoffOrBuilder() { - return minimumBackoff_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : minimumBackoff_; - } - - public static final int MAXIMUM_BACKOFF_FIELD_NUMBER = 2; - private com.google.protobuf.Duration maximumBackoff_; - /** - * - * - *
-   * The maximum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-   * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - * - * @return Whether the maximumBackoff field is set. - */ - @java.lang.Override - public boolean hasMaximumBackoff() { - return maximumBackoff_ != null; - } - /** - * - * - *
-   * The maximum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-   * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - * - * @return The maximumBackoff. - */ - @java.lang.Override - public com.google.protobuf.Duration getMaximumBackoff() { - return maximumBackoff_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : maximumBackoff_; - } - /** - * - * - *
-   * The maximum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-   * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getMaximumBackoffOrBuilder() { - return maximumBackoff_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : maximumBackoff_; - } - - 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 (minimumBackoff_ != null) { - output.writeMessage(1, getMinimumBackoff()); - } - if (maximumBackoff_ != null) { - output.writeMessage(2, getMaximumBackoff()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (minimumBackoff_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMinimumBackoff()); - } - if (maximumBackoff_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMaximumBackoff()); - } - size += getUnknownFields().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.RetryPolicy)) { - return super.equals(obj); - } - com.google.pubsub.v1.RetryPolicy other = (com.google.pubsub.v1.RetryPolicy) obj; - - if (hasMinimumBackoff() != other.hasMinimumBackoff()) return false; - if (hasMinimumBackoff()) { - if (!getMinimumBackoff().equals(other.getMinimumBackoff())) return false; - } - if (hasMaximumBackoff() != other.hasMaximumBackoff()) return false; - if (hasMaximumBackoff()) { - if (!getMaximumBackoff().equals(other.getMaximumBackoff())) return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasMinimumBackoff()) { - hash = (37 * hash) + MINIMUM_BACKOFF_FIELD_NUMBER; - hash = (53 * hash) + getMinimumBackoff().hashCode(); - } - if (hasMaximumBackoff()) { - hash = (37 * hash) + MAXIMUM_BACKOFF_FIELD_NUMBER; - hash = (53 * hash) + getMaximumBackoff().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.RetryPolicy parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.RetryPolicy 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.RetryPolicy parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.RetryPolicy 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.RetryPolicy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.RetryPolicy parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.RetryPolicy parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.RetryPolicy 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.RetryPolicy parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.RetryPolicy 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.RetryPolicy parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.RetryPolicy 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.RetryPolicy 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 policy that specifies how Cloud Pub/Sub retries message delivery.
-   *
-   * Retry delay will be exponential based on provided minimum and maximum
-   * backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.
-   *
-   * RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
-   * events for a given message.
-   *
-   * Retry Policy is implemented on a best effort basis. At times, the delay
-   * between consecutive deliveries may not match the configuration. That is,
-   * delay can be more or less than configured backoff.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.RetryPolicy} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.RetryPolicy) - com.google.pubsub.v1.RetryPolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_RetryPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_RetryPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.RetryPolicy.class, - com.google.pubsub.v1.RetryPolicy.Builder.class); - } - - // Construct using com.google.pubsub.v1.RetryPolicy.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - minimumBackoff_ = null; - if (minimumBackoffBuilder_ != null) { - minimumBackoffBuilder_.dispose(); - minimumBackoffBuilder_ = null; - } - maximumBackoff_ = null; - if (maximumBackoffBuilder_ != null) { - maximumBackoffBuilder_.dispose(); - maximumBackoffBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_RetryPolicy_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.RetryPolicy getDefaultInstanceForType() { - return com.google.pubsub.v1.RetryPolicy.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.RetryPolicy build() { - com.google.pubsub.v1.RetryPolicy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.RetryPolicy buildPartial() { - com.google.pubsub.v1.RetryPolicy result = new com.google.pubsub.v1.RetryPolicy(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.RetryPolicy result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.minimumBackoff_ = - minimumBackoffBuilder_ == null ? minimumBackoff_ : minimumBackoffBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.maximumBackoff_ = - maximumBackoffBuilder_ == null ? maximumBackoff_ : maximumBackoffBuilder_.build(); - } - } - - @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.RetryPolicy) { - return mergeFrom((com.google.pubsub.v1.RetryPolicy) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.RetryPolicy other) { - if (other == com.google.pubsub.v1.RetryPolicy.getDefaultInstance()) return this; - if (other.hasMinimumBackoff()) { - mergeMinimumBackoff(other.getMinimumBackoff()); - } - if (other.hasMaximumBackoff()) { - mergeMaximumBackoff(other.getMaximumBackoff()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getMinimumBackoffFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getMaximumBackoffFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.protobuf.Duration minimumBackoff_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - minimumBackoffBuilder_; - /** - * - * - *
-     * The minimum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-     * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - * - * @return Whether the minimumBackoff field is set. - */ - public boolean hasMinimumBackoff() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * The minimum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-     * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - * - * @return The minimumBackoff. - */ - public com.google.protobuf.Duration getMinimumBackoff() { - if (minimumBackoffBuilder_ == null) { - return minimumBackoff_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : minimumBackoff_; - } else { - return minimumBackoffBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The minimum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-     * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - */ - public Builder setMinimumBackoff(com.google.protobuf.Duration value) { - if (minimumBackoffBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - minimumBackoff_ = value; - } else { - minimumBackoffBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The minimum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-     * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - */ - public Builder setMinimumBackoff(com.google.protobuf.Duration.Builder builderForValue) { - if (minimumBackoffBuilder_ == null) { - minimumBackoff_ = builderForValue.build(); - } else { - minimumBackoffBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The minimum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-     * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - */ - public Builder mergeMinimumBackoff(com.google.protobuf.Duration value) { - if (minimumBackoffBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) - && minimumBackoff_ != null - && minimumBackoff_ != com.google.protobuf.Duration.getDefaultInstance()) { - getMinimumBackoffBuilder().mergeFrom(value); - } else { - minimumBackoff_ = value; - } - } else { - minimumBackoffBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The minimum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-     * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - */ - public Builder clearMinimumBackoff() { - bitField0_ = (bitField0_ & ~0x00000001); - minimumBackoff_ = null; - if (minimumBackoffBuilder_ != null) { - minimumBackoffBuilder_.dispose(); - minimumBackoffBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * The minimum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-     * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - */ - public com.google.protobuf.Duration.Builder getMinimumBackoffBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getMinimumBackoffFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The minimum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-     * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - */ - public com.google.protobuf.DurationOrBuilder getMinimumBackoffOrBuilder() { - if (minimumBackoffBuilder_ != null) { - return minimumBackoffBuilder_.getMessageOrBuilder(); - } else { - return minimumBackoff_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : minimumBackoff_; - } - } - /** - * - * - *
-     * The minimum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-     * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getMinimumBackoffFieldBuilder() { - if (minimumBackoffBuilder_ == null) { - minimumBackoffBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getMinimumBackoff(), getParentForChildren(), isClean()); - minimumBackoff_ = null; - } - return minimumBackoffBuilder_; - } - - private com.google.protobuf.Duration maximumBackoff_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - maximumBackoffBuilder_; - /** - * - * - *
-     * The maximum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-     * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - * - * @return Whether the maximumBackoff field is set. - */ - public boolean hasMaximumBackoff() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * The maximum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-     * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - * - * @return The maximumBackoff. - */ - public com.google.protobuf.Duration getMaximumBackoff() { - if (maximumBackoffBuilder_ == null) { - return maximumBackoff_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : maximumBackoff_; - } else { - return maximumBackoffBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The maximum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-     * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - */ - public Builder setMaximumBackoff(com.google.protobuf.Duration value) { - if (maximumBackoffBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - maximumBackoff_ = value; - } else { - maximumBackoffBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-     * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - */ - public Builder setMaximumBackoff(com.google.protobuf.Duration.Builder builderForValue) { - if (maximumBackoffBuilder_ == null) { - maximumBackoff_ = builderForValue.build(); - } else { - maximumBackoffBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-     * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - */ - public Builder mergeMaximumBackoff(com.google.protobuf.Duration value) { - if (maximumBackoffBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) - && maximumBackoff_ != null - && maximumBackoff_ != com.google.protobuf.Duration.getDefaultInstance()) { - getMaximumBackoffBuilder().mergeFrom(value); - } else { - maximumBackoff_ = value; - } - } else { - maximumBackoffBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-     * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - */ - public Builder clearMaximumBackoff() { - bitField0_ = (bitField0_ & ~0x00000002); - maximumBackoff_ = null; - if (maximumBackoffBuilder_ != null) { - maximumBackoffBuilder_.dispose(); - maximumBackoffBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-     * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - */ - public com.google.protobuf.Duration.Builder getMaximumBackoffBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getMaximumBackoffFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The maximum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-     * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - */ - public com.google.protobuf.DurationOrBuilder getMaximumBackoffOrBuilder() { - if (maximumBackoffBuilder_ != null) { - return maximumBackoffBuilder_.getMessageOrBuilder(); - } else { - return maximumBackoff_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : maximumBackoff_; - } - } - /** - * - * - *
-     * The maximum delay between consecutive deliveries of a given message.
-     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-     * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getMaximumBackoffFieldBuilder() { - if (maximumBackoffBuilder_ == null) { - maximumBackoffBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getMaximumBackoff(), getParentForChildren(), isClean()); - maximumBackoff_ = null; - } - return maximumBackoffBuilder_; - } - - @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.RetryPolicy) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.RetryPolicy) - private static final com.google.pubsub.v1.RetryPolicy DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.RetryPolicy(); - } - - public static com.google.pubsub.v1.RetryPolicy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RetryPolicy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.RetryPolicy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicyOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicyOrBuilder.java deleted file mode 100644 index 967fa903c..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicyOrBuilder.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2023 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 RetryPolicyOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.RetryPolicy) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The minimum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-   * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - * - * @return Whether the minimumBackoff field is set. - */ - boolean hasMinimumBackoff(); - /** - * - * - *
-   * The minimum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-   * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - * - * @return The minimumBackoff. - */ - com.google.protobuf.Duration getMinimumBackoff(); - /** - * - * - *
-   * The minimum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
-   * 
- * - * .google.protobuf.Duration minimum_backoff = 1; - */ - com.google.protobuf.DurationOrBuilder getMinimumBackoffOrBuilder(); - - /** - * - * - *
-   * The maximum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-   * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - * - * @return Whether the maximumBackoff field is set. - */ - boolean hasMaximumBackoff(); - /** - * - * - *
-   * The maximum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-   * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - * - * @return The maximumBackoff. - */ - com.google.protobuf.Duration getMaximumBackoff(); - /** - * - * - *
-   * The maximum delay between consecutive deliveries of a given message.
-   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
-   * 
- * - * .google.protobuf.Duration maximum_backoff = 2; - */ - com.google.protobuf.DurationOrBuilder getMaximumBackoffOrBuilder(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RollbackSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RollbackSchemaRequest.java deleted file mode 100644 index 6de995c70..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RollbackSchemaRequest.java +++ /dev/null @@ -1,840 +0,0 @@ -/* - * Copyright 2023 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 `RollbackSchema` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.RollbackSchemaRequest} - */ -public final class RollbackSchemaRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.RollbackSchemaRequest) - RollbackSchemaRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use RollbackSchemaRequest.newBuilder() to construct. - private RollbackSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private RollbackSchemaRequest() { - name_ = ""; - revisionId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RollbackSchemaRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_RollbackSchemaRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_RollbackSchemaRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.RollbackSchemaRequest.class, - com.google.pubsub.v1.RollbackSchemaRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * Required. The schema being rolled back with revision id.
-   * 
- * - * - * 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 schema being rolled back with revision id.
-   * 
- * - * - * 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 REVISION_ID_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object revisionId_ = ""; - /** - * - * - *
-   * Required. The revision ID to roll back to.
-   * It must be a revision of the same schema.
-   *
-   *   Example: c7cfa2a8
-   * 
- * - * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The revisionId. - */ - @java.lang.Override - public java.lang.String getRevisionId() { - java.lang.Object ref = revisionId_; - 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(); - revisionId_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The revision ID to roll back to.
-   * It must be a revision of the same schema.
-   *
-   *   Example: c7cfa2a8
-   * 
- * - * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for revisionId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRevisionIdBytes() { - java.lang.Object ref = revisionId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - revisionId_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, revisionId_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, revisionId_); - } - size += getUnknownFields().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.RollbackSchemaRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.RollbackSchemaRequest other = - (com.google.pubsub.v1.RollbackSchemaRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (!getRevisionId().equals(other.getRevisionId())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REVISION_ID_FIELD_NUMBER; - hash = (53 * hash) + getRevisionId().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.RollbackSchemaRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.RollbackSchemaRequest 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.RollbackSchemaRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.RollbackSchemaRequest 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.RollbackSchemaRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.RollbackSchemaRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.RollbackSchemaRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.RollbackSchemaRequest 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.RollbackSchemaRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.RollbackSchemaRequest 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.RollbackSchemaRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.RollbackSchemaRequest 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.RollbackSchemaRequest 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 `RollbackSchema` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.RollbackSchemaRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.RollbackSchemaRequest) - com.google.pubsub.v1.RollbackSchemaRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_RollbackSchemaRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_RollbackSchemaRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.RollbackSchemaRequest.class, - com.google.pubsub.v1.RollbackSchemaRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.RollbackSchemaRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - revisionId_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.SchemaProto - .internal_static_google_pubsub_v1_RollbackSchemaRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.RollbackSchemaRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.RollbackSchemaRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.RollbackSchemaRequest build() { - com.google.pubsub.v1.RollbackSchemaRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.RollbackSchemaRequest buildPartial() { - com.google.pubsub.v1.RollbackSchemaRequest result = - new com.google.pubsub.v1.RollbackSchemaRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.RollbackSchemaRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.revisionId_ = revisionId_; - } - } - - @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.RollbackSchemaRequest) { - return mergeFrom((com.google.pubsub.v1.RollbackSchemaRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.RollbackSchemaRequest other) { - if (other == com.google.pubsub.v1.RollbackSchemaRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getRevisionId().isEmpty()) { - revisionId_ = other.revisionId_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - revisionId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The schema being rolled back with revision id.
-     * 
- * - * - * 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 schema being rolled back with revision id.
-     * 
- * - * - * 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 schema being rolled back with revision id.
-     * 
- * - * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The schema being rolled back with revision id.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The schema being rolled back with revision id.
-     * 
- * - * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object revisionId_ = ""; - /** - * - * - *
-     * Required. The revision ID to roll back to.
-     * It must be a revision of the same schema.
-     *
-     *   Example: c7cfa2a8
-     * 
- * - * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The revisionId. - */ - public java.lang.String getRevisionId() { - java.lang.Object ref = revisionId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - revisionId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The revision ID to roll back to.
-     * It must be a revision of the same schema.
-     *
-     *   Example: c7cfa2a8
-     * 
- * - * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for revisionId. - */ - public com.google.protobuf.ByteString getRevisionIdBytes() { - java.lang.Object ref = revisionId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - revisionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The revision ID to roll back to.
-     * It must be a revision of the same schema.
-     *
-     *   Example: c7cfa2a8
-     * 
- * - * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The revisionId to set. - * @return This builder for chaining. - */ - public Builder setRevisionId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - revisionId_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The revision ID to roll back to.
-     * It must be a revision of the same schema.
-     *
-     *   Example: c7cfa2a8
-     * 
- * - * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearRevisionId() { - revisionId_ = getDefaultInstance().getRevisionId(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The revision ID to roll back to.
-     * It must be a revision of the same schema.
-     *
-     *   Example: c7cfa2a8
-     * 
- * - * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for revisionId to set. - * @return This builder for chaining. - */ - public Builder setRevisionIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - revisionId_ = value; - bitField0_ |= 0x00000002; - 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.RollbackSchemaRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.RollbackSchemaRequest) - private static final com.google.pubsub.v1.RollbackSchemaRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.RollbackSchemaRequest(); - } - - public static com.google.pubsub.v1.RollbackSchemaRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RollbackSchemaRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.RollbackSchemaRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RollbackSchemaRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RollbackSchemaRequestOrBuilder.java deleted file mode 100644 index b7562292e..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RollbackSchemaRequestOrBuilder.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2023 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 RollbackSchemaRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.RollbackSchemaRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The schema being rolled back with revision id.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. The schema being rolled back with revision id.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Required. The revision ID to roll back to.
-   * It must be a revision of the same schema.
-   *
-   *   Example: c7cfa2a8
-   * 
- * - * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The revisionId. - */ - java.lang.String getRevisionId(); - /** - * - * - *
-   * Required. The revision ID to roll back to.
-   * It must be a revision of the same schema.
-   *
-   *   Example: c7cfa2a8
-   * 
- * - * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for revisionId. - */ - com.google.protobuf.ByteString getRevisionIdBytes(); -} 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 deleted file mode 100644 index 7cdbcff9e..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Schema.java +++ /dev/null @@ -1,1609 +0,0 @@ -/* - * Copyright 2023 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_ = ""; - revisionId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Schema(); - } - - 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; - - @SuppressWarnings("serial") - 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_ = 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; - * - * @return The type. - */ - @java.lang.Override - public com.google.pubsub.v1.Schema.Type getType() { - com.google.pubsub.v1.Schema.Type result = com.google.pubsub.v1.Schema.Type.forNumber(type_); - return result == null ? com.google.pubsub.v1.Schema.Type.UNRECOGNIZED : result; - } - - public static final int DEFINITION_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - 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; - } - } - - public static final int REVISION_ID_FIELD_NUMBER = 4; - - @SuppressWarnings("serial") - private volatile java.lang.Object revisionId_ = ""; - /** - * - * - *
-   * Output only. Immutable. The revision ID of the schema.
-   * 
- * - * - * string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The revisionId. - */ - @java.lang.Override - public java.lang.String getRevisionId() { - java.lang.Object ref = revisionId_; - 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(); - revisionId_ = s; - return s; - } - } - /** - * - * - *
-   * Output only. Immutable. The revision ID of the schema.
-   * 
- * - * - * string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The bytes for revisionId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRevisionIdBytes() { - java.lang.Object ref = revisionId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - revisionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int REVISION_CREATE_TIME_FIELD_NUMBER = 6; - private com.google.protobuf.Timestamp revisionCreateTime_; - /** - * - * - *
-   * Output only. The timestamp that the revision was created.
-   * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the revisionCreateTime field is set. - */ - @java.lang.Override - public boolean hasRevisionCreateTime() { - return revisionCreateTime_ != null; - } - /** - * - * - *
-   * Output only. The timestamp that the revision was created.
-   * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The revisionCreateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getRevisionCreateTime() { - return revisionCreateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : revisionCreateTime_; - } - /** - * - * - *
-   * Output only. The timestamp that the revision was created.
-   * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getRevisionCreateTimeOrBuilder() { - return revisionCreateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : revisionCreateTime_; - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (type_ != com.google.pubsub.v1.Schema.Type.TYPE_UNSPECIFIED.getNumber()) { - output.writeEnum(2, type_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(definition_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, definition_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, revisionId_); - } - if (revisionCreateTime_ != null) { - output.writeMessage(6, getRevisionCreateTime()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(definition_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, definition_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, revisionId_); - } - if (revisionCreateTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getRevisionCreateTime()); - } - size += getUnknownFields().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 (!getRevisionId().equals(other.getRevisionId())) return false; - if (hasRevisionCreateTime() != other.hasRevisionCreateTime()) return false; - if (hasRevisionCreateTime()) { - if (!getRevisionCreateTime().equals(other.getRevisionCreateTime())) return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (37 * hash) + REVISION_ID_FIELD_NUMBER; - hash = (53 * hash) + getRevisionId().hashCode(); - if (hasRevisionCreateTime()) { - hash = (37 * hash) + REVISION_CREATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getRevisionCreateTime().hashCode(); - } - hash = (29 * hash) + getUnknownFields().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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - type_ = 0; - definition_ = ""; - revisionId_ = ""; - revisionCreateTime_ = null; - if (revisionCreateTimeBuilder_ != null) { - revisionCreateTimeBuilder_.dispose(); - revisionCreateTimeBuilder_ = null; - } - 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); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.Schema result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.type_ = type_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.definition_ = definition_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.revisionId_ = revisionId_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.revisionCreateTime_ = - revisionCreateTimeBuilder_ == null - ? revisionCreateTime_ - : revisionCreateTimeBuilder_.build(); - } - } - - @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_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.type_ != 0) { - setTypeValue(other.getTypeValue()); - } - if (!other.getDefinition().isEmpty()) { - definition_ = other.definition_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (!other.getRevisionId().isEmpty()) { - revisionId_ = other.revisionId_; - bitField0_ |= 0x00000008; - onChanged(); - } - if (other.hasRevisionCreateTime()) { - mergeRevisionCreateTime(other.getRevisionCreateTime()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - type_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: - { - definition_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 34: - { - revisionId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; - break; - } // case 34 - case 50: - { - input.readMessage( - getRevisionCreateTimeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000010; - break; - } // case 50 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - 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; - bitField0_ |= 0x00000001; - 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(); - bitField0_ = (bitField0_ & ~0x00000001); - 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; - bitField0_ |= 0x00000001; - 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; - bitField0_ |= 0x00000002; - 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() { - com.google.pubsub.v1.Schema.Type result = com.google.pubsub.v1.Schema.Type.forNumber(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(); - } - bitField0_ |= 0x00000002; - 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() { - bitField0_ = (bitField0_ & ~0x00000002); - 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; - bitField0_ |= 0x00000004; - 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(); - bitField0_ = (bitField0_ & ~0x00000004); - 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; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - private java.lang.Object revisionId_ = ""; - /** - * - * - *
-     * Output only. Immutable. The revision ID of the schema.
-     * 
- * - * - * string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The revisionId. - */ - public java.lang.String getRevisionId() { - java.lang.Object ref = revisionId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - revisionId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Output only. Immutable. The revision ID of the schema.
-     * 
- * - * - * string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The bytes for revisionId. - */ - public com.google.protobuf.ByteString getRevisionIdBytes() { - java.lang.Object ref = revisionId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - revisionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Output only. Immutable. The revision ID of the schema.
-     * 
- * - * - * string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The revisionId to set. - * @return This builder for chaining. - */ - public Builder setRevisionId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - revisionId_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Immutable. The revision ID of the schema.
-     * 
- * - * - * string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return This builder for chaining. - */ - public Builder clearRevisionId() { - revisionId_ = getDefaultInstance().getRevisionId(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Immutable. The revision ID of the schema.
-     * 
- * - * - * string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The bytes for revisionId to set. - * @return This builder for chaining. - */ - public Builder setRevisionIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - revisionId_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp revisionCreateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - revisionCreateTimeBuilder_; - /** - * - * - *
-     * Output only. The timestamp that the revision was created.
-     * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the revisionCreateTime field is set. - */ - public boolean hasRevisionCreateTime() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-     * Output only. The timestamp that the revision was created.
-     * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The revisionCreateTime. - */ - public com.google.protobuf.Timestamp getRevisionCreateTime() { - if (revisionCreateTimeBuilder_ == null) { - return revisionCreateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : revisionCreateTime_; - } else { - return revisionCreateTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. The timestamp that the revision was created.
-     * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setRevisionCreateTime(com.google.protobuf.Timestamp value) { - if (revisionCreateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - revisionCreateTime_ = value; - } else { - revisionCreateTimeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The timestamp that the revision was created.
-     * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setRevisionCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (revisionCreateTimeBuilder_ == null) { - revisionCreateTime_ = builderForValue.build(); - } else { - revisionCreateTimeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The timestamp that the revision was created.
-     * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeRevisionCreateTime(com.google.protobuf.Timestamp value) { - if (revisionCreateTimeBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) - && revisionCreateTime_ != null - && revisionCreateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - getRevisionCreateTimeBuilder().mergeFrom(value); - } else { - revisionCreateTime_ = value; - } - } else { - revisionCreateTimeBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The timestamp that the revision was created.
-     * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearRevisionCreateTime() { - bitField0_ = (bitField0_ & ~0x00000010); - revisionCreateTime_ = null; - if (revisionCreateTimeBuilder_ != null) { - revisionCreateTimeBuilder_.dispose(); - revisionCreateTimeBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. The timestamp that the revision was created.
-     * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getRevisionCreateTimeBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return getRevisionCreateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. The timestamp that the revision was created.
-     * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getRevisionCreateTimeOrBuilder() { - if (revisionCreateTimeBuilder_ != null) { - return revisionCreateTimeBuilder_.getMessageOrBuilder(); - } else { - return revisionCreateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : revisionCreateTime_; - } - } - /** - * - * - *
-     * Output only. The timestamp that the revision was created.
-     * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getRevisionCreateTimeFieldBuilder() { - if (revisionCreateTimeBuilder_ == null) { - revisionCreateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getRevisionCreateTime(), getParentForChildren(), isClean()); - revisionCreateTime_ = null; - } - return revisionCreateTimeBuilder_; - } - - @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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index 2d8968ddf..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaName.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2023 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; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class SchemaName implements ResourceName { - private static final PathTemplate PROJECT_SCHEMA = - PathTemplate.createWithoutUrlEncoding("projects/{project}/schemas/{schema}"); - private volatile Map fieldValuesMap; - private final String project; - private final String schema; - - @Deprecated - protected SchemaName() { - project = null; - schema = null; - } - - private SchemaName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - schema = Preconditions.checkNotNull(builder.getSchema()); - } - - public String getProject() { - return project; - } - - public String getSchema() { - return schema; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - 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 = - PROJECT_SCHEMA.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 PROJECT_SCHEMA.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (schema != null) { - fieldMapBuilder.put("schema", schema); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_SCHEMA.instantiate("project", project, "schema", schema); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null && getClass() == o.getClass()) { - SchemaName that = ((SchemaName) o); - return Objects.equals(this.project, that.project) && Objects.equals(this.schema, that.schema); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(schema); - return h; - } - - /** Builder for projects/{project}/schemas/{schema}. */ - public static class Builder { - private String project; - private String schema; - - protected Builder() {} - - 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(SchemaName schemaName) { - this.project = schemaName.project; - this.schema = schemaName.schema; - } - - public SchemaName build() { - return new SchemaName(this); - } - } -} 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 deleted file mode 100644 index 98612c8c1..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaOrBuilder.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright 2023 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(); - - /** - * - * - *
-   * Output only. Immutable. The revision ID of the schema.
-   * 
- * - * - * string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The revisionId. - */ - java.lang.String getRevisionId(); - /** - * - * - *
-   * Output only. Immutable. The revision ID of the schema.
-   * 
- * - * - * string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The bytes for revisionId. - */ - com.google.protobuf.ByteString getRevisionIdBytes(); - - /** - * - * - *
-   * Output only. The timestamp that the revision was created.
-   * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the revisionCreateTime field is set. - */ - boolean hasRevisionCreateTime(); - /** - * - * - *
-   * Output only. The timestamp that the revision was created.
-   * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The revisionCreateTime. - */ - com.google.protobuf.Timestamp getRevisionCreateTime(); - /** - * - * - *
-   * Output only. The timestamp that the revision was created.
-   * 
- * - * - * .google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getRevisionCreateTimeOrBuilder(); -} 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 deleted file mode 100644 index 296a9bc5c..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaProto.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright 2023 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_ListSchemaRevisionsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListSchemaRevisionsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_ListSchemaRevisionsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_ListSchemaRevisionsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_CommitSchemaRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_CommitSchemaRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_RollbackSchemaRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_RollbackSchemaRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_pubsub_v1_DeleteSchemaRevisionRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_pubsub_v1_DeleteSchemaRevisionRequest_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\032\037googl" - + "e/protobuf/timestamp.proto\"\276\002\n\006Schema\022\022\n" - + "\004name\030\001 \001(\tB\004\342A\001\002\022+\n\004type\030\002 \001(\0162\035.google" - + ".pubsub.v1.Schema.Type\022\022\n\ndefinition\030\003 \001" - + "(\t\022\032\n\013revision_id\030\004 \001(\tB\005\342A\002\005\003\022>\n\024revisi" - + "on_create_time\030\006 \001(\0132\032.google.protobuf.T" - + "imestampB\004\342A\001\003\";\n\004Type\022\024\n\020TYPE_UNSPECIFI" - + "ED\020\000\022\023\n\017PROTOCOL_BUFFER\020\001\022\010\n\004AVRO\020\002:F\352AC" - + "\n\034pubsub.googleapis.com/Schema\022#projects" - + "/{project}/schemas/{schema}\"\217\001\n\023CreateSc" - + "hemaRequest\0225\n\006parent\030\001 \001(\tB%\342A\001\002\372A\036\022\034pu" - + "bsub.googleapis.com/Schema\022.\n\006schema\030\002 \001" - + "(\0132\030.google.pubsub.v1.SchemaB\004\342A\001\002\022\021\n\tsc" - + "hema_id\030\003 \001(\t\"s\n\020GetSchemaRequest\0223\n\004nam" - + "e\030\001 \001(\tB%\342A\001\002\372A\036\n\034pubsub.googleapis.com/" - + "Schema\022*\n\004view\030\002 \001(\0162\034.google.pubsub.v1." - + "SchemaView\"\255\001\n\022ListSchemasRequest\022D\n\006par" - + "ent\030\001 \001(\tB4\342A\001\002\372A-\n+cloudresourcemanager" - + ".googleapis.com/Project\022*\n\004view\030\002 \001(\0162\034." - + "google.pubsub.v1.SchemaView\022\021\n\tpage_size" - + "\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"Y\n\023ListSchema" - + "sResponse\022)\n\007schemas\030\001 \003(\0132\030.google.pubs" - + "ub.v1.Schema\022\027\n\017next_page_token\030\002 \001(\t\"\244\001" - + "\n\032ListSchemaRevisionsRequest\0223\n\004name\030\001 \001" - + "(\tB%\342A\001\002\372A\036\n\034pubsub.googleapis.com/Schem" - + "a\022*\n\004view\030\002 \001(\0162\034.google.pubsub.v1.Schem" - + "aView\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004" - + " \001(\t\"a\n\033ListSchemaRevisionsResponse\022)\n\007s" - + "chemas\030\001 \003(\0132\030.google.pubsub.v1.Schema\022\027" - + "\n\017next_page_token\030\002 \001(\t\"z\n\023CommitSchemaR" - + "equest\0223\n\004name\030\001 \001(\tB%\342A\001\002\372A\036\n\034pubsub.go" - + "ogleapis.com/Schema\022.\n\006schema\030\002 \001(\0132\030.go" - + "ogle.pubsub.v1.SchemaB\004\342A\001\002\"g\n\025RollbackS" - + "chemaRequest\0223\n\004name\030\001 \001(\tB%\342A\001\002\372A\036\n\034pub" - + "sub.googleapis.com/Schema\022\031\n\013revision_id" - + "\030\002 \001(\tB\004\342A\001\002\"o\n\033DeleteSchemaRevisionRequ" - + "est\0223\n\004name\030\001 \001(\tB%\342A\001\002\372A\036\n\034pubsub.googl" - + "eapis.com/Schema\022\033\n\013revision_id\030\002 \001(\tB\006\030" - + "\001\342A\001\001\"J\n\023DeleteSchemaRequest\0223\n\004name\030\001 \001" - + "(\tB%\342A\001\002\372A\036\n\034pubsub.googleapis.com/Schem" - + "a\"\215\001\n\025ValidateSchemaRequest\022D\n\006parent\030\001 " - + "\001(\tB4\342A\001\002\372A-\n+cloudresourcemanager.googl" - + "eapis.com/Project\022.\n\006schema\030\002 \001(\0132\030.goog" - + "le.pubsub.v1.SchemaB\004\342A\001\002\"\030\n\026ValidateSch" - + "emaResponse\"\213\002\n\026ValidateMessageRequest\022D" - + "\n\006parent\030\001 \001(\tB4\342A\001\002\372A-\n+cloudresourcema" - + "nager.googleapis.com/Project\0221\n\004name\030\002 \001" - + "(\tB!\372A\036\n\034pubsub.googleapis.com/SchemaH\000\022" - + "*\n\006schema\030\003 \001(\0132\030.google.pubsub.v1.Schem" - + "aH\000\022\017\n\007message\030\004 \001(\014\022,\n\010encoding\030\005 \001(\0162\032" - + ".google.pubsub.v1.EncodingB\r\n\013schema_spe" - + "c\"\031\n\027ValidateMessageResponse*>\n\nSchemaVi" - + "ew\022\033\n\027SCHEMA_VIEW_UNSPECIFIED\020\000\022\t\n\005BASIC" - + "\020\001\022\010\n\004FULL\020\002*:\n\010Encoding\022\030\n\024ENCODING_UNS" - + "PECIFIED\020\000\022\010\n\004JSON\020\001\022\n\n\006BINARY\020\0022\210\r\n\rSch" - + "emaService\022\232\001\n\014CreateSchema\022%.google.pub" - + "sub.v1.CreateSchemaRequest\032\030.google.pubs" - + "ub.v1.Schema\"I\332A\027parent,schema,schema_id" - + "\202\323\344\223\002)\"\037/v1/{parent=projects/*}/schemas:" - + "\006schema\022y\n\tGetSchema\022\".google.pubsub.v1." - + "GetSchemaRequest\032\030.google.pubsub.v1.Sche" - + "ma\".\332A\004name\202\323\344\223\002!\022\037/v1/{name=projects/*/" - + "schemas/*}\022\214\001\n\013ListSchemas\022$.google.pubs" - + "ub.v1.ListSchemasRequest\032%.google.pubsub" - + ".v1.ListSchemasResponse\"0\332A\006parent\202\323\344\223\002!" - + "\022\037/v1/{parent=projects/*}/schemas\022\260\001\n\023Li" - + "stSchemaRevisions\022,.google.pubsub.v1.Lis" - + "tSchemaRevisionsRequest\032-.google.pubsub." - + "v1.ListSchemaRevisionsResponse\"<\332A\004name\202" - + "\323\344\223\002/\022-/v1/{name=projects/*/schemas/*}:l" - + "istRevisions\022\220\001\n\014CommitSchema\022%.google.p" - + "ubsub.v1.CommitSchemaRequest\032\030.google.pu" - + "bsub.v1.Schema\"?\332A\013name,schema\202\323\344\223\002+\"&/v" - + "1/{name=projects/*/schemas/*}:commit:\001*\022" - + "\233\001\n\016RollbackSchema\022\'.google.pubsub.v1.Ro" - + "llbackSchemaRequest\032\030.google.pubsub.v1.S" - + "chema\"F\332A\020name,revision_id\202\323\344\223\002-\"(/v1/{n" - + "ame=projects/*/schemas/*}:rollback:\001*\022\252\001" - + "\n\024DeleteSchemaRevision\022-.google.pubsub.v" - + "1.DeleteSchemaRevisionRequest\032\030.google.p" - + "ubsub.v1.Schema\"I\332A\020name,revision_id\202\323\344\223" - + "\0020*./v1/{name=projects/*/schemas/*}:dele" - + "teRevision\022}\n\014DeleteSchema\022%.google.pubs" - + "ub.v1.DeleteSchemaRequest\032\026.google.proto" - + "buf.Empty\".\332A\004name\202\323\344\223\002!*\037/v1/{name=proj" - + "ects/*/schemas/*}\022\250\001\n\016ValidateSchema\022\'.g" - + "oogle.pubsub.v1.ValidateSchemaRequest\032(." - + "google.pubsub.v1.ValidateSchemaResponse\"" - + "C\332A\rparent,schema\202\323\344\223\002-\"(/v1/{parent=pro" - + "jects/*}/schemas:validate:\001*\022\242\001\n\017Validat" - + "eMessage\022(.google.pubsub.v1.ValidateMess" - + "ageRequest\032).google.pubsub.v1.ValidateMe" - + "ssageResponse\":\202\323\344\223\0024\"//v1/{parent=proje" - + "cts/*}/schemas:validateMessage:\001*\032p\312A\025pu" - + "bsub.googleapis.com\322AUhttps://www.google" - + "apis.com/auth/cloud-platform,https://www" - + ".googleapis.com/auth/pubsubB\252\001\n\024com.goog" - + "le.pubsub.v1B\013SchemaProtoP\001Z2cloud.googl" - + "e.com/go/pubsub/apiv1/pubsubpb;pubsubpb\370" - + "\001\001\252\002\026Google.Cloud.PubSub.V1\312\002\026Google\\Clo" - + "ud\\PubSub\\V1\352\002\031Google::Cloud::PubSub::V1" - + "b\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(), - com.google.protobuf.TimestampProto.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", "RevisionId", "RevisionCreateTime", - }); - 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_ListSchemaRevisionsRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_pubsub_v1_ListSchemaRevisionsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListSchemaRevisionsRequest_descriptor, - new java.lang.String[] { - "Name", "View", "PageSize", "PageToken", - }); - internal_static_google_pubsub_v1_ListSchemaRevisionsResponse_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_pubsub_v1_ListSchemaRevisionsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_ListSchemaRevisionsResponse_descriptor, - new java.lang.String[] { - "Schemas", "NextPageToken", - }); - internal_static_google_pubsub_v1_CommitSchemaRequest_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_pubsub_v1_CommitSchemaRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_CommitSchemaRequest_descriptor, - new java.lang.String[] { - "Name", "Schema", - }); - internal_static_google_pubsub_v1_RollbackSchemaRequest_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_pubsub_v1_RollbackSchemaRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_RollbackSchemaRequest_descriptor, - new java.lang.String[] { - "Name", "RevisionId", - }); - internal_static_google_pubsub_v1_DeleteSchemaRevisionRequest_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_pubsub_v1_DeleteSchemaRevisionRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_pubsub_v1_DeleteSchemaRevisionRequest_descriptor, - new java.lang.String[] { - "Name", "RevisionId", - }); - internal_static_google_pubsub_v1_DeleteSchemaRequest_descriptor = - getDescriptor().getMessageTypes().get(10); - 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(11); - 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(12); - 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(13); - 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(14); - 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(); - com.google.protobuf.TimestampProto.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 deleted file mode 100644 index e43b99679..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettings.java +++ /dev/null @@ -1,1193 +0,0 @@ -/* - * Copyright 2023 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; - firstRevisionId_ = ""; - lastRevisionId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SchemaSettings(); - } - - 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; - - @SuppressWarnings("serial") - 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_ = 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; - * - * @return The encoding. - */ - @java.lang.Override - public com.google.pubsub.v1.Encoding getEncoding() { - com.google.pubsub.v1.Encoding result = com.google.pubsub.v1.Encoding.forNumber(encoding_); - return result == null ? com.google.pubsub.v1.Encoding.UNRECOGNIZED : result; - } - - public static final int FIRST_REVISION_ID_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object firstRevisionId_ = ""; - /** - * - * - *
-   * The minimum (inclusive) revision allowed for validating messages. If empty
-   * or not present, allow any revision to be validated against last_revision or
-   * any revision created before.
-   * 
- * - * string first_revision_id = 3; - * - * @return The firstRevisionId. - */ - @java.lang.Override - public java.lang.String getFirstRevisionId() { - java.lang.Object ref = firstRevisionId_; - 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(); - firstRevisionId_ = s; - return s; - } - } - /** - * - * - *
-   * The minimum (inclusive) revision allowed for validating messages. If empty
-   * or not present, allow any revision to be validated against last_revision or
-   * any revision created before.
-   * 
- * - * string first_revision_id = 3; - * - * @return The bytes for firstRevisionId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getFirstRevisionIdBytes() { - java.lang.Object ref = firstRevisionId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - firstRevisionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LAST_REVISION_ID_FIELD_NUMBER = 4; - - @SuppressWarnings("serial") - private volatile java.lang.Object lastRevisionId_ = ""; - /** - * - * - *
-   * The maximum (inclusive) revision allowed for validating messages. If empty
-   * or not present, allow any revision to be validated against first_revision
-   * or any revision created after.
-   * 
- * - * string last_revision_id = 4; - * - * @return The lastRevisionId. - */ - @java.lang.Override - public java.lang.String getLastRevisionId() { - java.lang.Object ref = lastRevisionId_; - 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(); - lastRevisionId_ = s; - return s; - } - } - /** - * - * - *
-   * The maximum (inclusive) revision allowed for validating messages. If empty
-   * or not present, allow any revision to be validated against first_revision
-   * or any revision created after.
-   * 
- * - * string last_revision_id = 4; - * - * @return The bytes for lastRevisionId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getLastRevisionIdBytes() { - java.lang.Object ref = lastRevisionId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - lastRevisionId_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schema_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, schema_); - } - if (encoding_ != com.google.pubsub.v1.Encoding.ENCODING_UNSPECIFIED.getNumber()) { - output.writeEnum(2, encoding_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(firstRevisionId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, firstRevisionId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastRevisionId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, lastRevisionId_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schema_)) { - 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_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(firstRevisionId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, firstRevisionId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastRevisionId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, lastRevisionId_); - } - size += getUnknownFields().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 (!getFirstRevisionId().equals(other.getFirstRevisionId())) return false; - if (!getLastRevisionId().equals(other.getLastRevisionId())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (37 * hash) + FIRST_REVISION_ID_FIELD_NUMBER; - hash = (53 * hash) + getFirstRevisionId().hashCode(); - hash = (37 * hash) + LAST_REVISION_ID_FIELD_NUMBER; - hash = (53 * hash) + getLastRevisionId().hashCode(); - hash = (29 * hash) + getUnknownFields().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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - schema_ = ""; - encoding_ = 0; - firstRevisionId_ = ""; - lastRevisionId_ = ""; - 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); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.SchemaSettings result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.schema_ = schema_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.encoding_ = encoding_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.firstRevisionId_ = firstRevisionId_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.lastRevisionId_ = lastRevisionId_; - } - } - - @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_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.encoding_ != 0) { - setEncodingValue(other.getEncodingValue()); - } - if (!other.getFirstRevisionId().isEmpty()) { - firstRevisionId_ = other.firstRevisionId_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (!other.getLastRevisionId().isEmpty()) { - lastRevisionId_ = other.lastRevisionId_; - bitField0_ |= 0x00000008; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - schema_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - encoding_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: - { - firstRevisionId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 34: - { - lastRevisionId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; - break; - } // case 34 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - 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; - bitField0_ |= 0x00000001; - 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(); - bitField0_ = (bitField0_ & ~0x00000001); - 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; - bitField0_ |= 0x00000001; - 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; - bitField0_ |= 0x00000002; - 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() { - com.google.pubsub.v1.Encoding result = com.google.pubsub.v1.Encoding.forNumber(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(); - } - bitField0_ |= 0x00000002; - 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() { - bitField0_ = (bitField0_ & ~0x00000002); - encoding_ = 0; - onChanged(); - return this; - } - - private java.lang.Object firstRevisionId_ = ""; - /** - * - * - *
-     * The minimum (inclusive) revision allowed for validating messages. If empty
-     * or not present, allow any revision to be validated against last_revision or
-     * any revision created before.
-     * 
- * - * string first_revision_id = 3; - * - * @return The firstRevisionId. - */ - public java.lang.String getFirstRevisionId() { - java.lang.Object ref = firstRevisionId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - firstRevisionId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The minimum (inclusive) revision allowed for validating messages. If empty
-     * or not present, allow any revision to be validated against last_revision or
-     * any revision created before.
-     * 
- * - * string first_revision_id = 3; - * - * @return The bytes for firstRevisionId. - */ - public com.google.protobuf.ByteString getFirstRevisionIdBytes() { - java.lang.Object ref = firstRevisionId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - firstRevisionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The minimum (inclusive) revision allowed for validating messages. If empty
-     * or not present, allow any revision to be validated against last_revision or
-     * any revision created before.
-     * 
- * - * string first_revision_id = 3; - * - * @param value The firstRevisionId to set. - * @return This builder for chaining. - */ - public Builder setFirstRevisionId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - firstRevisionId_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The minimum (inclusive) revision allowed for validating messages. If empty
-     * or not present, allow any revision to be validated against last_revision or
-     * any revision created before.
-     * 
- * - * string first_revision_id = 3; - * - * @return This builder for chaining. - */ - public Builder clearFirstRevisionId() { - firstRevisionId_ = getDefaultInstance().getFirstRevisionId(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-     * The minimum (inclusive) revision allowed for validating messages. If empty
-     * or not present, allow any revision to be validated against last_revision or
-     * any revision created before.
-     * 
- * - * string first_revision_id = 3; - * - * @param value The bytes for firstRevisionId to set. - * @return This builder for chaining. - */ - public Builder setFirstRevisionIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - firstRevisionId_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - private java.lang.Object lastRevisionId_ = ""; - /** - * - * - *
-     * The maximum (inclusive) revision allowed for validating messages. If empty
-     * or not present, allow any revision to be validated against first_revision
-     * or any revision created after.
-     * 
- * - * string last_revision_id = 4; - * - * @return The lastRevisionId. - */ - public java.lang.String getLastRevisionId() { - java.lang.Object ref = lastRevisionId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - lastRevisionId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The maximum (inclusive) revision allowed for validating messages. If empty
-     * or not present, allow any revision to be validated against first_revision
-     * or any revision created after.
-     * 
- * - * string last_revision_id = 4; - * - * @return The bytes for lastRevisionId. - */ - public com.google.protobuf.ByteString getLastRevisionIdBytes() { - java.lang.Object ref = lastRevisionId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - lastRevisionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The maximum (inclusive) revision allowed for validating messages. If empty
-     * or not present, allow any revision to be validated against first_revision
-     * or any revision created after.
-     * 
- * - * string last_revision_id = 4; - * - * @param value The lastRevisionId to set. - * @return This builder for chaining. - */ - public Builder setLastRevisionId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - lastRevisionId_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum (inclusive) revision allowed for validating messages. If empty
-     * or not present, allow any revision to be validated against first_revision
-     * or any revision created after.
-     * 
- * - * string last_revision_id = 4; - * - * @return This builder for chaining. - */ - public Builder clearLastRevisionId() { - lastRevisionId_ = getDefaultInstance().getLastRevisionId(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum (inclusive) revision allowed for validating messages. If empty
-     * or not present, allow any revision to be validated against first_revision
-     * or any revision created after.
-     * 
- * - * string last_revision_id = 4; - * - * @param value The bytes for lastRevisionId to set. - * @return This builder for chaining. - */ - public Builder setLastRevisionIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - lastRevisionId_ = value; - bitField0_ |= 0x00000008; - 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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index b65abdf20..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettingsOrBuilder.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2023 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(); - - /** - * - * - *
-   * The minimum (inclusive) revision allowed for validating messages. If empty
-   * or not present, allow any revision to be validated against last_revision or
-   * any revision created before.
-   * 
- * - * string first_revision_id = 3; - * - * @return The firstRevisionId. - */ - java.lang.String getFirstRevisionId(); - /** - * - * - *
-   * The minimum (inclusive) revision allowed for validating messages. If empty
-   * or not present, allow any revision to be validated against last_revision or
-   * any revision created before.
-   * 
- * - * string first_revision_id = 3; - * - * @return The bytes for firstRevisionId. - */ - com.google.protobuf.ByteString getFirstRevisionIdBytes(); - - /** - * - * - *
-   * The maximum (inclusive) revision allowed for validating messages. If empty
-   * or not present, allow any revision to be validated against first_revision
-   * or any revision created after.
-   * 
- * - * string last_revision_id = 4; - * - * @return The lastRevisionId. - */ - java.lang.String getLastRevisionId(); - /** - * - * - *
-   * The maximum (inclusive) revision allowed for validating messages. If empty
-   * or not present, allow any revision to be validated against first_revision
-   * or any revision created after.
-   * 
- * - * string last_revision_id = 4; - * - * @return The bytes for lastRevisionId. - */ - com.google.protobuf.ByteString getLastRevisionIdBytes(); -} 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 deleted file mode 100644 index c9ff100cd..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaView.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright 2023 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/SeekRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequest.java deleted file mode 100644 index 4cded2d70..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequest.java +++ /dev/null @@ -1,1374 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `Seek` method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.SeekRequest} - */ -public final class SeekRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.SeekRequest) - SeekRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use SeekRequest.newBuilder() to construct. - private SeekRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SeekRequest() { - subscription_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SeekRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_SeekRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_SeekRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.SeekRequest.class, com.google.pubsub.v1.SeekRequest.Builder.class); - } - - private int targetCase_ = 0; - - @SuppressWarnings("serial") - private java.lang.Object target_; - - public enum TargetCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - TIME(2), - SNAPSHOT(3), - TARGET_NOT_SET(0); - private final int value; - - private TargetCase(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 TargetCase valueOf(int value) { - return forNumber(value); - } - - public static TargetCase forNumber(int value) { - switch (value) { - case 2: - return TIME; - case 3: - return SNAPSHOT; - case 0: - return TARGET_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public TargetCase getTargetCase() { - return TargetCase.forNumber(targetCase_); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object subscription_ = ""; - /** - * - * - *
-   * Required. The subscription to affect.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - @java.lang.Override - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - 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(); - subscription_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The subscription to affect.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIME_FIELD_NUMBER = 2; - /** - * - * - *
-   * The time to seek to.
-   * Messages retained in the subscription that were published before this
-   * time are marked as acknowledged, and messages retained in the
-   * subscription that were published after this time are marked as
-   * unacknowledged. Note that this operation affects only those messages
-   * retained in the subscription (configured by the combination of
-   * `message_retention_duration` and `retain_acked_messages`). For example,
-   * if `time` corresponds to a point before the message retention
-   * window (or to a point before the system's notion of the subscription
-   * creation time), only retained messages will be marked as unacknowledged,
-   * and already-expunged messages will not be restored.
-   * 
- * - * .google.protobuf.Timestamp time = 2; - * - * @return Whether the time field is set. - */ - @java.lang.Override - public boolean hasTime() { - return targetCase_ == 2; - } - /** - * - * - *
-   * The time to seek to.
-   * Messages retained in the subscription that were published before this
-   * time are marked as acknowledged, and messages retained in the
-   * subscription that were published after this time are marked as
-   * unacknowledged. Note that this operation affects only those messages
-   * retained in the subscription (configured by the combination of
-   * `message_retention_duration` and `retain_acked_messages`). For example,
-   * if `time` corresponds to a point before the message retention
-   * window (or to a point before the system's notion of the subscription
-   * creation time), only retained messages will be marked as unacknowledged,
-   * and already-expunged messages will not be restored.
-   * 
- * - * .google.protobuf.Timestamp time = 2; - * - * @return The time. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getTime() { - if (targetCase_ == 2) { - return (com.google.protobuf.Timestamp) target_; - } - return com.google.protobuf.Timestamp.getDefaultInstance(); - } - /** - * - * - *
-   * The time to seek to.
-   * Messages retained in the subscription that were published before this
-   * time are marked as acknowledged, and messages retained in the
-   * subscription that were published after this time are marked as
-   * unacknowledged. Note that this operation affects only those messages
-   * retained in the subscription (configured by the combination of
-   * `message_retention_duration` and `retain_acked_messages`). For example,
-   * if `time` corresponds to a point before the message retention
-   * window (or to a point before the system's notion of the subscription
-   * creation time), only retained messages will be marked as unacknowledged,
-   * and already-expunged messages will not be restored.
-   * 
- * - * .google.protobuf.Timestamp time = 2; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { - if (targetCase_ == 2) { - return (com.google.protobuf.Timestamp) target_; - } - return com.google.protobuf.Timestamp.getDefaultInstance(); - } - - public static final int SNAPSHOT_FIELD_NUMBER = 3; - /** - * - * - *
-   * The snapshot to seek to. The snapshot's topic must be the same as that of
-   * the provided subscription.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @return Whether the snapshot field is set. - */ - public boolean hasSnapshot() { - return targetCase_ == 3; - } - /** - * - * - *
-   * The snapshot to seek to. The snapshot's topic must be the same as that of
-   * the provided subscription.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @return The snapshot. - */ - public java.lang.String getSnapshot() { - java.lang.Object ref = ""; - if (targetCase_ == 3) { - ref = target_; - } - 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 (targetCase_ == 3) { - target_ = s; - } - return s; - } - } - /** - * - * - *
-   * The snapshot to seek to. The snapshot's topic must be the same as that of
-   * the provided subscription.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for snapshot. - */ - public com.google.protobuf.ByteString getSnapshotBytes() { - java.lang.Object ref = ""; - if (targetCase_ == 3) { - ref = target_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (targetCase_ == 3) { - target_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); - } - if (targetCase_ == 2) { - output.writeMessage(2, (com.google.protobuf.Timestamp) target_); - } - if (targetCase_ == 3) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_); - } - if (targetCase_ == 2) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 2, (com.google.protobuf.Timestamp) target_); - } - if (targetCase_ == 3) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); - } - size += getUnknownFields().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.SeekRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.SeekRequest other = (com.google.pubsub.v1.SeekRequest) obj; - - if (!getSubscription().equals(other.getSubscription())) return false; - if (!getTargetCase().equals(other.getTargetCase())) return false; - switch (targetCase_) { - case 2: - if (!getTime().equals(other.getTime())) return false; - break; - case 3: - if (!getSnapshot().equals(other.getSnapshot())) return false; - break; - case 0: - default: - } - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - switch (targetCase_) { - case 2: - hash = (37 * hash) + TIME_FIELD_NUMBER; - hash = (53 * hash) + getTime().hashCode(); - break; - case 3: - hash = (37 * hash) + SNAPSHOT_FIELD_NUMBER; - hash = (53 * hash) + getSnapshot().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.SeekRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.SeekRequest 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.SeekRequest parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.SeekRequest 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.SeekRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.SeekRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.SeekRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.SeekRequest 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.SeekRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.SeekRequest 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.SeekRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.SeekRequest 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.SeekRequest 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 `Seek` method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.SeekRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.SeekRequest) - com.google.pubsub.v1.SeekRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_SeekRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_SeekRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.SeekRequest.class, - com.google.pubsub.v1.SeekRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.SeekRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscription_ = ""; - if (timeBuilder_ != null) { - timeBuilder_.clear(); - } - targetCase_ = 0; - target_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_SeekRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.SeekRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.SeekRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.SeekRequest build() { - com.google.pubsub.v1.SeekRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.SeekRequest buildPartial() { - com.google.pubsub.v1.SeekRequest result = new com.google.pubsub.v1.SeekRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.SeekRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.subscription_ = subscription_; - } - } - - private void buildPartialOneofs(com.google.pubsub.v1.SeekRequest result) { - result.targetCase_ = targetCase_; - result.target_ = this.target_; - if (targetCase_ == 2 && timeBuilder_ != null) { - result.target_ = timeBuilder_.build(); - } - } - - @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.SeekRequest) { - return mergeFrom((com.google.pubsub.v1.SeekRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.SeekRequest other) { - if (other == com.google.pubsub.v1.SeekRequest.getDefaultInstance()) return this; - if (!other.getSubscription().isEmpty()) { - subscription_ = other.subscription_; - bitField0_ |= 0x00000001; - onChanged(); - } - switch (other.getTargetCase()) { - case TIME: - { - mergeTime(other.getTime()); - break; - } - case SNAPSHOT: - { - targetCase_ = 3; - target_ = other.target_; - onChanged(); - break; - } - case TARGET_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - subscription_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getTimeFieldBuilder().getBuilder(), extensionRegistry); - targetCase_ = 2; - break; - } // case 18 - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - targetCase_ = 3; - target_ = s; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int targetCase_ = 0; - private java.lang.Object target_; - - public TargetCase getTargetCase() { - return TargetCase.forNumber(targetCase_); - } - - public Builder clearTarget() { - targetCase_ = 0; - target_ = null; - onChanged(); - return this; - } - - private int bitField0_; - - private java.lang.Object subscription_ = ""; - /** - * - * - *
-     * Required. The subscription to affect.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The subscription to affect.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The subscription to affect.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription to affect.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSubscription() { - subscription_ = getDefaultInstance().getSubscription(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription to affect.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - timeBuilder_; - /** - * - * - *
-     * The time to seek to.
-     * Messages retained in the subscription that were published before this
-     * time are marked as acknowledged, and messages retained in the
-     * subscription that were published after this time are marked as
-     * unacknowledged. Note that this operation affects only those messages
-     * retained in the subscription (configured by the combination of
-     * `message_retention_duration` and `retain_acked_messages`). For example,
-     * if `time` corresponds to a point before the message retention
-     * window (or to a point before the system's notion of the subscription
-     * creation time), only retained messages will be marked as unacknowledged,
-     * and already-expunged messages will not be restored.
-     * 
- * - * .google.protobuf.Timestamp time = 2; - * - * @return Whether the time field is set. - */ - @java.lang.Override - public boolean hasTime() { - return targetCase_ == 2; - } - /** - * - * - *
-     * The time to seek to.
-     * Messages retained in the subscription that were published before this
-     * time are marked as acknowledged, and messages retained in the
-     * subscription that were published after this time are marked as
-     * unacknowledged. Note that this operation affects only those messages
-     * retained in the subscription (configured by the combination of
-     * `message_retention_duration` and `retain_acked_messages`). For example,
-     * if `time` corresponds to a point before the message retention
-     * window (or to a point before the system's notion of the subscription
-     * creation time), only retained messages will be marked as unacknowledged,
-     * and already-expunged messages will not be restored.
-     * 
- * - * .google.protobuf.Timestamp time = 2; - * - * @return The time. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getTime() { - if (timeBuilder_ == null) { - if (targetCase_ == 2) { - return (com.google.protobuf.Timestamp) target_; - } - return com.google.protobuf.Timestamp.getDefaultInstance(); - } else { - if (targetCase_ == 2) { - return timeBuilder_.getMessage(); - } - return com.google.protobuf.Timestamp.getDefaultInstance(); - } - } - /** - * - * - *
-     * The time to seek to.
-     * Messages retained in the subscription that were published before this
-     * time are marked as acknowledged, and messages retained in the
-     * subscription that were published after this time are marked as
-     * unacknowledged. Note that this operation affects only those messages
-     * retained in the subscription (configured by the combination of
-     * `message_retention_duration` and `retain_acked_messages`). For example,
-     * if `time` corresponds to a point before the message retention
-     * window (or to a point before the system's notion of the subscription
-     * creation time), only retained messages will be marked as unacknowledged,
-     * and already-expunged messages will not be restored.
-     * 
- * - * .google.protobuf.Timestamp time = 2; - */ - public Builder setTime(com.google.protobuf.Timestamp value) { - if (timeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - target_ = value; - onChanged(); - } else { - timeBuilder_.setMessage(value); - } - targetCase_ = 2; - return this; - } - /** - * - * - *
-     * The time to seek to.
-     * Messages retained in the subscription that were published before this
-     * time are marked as acknowledged, and messages retained in the
-     * subscription that were published after this time are marked as
-     * unacknowledged. Note that this operation affects only those messages
-     * retained in the subscription (configured by the combination of
-     * `message_retention_duration` and `retain_acked_messages`). For example,
-     * if `time` corresponds to a point before the message retention
-     * window (or to a point before the system's notion of the subscription
-     * creation time), only retained messages will be marked as unacknowledged,
-     * and already-expunged messages will not be restored.
-     * 
- * - * .google.protobuf.Timestamp time = 2; - */ - public Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (timeBuilder_ == null) { - target_ = builderForValue.build(); - onChanged(); - } else { - timeBuilder_.setMessage(builderForValue.build()); - } - targetCase_ = 2; - return this; - } - /** - * - * - *
-     * The time to seek to.
-     * Messages retained in the subscription that were published before this
-     * time are marked as acknowledged, and messages retained in the
-     * subscription that were published after this time are marked as
-     * unacknowledged. Note that this operation affects only those messages
-     * retained in the subscription (configured by the combination of
-     * `message_retention_duration` and `retain_acked_messages`). For example,
-     * if `time` corresponds to a point before the message retention
-     * window (or to a point before the system's notion of the subscription
-     * creation time), only retained messages will be marked as unacknowledged,
-     * and already-expunged messages will not be restored.
-     * 
- * - * .google.protobuf.Timestamp time = 2; - */ - public Builder mergeTime(com.google.protobuf.Timestamp value) { - if (timeBuilder_ == null) { - if (targetCase_ == 2 && target_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - target_ = - com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) target_) - .mergeFrom(value) - .buildPartial(); - } else { - target_ = value; - } - onChanged(); - } else { - if (targetCase_ == 2) { - timeBuilder_.mergeFrom(value); - } else { - timeBuilder_.setMessage(value); - } - } - targetCase_ = 2; - return this; - } - /** - * - * - *
-     * The time to seek to.
-     * Messages retained in the subscription that were published before this
-     * time are marked as acknowledged, and messages retained in the
-     * subscription that were published after this time are marked as
-     * unacknowledged. Note that this operation affects only those messages
-     * retained in the subscription (configured by the combination of
-     * `message_retention_duration` and `retain_acked_messages`). For example,
-     * if `time` corresponds to a point before the message retention
-     * window (or to a point before the system's notion of the subscription
-     * creation time), only retained messages will be marked as unacknowledged,
-     * and already-expunged messages will not be restored.
-     * 
- * - * .google.protobuf.Timestamp time = 2; - */ - public Builder clearTime() { - if (timeBuilder_ == null) { - if (targetCase_ == 2) { - targetCase_ = 0; - target_ = null; - onChanged(); - } - } else { - if (targetCase_ == 2) { - targetCase_ = 0; - target_ = null; - } - timeBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * The time to seek to.
-     * Messages retained in the subscription that were published before this
-     * time are marked as acknowledged, and messages retained in the
-     * subscription that were published after this time are marked as
-     * unacknowledged. Note that this operation affects only those messages
-     * retained in the subscription (configured by the combination of
-     * `message_retention_duration` and `retain_acked_messages`). For example,
-     * if `time` corresponds to a point before the message retention
-     * window (or to a point before the system's notion of the subscription
-     * creation time), only retained messages will be marked as unacknowledged,
-     * and already-expunged messages will not be restored.
-     * 
- * - * .google.protobuf.Timestamp time = 2; - */ - public com.google.protobuf.Timestamp.Builder getTimeBuilder() { - return getTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The time to seek to.
-     * Messages retained in the subscription that were published before this
-     * time are marked as acknowledged, and messages retained in the
-     * subscription that were published after this time are marked as
-     * unacknowledged. Note that this operation affects only those messages
-     * retained in the subscription (configured by the combination of
-     * `message_retention_duration` and `retain_acked_messages`). For example,
-     * if `time` corresponds to a point before the message retention
-     * window (or to a point before the system's notion of the subscription
-     * creation time), only retained messages will be marked as unacknowledged,
-     * and already-expunged messages will not be restored.
-     * 
- * - * .google.protobuf.Timestamp time = 2; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { - if ((targetCase_ == 2) && (timeBuilder_ != null)) { - return timeBuilder_.getMessageOrBuilder(); - } else { - if (targetCase_ == 2) { - return (com.google.protobuf.Timestamp) target_; - } - return com.google.protobuf.Timestamp.getDefaultInstance(); - } - } - /** - * - * - *
-     * The time to seek to.
-     * Messages retained in the subscription that were published before this
-     * time are marked as acknowledged, and messages retained in the
-     * subscription that were published after this time are marked as
-     * unacknowledged. Note that this operation affects only those messages
-     * retained in the subscription (configured by the combination of
-     * `message_retention_duration` and `retain_acked_messages`). For example,
-     * if `time` corresponds to a point before the message retention
-     * window (or to a point before the system's notion of the subscription
-     * creation time), only retained messages will be marked as unacknowledged,
-     * and already-expunged messages will not be restored.
-     * 
- * - * .google.protobuf.Timestamp time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getTimeFieldBuilder() { - if (timeBuilder_ == null) { - if (!(targetCase_ == 2)) { - target_ = com.google.protobuf.Timestamp.getDefaultInstance(); - } - timeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - (com.google.protobuf.Timestamp) target_, getParentForChildren(), isClean()); - target_ = null; - } - targetCase_ = 2; - onChanged(); - return timeBuilder_; - } - - /** - * - * - *
-     * The snapshot to seek to. The snapshot's topic must be the same as that of
-     * the provided subscription.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @return Whether the snapshot field is set. - */ - @java.lang.Override - public boolean hasSnapshot() { - return targetCase_ == 3; - } - /** - * - * - *
-     * The snapshot to seek to. The snapshot's topic must be the same as that of
-     * the provided subscription.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @return The snapshot. - */ - @java.lang.Override - public java.lang.String getSnapshot() { - java.lang.Object ref = ""; - if (targetCase_ == 3) { - ref = target_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (targetCase_ == 3) { - target_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The snapshot to seek to. The snapshot's topic must be the same as that of
-     * the provided subscription.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for snapshot. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSnapshotBytes() { - java.lang.Object ref = ""; - if (targetCase_ == 3) { - ref = target_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (targetCase_ == 3) { - target_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The snapshot to seek to. The snapshot's topic must be the same as that of
-     * the provided subscription.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @param value The snapshot to set. - * @return This builder for chaining. - */ - public Builder setSnapshot(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - targetCase_ = 3; - target_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The snapshot to seek to. The snapshot's topic must be the same as that of
-     * the provided subscription.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @return This builder for chaining. - */ - public Builder clearSnapshot() { - if (targetCase_ == 3) { - targetCase_ = 0; - target_ = null; - onChanged(); - } - return this; - } - /** - * - * - *
-     * The snapshot to seek to. The snapshot's topic must be the same as that of
-     * the provided subscription.
-     * Format is `projects/{project}/snapshots/{snap}`.
-     * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @param value The bytes for snapshot to set. - * @return This builder for chaining. - */ - public Builder setSnapshotBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - targetCase_ = 3; - target_ = 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.SeekRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.SeekRequest) - private static final com.google.pubsub.v1.SeekRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.SeekRequest(); - } - - public static com.google.pubsub.v1.SeekRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SeekRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.SeekRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequestOrBuilder.java deleted file mode 100644 index 009aaa5f8..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequestOrBuilder.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright 2023 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 SeekRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.SeekRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The subscription to affect.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - java.lang.String getSubscription(); - /** - * - * - *
-   * Required. The subscription to affect.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - com.google.protobuf.ByteString getSubscriptionBytes(); - - /** - * - * - *
-   * The time to seek to.
-   * Messages retained in the subscription that were published before this
-   * time are marked as acknowledged, and messages retained in the
-   * subscription that were published after this time are marked as
-   * unacknowledged. Note that this operation affects only those messages
-   * retained in the subscription (configured by the combination of
-   * `message_retention_duration` and `retain_acked_messages`). For example,
-   * if `time` corresponds to a point before the message retention
-   * window (or to a point before the system's notion of the subscription
-   * creation time), only retained messages will be marked as unacknowledged,
-   * and already-expunged messages will not be restored.
-   * 
- * - * .google.protobuf.Timestamp time = 2; - * - * @return Whether the time field is set. - */ - boolean hasTime(); - /** - * - * - *
-   * The time to seek to.
-   * Messages retained in the subscription that were published before this
-   * time are marked as acknowledged, and messages retained in the
-   * subscription that were published after this time are marked as
-   * unacknowledged. Note that this operation affects only those messages
-   * retained in the subscription (configured by the combination of
-   * `message_retention_duration` and `retain_acked_messages`). For example,
-   * if `time` corresponds to a point before the message retention
-   * window (or to a point before the system's notion of the subscription
-   * creation time), only retained messages will be marked as unacknowledged,
-   * and already-expunged messages will not be restored.
-   * 
- * - * .google.protobuf.Timestamp time = 2; - * - * @return The time. - */ - com.google.protobuf.Timestamp getTime(); - /** - * - * - *
-   * The time to seek to.
-   * Messages retained in the subscription that were published before this
-   * time are marked as acknowledged, and messages retained in the
-   * subscription that were published after this time are marked as
-   * unacknowledged. Note that this operation affects only those messages
-   * retained in the subscription (configured by the combination of
-   * `message_retention_duration` and `retain_acked_messages`). For example,
-   * if `time` corresponds to a point before the message retention
-   * window (or to a point before the system's notion of the subscription
-   * creation time), only retained messages will be marked as unacknowledged,
-   * and already-expunged messages will not be restored.
-   * 
- * - * .google.protobuf.Timestamp time = 2; - */ - com.google.protobuf.TimestampOrBuilder getTimeOrBuilder(); - - /** - * - * - *
-   * The snapshot to seek to. The snapshot's topic must be the same as that of
-   * the provided subscription.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @return Whether the snapshot field is set. - */ - boolean hasSnapshot(); - /** - * - * - *
-   * The snapshot to seek to. The snapshot's topic must be the same as that of
-   * the provided subscription.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @return The snapshot. - */ - java.lang.String getSnapshot(); - /** - * - * - *
-   * The snapshot to seek to. The snapshot's topic must be the same as that of
-   * the provided subscription.
-   * Format is `projects/{project}/snapshots/{snap}`.
-   * 
- * - * string snapshot = 3 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for snapshot. - */ - com.google.protobuf.ByteString getSnapshotBytes(); - - com.google.pubsub.v1.SeekRequest.TargetCase getTargetCase(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekResponse.java deleted file mode 100644 index 141e78c27..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekResponse.java +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Response for the `Seek` method (this response is empty).
- * 
- * - * Protobuf type {@code google.pubsub.v1.SeekResponse} - */ -public final class SeekResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.SeekResponse) - SeekResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use SeekResponse.newBuilder() to construct. - private SeekResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SeekResponse() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SeekResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_SeekResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_SeekResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.SeekResponse.class, - com.google.pubsub.v1.SeekResponse.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 { - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += getUnknownFields().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.SeekResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.SeekResponse other = (com.google.pubsub.v1.SeekResponse) obj; - - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.SeekResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.SeekResponse 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.SeekResponse parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.SeekResponse 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.SeekResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.SeekResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.SeekResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.SeekResponse 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.SeekResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.SeekResponse 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.SeekResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.SeekResponse 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.SeekResponse 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 `Seek` method (this response is empty).
-   * 
- * - * Protobuf type {@code google.pubsub.v1.SeekResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.SeekResponse) - com.google.pubsub.v1.SeekResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_SeekResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_SeekResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.SeekResponse.class, - com.google.pubsub.v1.SeekResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.SeekResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @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.PubsubProto - .internal_static_google_pubsub_v1_SeekResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.SeekResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.SeekResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.SeekResponse build() { - com.google.pubsub.v1.SeekResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.SeekResponse buildPartial() { - com.google.pubsub.v1.SeekResponse result = new com.google.pubsub.v1.SeekResponse(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.SeekResponse) { - return mergeFrom((com.google.pubsub.v1.SeekResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.SeekResponse other) { - if (other == com.google.pubsub.v1.SeekResponse.getDefaultInstance()) return this; - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - 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.SeekResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.SeekResponse) - private static final com.google.pubsub.v1.SeekResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.SeekResponse(); - } - - public static com.google.pubsub.v1.SeekResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SeekResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.SeekResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekResponseOrBuilder.java deleted file mode 100644 index 9b2fd097d..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekResponseOrBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2023 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 SeekResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.SeekResponse) - com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Snapshot.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Snapshot.java deleted file mode 100644 index bbf7ea473..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Snapshot.java +++ /dev/null @@ -1,1516 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * A snapshot resource. 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.
- * 
- * - * Protobuf type {@code google.pubsub.v1.Snapshot} - */ -public final class Snapshot extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.Snapshot) - SnapshotOrBuilder { - private static final long serialVersionUID = 0L; - // Use Snapshot.newBuilder() to construct. - private Snapshot(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Snapshot() { - name_ = ""; - topic_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Snapshot(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Snapshot_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 4: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Snapshot_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.Snapshot.class, com.google.pubsub.v1.Snapshot.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * The name of the snapshot.
-   * 
- * - * string name = 1; - * - * @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; - } - } - /** - * - * - *
-   * The name of the snapshot.
-   * 
- * - * string name = 1; - * - * @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 TOPIC_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object topic_ = ""; - /** - * - * - *
-   * The name of the topic from which this snapshot is retaining messages.
-   * 
- * - * string topic = 2 [(.google.api.resource_reference) = { ... } - * - * @return The topic. - */ - @java.lang.Override - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - 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(); - topic_ = s; - return s; - } - } - /** - * - * - *
-   * The name of the topic from which this snapshot is retaining messages.
-   * 
- * - * string topic = 2 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for topic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EXPIRE_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Timestamp expireTime_; - /** - * - * - *
-   * The snapshot is guaranteed to exist up until this time.
-   * A newly-created snapshot expires no later than 7 days from the time of its
-   * creation. Its exact lifetime is determined at creation by the existing
-   * backlog in the source subscription. Specifically, the lifetime of the
-   * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-   * For example, consider a subscription whose oldest unacked message is 3 days
-   * old. If a snapshot is created from this subscription, the snapshot -- which
-   * will always capture this 3-day-old backlog as long as the snapshot
-   * exists -- will expire in 4 days. The service will refuse to create a
-   * snapshot that would expire in less than 1 hour after creation.
-   * 
- * - * .google.protobuf.Timestamp expire_time = 3; - * - * @return Whether the expireTime field is set. - */ - @java.lang.Override - public boolean hasExpireTime() { - return expireTime_ != null; - } - /** - * - * - *
-   * The snapshot is guaranteed to exist up until this time.
-   * A newly-created snapshot expires no later than 7 days from the time of its
-   * creation. Its exact lifetime is determined at creation by the existing
-   * backlog in the source subscription. Specifically, the lifetime of the
-   * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-   * For example, consider a subscription whose oldest unacked message is 3 days
-   * old. If a snapshot is created from this subscription, the snapshot -- which
-   * will always capture this 3-day-old backlog as long as the snapshot
-   * exists -- will expire in 4 days. The service will refuse to create a
-   * snapshot that would expire in less than 1 hour after creation.
-   * 
- * - * .google.protobuf.Timestamp expire_time = 3; - * - * @return The expireTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getExpireTime() { - return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; - } - /** - * - * - *
-   * The snapshot is guaranteed to exist up until this time.
-   * A newly-created snapshot expires no later than 7 days from the time of its
-   * creation. Its exact lifetime is determined at creation by the existing
-   * backlog in the source subscription. Specifically, the lifetime of the
-   * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-   * For example, consider a subscription whose oldest unacked message is 3 days
-   * old. If a snapshot is created from this subscription, the snapshot -- which
-   * will always capture this 3-day-old backlog as long as the snapshot
-   * exists -- will expire in 4 days. The service will refuse to create a
-   * snapshot that would expire in less than 1 hour after creation.
-   * 
- * - * .google.protobuf.Timestamp expire_time = 3; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { - return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; - } - - public static final int LABELS_FIELD_NUMBER = 4; - - private static final class LabelsDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Snapshot_LabelsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - @SuppressWarnings("serial") - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, topic_); - } - if (expireTime_ != null) { - output.writeMessage(3, getExpireTime()); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, topic_); - } - if (expireTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExpireTime()); - } - for (java.util.Map.Entry entry : - internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry labels__ = - LabelsDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); - } - size += getUnknownFields().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.Snapshot)) { - return super.equals(obj); - } - com.google.pubsub.v1.Snapshot other = (com.google.pubsub.v1.Snapshot) obj; - - if (!getName().equals(other.getName())) return false; - if (!getTopic().equals(other.getTopic())) return false; - if (hasExpireTime() != other.hasExpireTime()) return false; - if (hasExpireTime()) { - if (!getExpireTime().equals(other.getExpireTime())) return false; - } - if (!internalGetLabels().equals(other.internalGetLabels())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getTopic().hashCode(); - if (hasExpireTime()) { - hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getExpireTime().hashCode(); - } - if (!internalGetLabels().getMap().isEmpty()) { - hash = (37 * hash) + LABELS_FIELD_NUMBER; - hash = (53 * hash) + internalGetLabels().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.Snapshot parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.Snapshot 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.Snapshot parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.Snapshot 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.Snapshot parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.Snapshot parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.Snapshot parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.Snapshot 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.Snapshot parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.Snapshot 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.Snapshot parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.Snapshot 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.Snapshot 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 snapshot resource. 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.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.Snapshot} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.Snapshot) - com.google.pubsub.v1.SnapshotOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Snapshot_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 4: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 4: - return internalGetMutableLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Snapshot_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.Snapshot.class, com.google.pubsub.v1.Snapshot.Builder.class); - } - - // Construct using com.google.pubsub.v1.Snapshot.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - topic_ = ""; - expireTime_ = null; - if (expireTimeBuilder_ != null) { - expireTimeBuilder_.dispose(); - expireTimeBuilder_ = null; - } - internalGetMutableLabels().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Snapshot_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.Snapshot getDefaultInstanceForType() { - return com.google.pubsub.v1.Snapshot.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.Snapshot build() { - com.google.pubsub.v1.Snapshot result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.Snapshot buildPartial() { - com.google.pubsub.v1.Snapshot result = new com.google.pubsub.v1.Snapshot(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.Snapshot result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.topic_ = topic_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.expireTime_ = expireTimeBuilder_ == null ? expireTime_ : expireTimeBuilder_.build(); - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - } - } - - @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.Snapshot) { - return mergeFrom((com.google.pubsub.v1.Snapshot) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.Snapshot other) { - if (other == com.google.pubsub.v1.Snapshot.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getTopic().isEmpty()) { - topic_ = other.topic_; - bitField0_ |= 0x00000002; - onChanged(); - } - if (other.hasExpireTime()) { - mergeExpireTime(other.getExpireTime()); - } - internalGetMutableLabels().mergeFrom(other.internalGetLabels()); - bitField0_ |= 0x00000008; - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - topic_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - input.readMessage(getExpireTimeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 34: - { - com.google.protobuf.MapEntry labels__ = - input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableLabels() - .getMutableMap() - .put(labels__.getKey(), labels__.getValue()); - bitField0_ |= 0x00000008; - break; - } // case 34 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * The name of the snapshot.
-     * 
- * - * string name = 1; - * - * @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; - } - } - /** - * - * - *
-     * The name of the snapshot.
-     * 
- * - * string name = 1; - * - * @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; - } - } - /** - * - * - *
-     * The name of the snapshot.
-     * 
- * - * string name = 1; - * - * @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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the snapshot.
-     * 
- * - * string name = 1; - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the snapshot.
-     * 
- * - * string name = 1; - * - * @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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object topic_ = ""; - /** - * - * - *
-     * The name of the topic from which this snapshot is retaining messages.
-     * 
- * - * string topic = 2 [(.google.api.resource_reference) = { ... } - * - * @return The topic. - */ - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - topic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The name of the topic from which this snapshot is retaining messages.
-     * 
- * - * string topic = 2 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for topic. - */ - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The name of the topic from which this snapshot is retaining messages.
-     * 
- * - * string topic = 2 [(.google.api.resource_reference) = { ... } - * - * @param value The topic to set. - * @return This builder for chaining. - */ - public Builder setTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - topic_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the topic from which this snapshot is retaining messages.
-     * 
- * - * string topic = 2 [(.google.api.resource_reference) = { ... } - * - * @return This builder for chaining. - */ - public Builder clearTopic() { - topic_ = getDefaultInstance().getTopic(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * The name of the topic from which this snapshot is retaining messages.
-     * 
- * - * string topic = 2 [(.google.api.resource_reference) = { ... } - * - * @param value The bytes for topic to set. - * @return This builder for chaining. - */ - public Builder setTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - topic_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp expireTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - expireTimeBuilder_; - /** - * - * - *
-     * The snapshot is guaranteed to exist up until this time.
-     * A newly-created snapshot expires no later than 7 days from the time of its
-     * creation. Its exact lifetime is determined at creation by the existing
-     * backlog in the source subscription. Specifically, the lifetime of the
-     * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-     * For example, consider a subscription whose oldest unacked message is 3 days
-     * old. If a snapshot is created from this subscription, the snapshot -- which
-     * will always capture this 3-day-old backlog as long as the snapshot
-     * exists -- will expire in 4 days. The service will refuse to create a
-     * snapshot that would expire in less than 1 hour after creation.
-     * 
- * - * .google.protobuf.Timestamp expire_time = 3; - * - * @return Whether the expireTime field is set. - */ - public boolean hasExpireTime() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * The snapshot is guaranteed to exist up until this time.
-     * A newly-created snapshot expires no later than 7 days from the time of its
-     * creation. Its exact lifetime is determined at creation by the existing
-     * backlog in the source subscription. Specifically, the lifetime of the
-     * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-     * For example, consider a subscription whose oldest unacked message is 3 days
-     * old. If a snapshot is created from this subscription, the snapshot -- which
-     * will always capture this 3-day-old backlog as long as the snapshot
-     * exists -- will expire in 4 days. The service will refuse to create a
-     * snapshot that would expire in less than 1 hour after creation.
-     * 
- * - * .google.protobuf.Timestamp expire_time = 3; - * - * @return The expireTime. - */ - public com.google.protobuf.Timestamp getExpireTime() { - if (expireTimeBuilder_ == null) { - return expireTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : expireTime_; - } else { - return expireTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The snapshot is guaranteed to exist up until this time.
-     * A newly-created snapshot expires no later than 7 days from the time of its
-     * creation. Its exact lifetime is determined at creation by the existing
-     * backlog in the source subscription. Specifically, the lifetime of the
-     * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-     * For example, consider a subscription whose oldest unacked message is 3 days
-     * old. If a snapshot is created from this subscription, the snapshot -- which
-     * will always capture this 3-day-old backlog as long as the snapshot
-     * exists -- will expire in 4 days. The service will refuse to create a
-     * snapshot that would expire in less than 1 hour after creation.
-     * 
- * - * .google.protobuf.Timestamp expire_time = 3; - */ - public Builder setExpireTime(com.google.protobuf.Timestamp value) { - if (expireTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - expireTime_ = value; - } else { - expireTimeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The snapshot is guaranteed to exist up until this time.
-     * A newly-created snapshot expires no later than 7 days from the time of its
-     * creation. Its exact lifetime is determined at creation by the existing
-     * backlog in the source subscription. Specifically, the lifetime of the
-     * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-     * For example, consider a subscription whose oldest unacked message is 3 days
-     * old. If a snapshot is created from this subscription, the snapshot -- which
-     * will always capture this 3-day-old backlog as long as the snapshot
-     * exists -- will expire in 4 days. The service will refuse to create a
-     * snapshot that would expire in less than 1 hour after creation.
-     * 
- * - * .google.protobuf.Timestamp expire_time = 3; - */ - public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (expireTimeBuilder_ == null) { - expireTime_ = builderForValue.build(); - } else { - expireTimeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The snapshot is guaranteed to exist up until this time.
-     * A newly-created snapshot expires no later than 7 days from the time of its
-     * creation. Its exact lifetime is determined at creation by the existing
-     * backlog in the source subscription. Specifically, the lifetime of the
-     * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-     * For example, consider a subscription whose oldest unacked message is 3 days
-     * old. If a snapshot is created from this subscription, the snapshot -- which
-     * will always capture this 3-day-old backlog as long as the snapshot
-     * exists -- will expire in 4 days. The service will refuse to create a
-     * snapshot that would expire in less than 1 hour after creation.
-     * 
- * - * .google.protobuf.Timestamp expire_time = 3; - */ - public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { - if (expireTimeBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0) - && expireTime_ != null - && expireTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - getExpireTimeBuilder().mergeFrom(value); - } else { - expireTime_ = value; - } - } else { - expireTimeBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The snapshot is guaranteed to exist up until this time.
-     * A newly-created snapshot expires no later than 7 days from the time of its
-     * creation. Its exact lifetime is determined at creation by the existing
-     * backlog in the source subscription. Specifically, the lifetime of the
-     * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-     * For example, consider a subscription whose oldest unacked message is 3 days
-     * old. If a snapshot is created from this subscription, the snapshot -- which
-     * will always capture this 3-day-old backlog as long as the snapshot
-     * exists -- will expire in 4 days. The service will refuse to create a
-     * snapshot that would expire in less than 1 hour after creation.
-     * 
- * - * .google.protobuf.Timestamp expire_time = 3; - */ - public Builder clearExpireTime() { - bitField0_ = (bitField0_ & ~0x00000004); - expireTime_ = null; - if (expireTimeBuilder_ != null) { - expireTimeBuilder_.dispose(); - expireTimeBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * The snapshot is guaranteed to exist up until this time.
-     * A newly-created snapshot expires no later than 7 days from the time of its
-     * creation. Its exact lifetime is determined at creation by the existing
-     * backlog in the source subscription. Specifically, the lifetime of the
-     * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-     * For example, consider a subscription whose oldest unacked message is 3 days
-     * old. If a snapshot is created from this subscription, the snapshot -- which
-     * will always capture this 3-day-old backlog as long as the snapshot
-     * exists -- will expire in 4 days. The service will refuse to create a
-     * snapshot that would expire in less than 1 hour after creation.
-     * 
- * - * .google.protobuf.Timestamp expire_time = 3; - */ - public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return getExpireTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The snapshot is guaranteed to exist up until this time.
-     * A newly-created snapshot expires no later than 7 days from the time of its
-     * creation. Its exact lifetime is determined at creation by the existing
-     * backlog in the source subscription. Specifically, the lifetime of the
-     * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-     * For example, consider a subscription whose oldest unacked message is 3 days
-     * old. If a snapshot is created from this subscription, the snapshot -- which
-     * will always capture this 3-day-old backlog as long as the snapshot
-     * exists -- will expire in 4 days. The service will refuse to create a
-     * snapshot that would expire in less than 1 hour after creation.
-     * 
- * - * .google.protobuf.Timestamp expire_time = 3; - */ - public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { - if (expireTimeBuilder_ != null) { - return expireTimeBuilder_.getMessageOrBuilder(); - } else { - return expireTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : expireTime_; - } - } - /** - * - * - *
-     * The snapshot is guaranteed to exist up until this time.
-     * A newly-created snapshot expires no later than 7 days from the time of its
-     * creation. Its exact lifetime is determined at creation by the existing
-     * backlog in the source subscription. Specifically, the lifetime of the
-     * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-     * For example, consider a subscription whose oldest unacked message is 3 days
-     * old. If a snapshot is created from this subscription, the snapshot -- which
-     * will always capture this 3-day-old backlog as long as the snapshot
-     * exists -- will expire in 4 days. The service will refuse to create a
-     * snapshot that would expire in less than 1 hour after creation.
-     * 
- * - * .google.protobuf.Timestamp expire_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getExpireTimeFieldBuilder() { - if (expireTimeBuilder_ == null) { - expireTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getExpireTime(), getParentForChildren(), isClean()); - expireTime_ = null; - } - return expireTimeBuilder_; - } - - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - private com.google.protobuf.MapField - internalGetMutableLabels() { - if (labels_ == null) { - labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - } - if (!labels_.isMutable()) { - labels_ = labels_.copy(); - } - bitField0_ |= 0x00000008; - onChanged(); - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearLabels() { - bitField0_ = (bitField0_ & ~0x00000008); - internalGetMutableLabels().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 4; - */ - public Builder removeLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableLabels().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableLabels() { - bitField0_ |= 0x00000008; - return internalGetMutableLabels().getMutableMap(); - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 4; - */ - public Builder putLabels(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new NullPointerException("map key"); - } - if (value == null) { - throw new NullPointerException("map value"); - } - internalGetMutableLabels().getMutableMap().put(key, value); - bitField0_ |= 0x00000008; - return this; - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 4; - */ - public Builder putAllLabels(java.util.Map values) { - internalGetMutableLabels().getMutableMap().putAll(values); - bitField0_ |= 0x00000008; - 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.Snapshot) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.Snapshot) - private static final com.google.pubsub.v1.Snapshot DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.Snapshot(); - } - - public static com.google.pubsub.v1.Snapshot getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Snapshot parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.Snapshot getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SnapshotName.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SnapshotName.java deleted file mode 100644 index 4642f2323..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SnapshotName.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright 2023 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; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class SnapshotName implements ResourceName { - private static final PathTemplate PROJECT_SNAPSHOT = - PathTemplate.createWithoutUrlEncoding("projects/{project}/snapshots/{snapshot}"); - private volatile Map fieldValuesMap; - private final String project; - private final String snapshot; - - @Deprecated - protected SnapshotName() { - project = null; - snapshot = null; - } - - private SnapshotName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - snapshot = Preconditions.checkNotNull(builder.getSnapshot()); - } - - public String getProject() { - return project; - } - - public String getSnapshot() { - return snapshot; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SnapshotName of(String project, String snapshot) { - return newBuilder().setProject(project).setSnapshot(snapshot).build(); - } - - public static String format(String project, String snapshot) { - return newBuilder().setProject(project).setSnapshot(snapshot).build().toString(); - } - - public static SnapshotName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_SNAPSHOT.validatedMatch( - formattedString, "SnapshotName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("snapshot")); - } - - 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 (SnapshotName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_SNAPSHOT.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (snapshot != null) { - fieldMapBuilder.put("snapshot", snapshot); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_SNAPSHOT.instantiate("project", project, "snapshot", snapshot); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null && getClass() == o.getClass()) { - SnapshotName that = ((SnapshotName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.snapshot, that.snapshot); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(snapshot); - return h; - } - - /** Builder for projects/{project}/snapshots/{snapshot}. */ - public static class Builder { - private String project; - private String snapshot; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getSnapshot() { - return snapshot; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setSnapshot(String snapshot) { - this.snapshot = snapshot; - return this; - } - - private Builder(SnapshotName snapshotName) { - this.project = snapshotName.project; - this.snapshot = snapshotName.snapshot; - } - - public SnapshotName build() { - return new SnapshotName(this); - } - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SnapshotOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SnapshotOrBuilder.java deleted file mode 100644 index 89d6b8dbc..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SnapshotOrBuilder.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright 2023 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 SnapshotOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.Snapshot) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * The name of the snapshot.
-   * 
- * - * string name = 1; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * The name of the snapshot.
-   * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * The name of the topic from which this snapshot is retaining messages.
-   * 
- * - * string topic = 2 [(.google.api.resource_reference) = { ... } - * - * @return The topic. - */ - java.lang.String getTopic(); - /** - * - * - *
-   * The name of the topic from which this snapshot is retaining messages.
-   * 
- * - * string topic = 2 [(.google.api.resource_reference) = { ... } - * - * @return The bytes for topic. - */ - com.google.protobuf.ByteString getTopicBytes(); - - /** - * - * - *
-   * The snapshot is guaranteed to exist up until this time.
-   * A newly-created snapshot expires no later than 7 days from the time of its
-   * creation. Its exact lifetime is determined at creation by the existing
-   * backlog in the source subscription. Specifically, the lifetime of the
-   * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-   * For example, consider a subscription whose oldest unacked message is 3 days
-   * old. If a snapshot is created from this subscription, the snapshot -- which
-   * will always capture this 3-day-old backlog as long as the snapshot
-   * exists -- will expire in 4 days. The service will refuse to create a
-   * snapshot that would expire in less than 1 hour after creation.
-   * 
- * - * .google.protobuf.Timestamp expire_time = 3; - * - * @return Whether the expireTime field is set. - */ - boolean hasExpireTime(); - /** - * - * - *
-   * The snapshot is guaranteed to exist up until this time.
-   * A newly-created snapshot expires no later than 7 days from the time of its
-   * creation. Its exact lifetime is determined at creation by the existing
-   * backlog in the source subscription. Specifically, the lifetime of the
-   * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-   * For example, consider a subscription whose oldest unacked message is 3 days
-   * old. If a snapshot is created from this subscription, the snapshot -- which
-   * will always capture this 3-day-old backlog as long as the snapshot
-   * exists -- will expire in 4 days. The service will refuse to create a
-   * snapshot that would expire in less than 1 hour after creation.
-   * 
- * - * .google.protobuf.Timestamp expire_time = 3; - * - * @return The expireTime. - */ - com.google.protobuf.Timestamp getExpireTime(); - /** - * - * - *
-   * The snapshot is guaranteed to exist up until this time.
-   * A newly-created snapshot expires no later than 7 days from the time of its
-   * creation. Its exact lifetime is determined at creation by the existing
-   * backlog in the source subscription. Specifically, the lifetime of the
-   * snapshot is `7 days - (age of oldest unacked message in the subscription)`.
-   * For example, consider a subscription whose oldest unacked message is 3 days
-   * old. If a snapshot is created from this subscription, the snapshot -- which
-   * will always capture this 3-day-old backlog as long as the snapshot
-   * exists -- will expire in 4 days. The service will refuse to create a
-   * snapshot that would expire in less than 1 hour after creation.
-   * 
- * - * .google.protobuf.Timestamp expire_time = 3; - */ - com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); - - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 4; - */ - int getLabelsCount(); - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 4; - */ - boolean containsLabels(java.lang.String key); - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Deprecated - java.util.Map getLabels(); - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 4; - */ - java.util.Map getLabelsMap(); - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 4; - */ - /* nullable */ - java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue); - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 4; - */ - java.lang.String getLabelsOrThrow(java.lang.String key); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullRequest.java deleted file mode 100644 index 20d715043..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullRequest.java +++ /dev/null @@ -1,2239 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the `StreamingPull` streaming RPC method. This request is used to
- * establish the initial stream as well as to stream acknowledgements and ack
- * deadline modifications from the client to the server.
- * 
- * - * Protobuf type {@code google.pubsub.v1.StreamingPullRequest} - */ -public final class StreamingPullRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.StreamingPullRequest) - StreamingPullRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingPullRequest.newBuilder() to construct. - private StreamingPullRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingPullRequest() { - subscription_ = ""; - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - modifyDeadlineSeconds_ = emptyIntList(); - modifyDeadlineAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - clientId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StreamingPullRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.StreamingPullRequest.class, - com.google.pubsub.v1.StreamingPullRequest.Builder.class); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object subscription_ = ""; - /** - * - * - *
-   * Required. The subscription for which to initialize the new stream. This
-   * must be provided in the first request on the stream, and must not be set in
-   * subsequent requests from client to server.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - @java.lang.Override - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - 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(); - subscription_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The subscription for which to initialize the new stream. This
-   * must be provided in the first request on the stream, and must not be set in
-   * subsequent requests from client to server.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ACK_IDS_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList ackIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-   * List of acknowledgement IDs for acknowledging previously received messages
-   * (received on this stream or a different stream). If an ack ID has expired,
-   * the corresponding message may be redelivered later. Acknowledging a message
-   * more than once will not result in an error. If the acknowledgement ID is
-   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated string ack_ids = 2; - * - * @return A list containing the ackIds. - */ - public com.google.protobuf.ProtocolStringList getAckIdsList() { - return ackIds_; - } - /** - * - * - *
-   * List of acknowledgement IDs for acknowledging previously received messages
-   * (received on this stream or a different stream). If an ack ID has expired,
-   * the corresponding message may be redelivered later. Acknowledging a message
-   * more than once will not result in an error. If the acknowledgement ID is
-   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated string ack_ids = 2; - * - * @return The count of ackIds. - */ - public int getAckIdsCount() { - return ackIds_.size(); - } - /** - * - * - *
-   * List of acknowledgement IDs for acknowledging previously received messages
-   * (received on this stream or a different stream). If an ack ID has expired,
-   * the corresponding message may be redelivered later. Acknowledging a message
-   * more than once will not result in an error. If the acknowledgement ID is
-   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated string ack_ids = 2; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - public java.lang.String getAckIds(int index) { - return ackIds_.get(index); - } - /** - * - * - *
-   * List of acknowledgement IDs for acknowledging previously received messages
-   * (received on this stream or a different stream). If an ack ID has expired,
-   * the corresponding message may be redelivered later. Acknowledging a message
-   * more than once will not result in an error. If the acknowledgement ID is
-   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated string ack_ids = 2; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - public com.google.protobuf.ByteString getAckIdsBytes(int index) { - return ackIds_.getByteString(index); - } - - public static final int MODIFY_DEADLINE_SECONDS_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private com.google.protobuf.Internal.IntList modifyDeadlineSeconds_; - /** - * - * - *
-   * The list of new ack deadlines for the IDs listed in
-   * `modify_deadline_ack_ids`. The size of this list must be the same as the
-   * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-   * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-   * element in the same position in `modify_deadline_ack_ids`. The new ack
-   * deadline is with respect to the time this request was sent to the Pub/Sub
-   * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-   * will expire 10 seconds after this request is received. If the value is 0,
-   * the message is immediately made available for another streaming or
-   * non-streaming pull request. If the value is < 0 (an error), the stream will
-   * be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @return A list containing the modifyDeadlineSeconds. - */ - @java.lang.Override - public java.util.List getModifyDeadlineSecondsList() { - return modifyDeadlineSeconds_; - } - /** - * - * - *
-   * The list of new ack deadlines for the IDs listed in
-   * `modify_deadline_ack_ids`. The size of this list must be the same as the
-   * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-   * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-   * element in the same position in `modify_deadline_ack_ids`. The new ack
-   * deadline is with respect to the time this request was sent to the Pub/Sub
-   * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-   * will expire 10 seconds after this request is received. If the value is 0,
-   * the message is immediately made available for another streaming or
-   * non-streaming pull request. If the value is < 0 (an error), the stream will
-   * be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @return The count of modifyDeadlineSeconds. - */ - public int getModifyDeadlineSecondsCount() { - return modifyDeadlineSeconds_.size(); - } - /** - * - * - *
-   * The list of new ack deadlines for the IDs listed in
-   * `modify_deadline_ack_ids`. The size of this list must be the same as the
-   * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-   * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-   * element in the same position in `modify_deadline_ack_ids`. The new ack
-   * deadline is with respect to the time this request was sent to the Pub/Sub
-   * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-   * will expire 10 seconds after this request is received. If the value is 0,
-   * the message is immediately made available for another streaming or
-   * non-streaming pull request. If the value is < 0 (an error), the stream will
-   * be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @param index The index of the element to return. - * @return The modifyDeadlineSeconds at the given index. - */ - public int getModifyDeadlineSeconds(int index) { - return modifyDeadlineSeconds_.getInt(index); - } - - private int modifyDeadlineSecondsMemoizedSerializedSize = -1; - - public static final int MODIFY_DEADLINE_ACK_IDS_FIELD_NUMBER = 4; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList modifyDeadlineAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-   * List of acknowledgement IDs whose deadline will be modified based on the
-   * corresponding element in `modify_deadline_seconds`. This field can be used
-   * to indicate that more time is needed to process a message by the
-   * subscriber, or to make the message available for redelivery if the
-   * processing was interrupted.
-   * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @return A list containing the modifyDeadlineAckIds. - */ - public com.google.protobuf.ProtocolStringList getModifyDeadlineAckIdsList() { - return modifyDeadlineAckIds_; - } - /** - * - * - *
-   * List of acknowledgement IDs whose deadline will be modified based on the
-   * corresponding element in `modify_deadline_seconds`. This field can be used
-   * to indicate that more time is needed to process a message by the
-   * subscriber, or to make the message available for redelivery if the
-   * processing was interrupted.
-   * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @return The count of modifyDeadlineAckIds. - */ - public int getModifyDeadlineAckIdsCount() { - return modifyDeadlineAckIds_.size(); - } - /** - * - * - *
-   * List of acknowledgement IDs whose deadline will be modified based on the
-   * corresponding element in `modify_deadline_seconds`. This field can be used
-   * to indicate that more time is needed to process a message by the
-   * subscriber, or to make the message available for redelivery if the
-   * processing was interrupted.
-   * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @param index The index of the element to return. - * @return The modifyDeadlineAckIds at the given index. - */ - public java.lang.String getModifyDeadlineAckIds(int index) { - return modifyDeadlineAckIds_.get(index); - } - /** - * - * - *
-   * List of acknowledgement IDs whose deadline will be modified based on the
-   * corresponding element in `modify_deadline_seconds`. This field can be used
-   * to indicate that more time is needed to process a message by the
-   * subscriber, or to make the message available for redelivery if the
-   * processing was interrupted.
-   * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @param index The index of the value to return. - * @return The bytes of the modifyDeadlineAckIds at the given index. - */ - public com.google.protobuf.ByteString getModifyDeadlineAckIdsBytes(int index) { - return modifyDeadlineAckIds_.getByteString(index); - } - - public static final int STREAM_ACK_DEADLINE_SECONDS_FIELD_NUMBER = 5; - private int streamAckDeadlineSeconds_ = 0; - /** - * - * - *
-   * Required. The ack deadline to use for the stream. This must be provided in
-   * the first request on the stream, but it can also be updated on subsequent
-   * requests from client to server. The minimum deadline you can specify is 10
-   * seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
-   * 
- * - * int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The streamAckDeadlineSeconds. - */ - @java.lang.Override - public int getStreamAckDeadlineSeconds() { - return streamAckDeadlineSeconds_; - } - - public static final int CLIENT_ID_FIELD_NUMBER = 6; - - @SuppressWarnings("serial") - private volatile java.lang.Object clientId_ = ""; - /** - * - * - *
-   * A unique identifier that is used to distinguish client instances from each
-   * other. Only needs to be provided on the initial request. When a stream
-   * disconnects and reconnects for the same stream, the client_id should be set
-   * to the same value so that state associated with the old stream can be
-   * transferred to the new stream. The same client_id should not be used for
-   * different client instances.
-   * 
- * - * string client_id = 6; - * - * @return The clientId. - */ - @java.lang.Override - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - 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(); - clientId_ = s; - return s; - } - } - /** - * - * - *
-   * A unique identifier that is used to distinguish client instances from each
-   * other. Only needs to be provided on the initial request. When a stream
-   * disconnects and reconnects for the same stream, the client_id should be set
-   * to the same value so that state associated with the old stream can be
-   * transferred to the new stream. The same client_id should not be used for
-   * different client instances.
-   * 
- * - * string client_id = 6; - * - * @return The bytes for clientId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MAX_OUTSTANDING_MESSAGES_FIELD_NUMBER = 7; - private long maxOutstandingMessages_ = 0L; - /** - * - * - *
-   * Flow control settings for the maximum number of outstanding messages. When
-   * there are `max_outstanding_messages` or more currently sent to the
-   * streaming pull client that have not yet been acked or nacked, the server
-   * stops sending more messages. The sending of messages resumes once the
-   * number of outstanding messages is less than this value. If the value is
-   * <= 0, there is no limit to the number of outstanding messages. This
-   * property can only be set on the initial StreamingPullRequest. If it is set
-   * on a subsequent request, the stream will be aborted with status
-   * `INVALID_ARGUMENT`.
-   * 
- * - * int64 max_outstanding_messages = 7; - * - * @return The maxOutstandingMessages. - */ - @java.lang.Override - public long getMaxOutstandingMessages() { - return maxOutstandingMessages_; - } - - public static final int MAX_OUTSTANDING_BYTES_FIELD_NUMBER = 8; - private long maxOutstandingBytes_ = 0L; - /** - * - * - *
-   * Flow control settings for the maximum number of outstanding bytes. When
-   * there are `max_outstanding_bytes` or more worth of messages currently sent
-   * to the streaming pull client that have not yet been acked or nacked, the
-   * server will stop sending more messages. The sending of messages resumes
-   * once the number of outstanding bytes is less than this value. If the value
-   * is <= 0, there is no limit to the number of outstanding bytes. This
-   * property can only be set on the initial StreamingPullRequest. If it is set
-   * on a subsequent request, the stream will be aborted with status
-   * `INVALID_ARGUMENT`.
-   * 
- * - * int64 max_outstanding_bytes = 8; - * - * @return The maxOutstandingBytes. - */ - @java.lang.Override - public long getMaxOutstandingBytes() { - return maxOutstandingBytes_; - } - - 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 { - getSerializedSize(); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); - } - for (int i = 0; i < ackIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ackIds_.getRaw(i)); - } - if (getModifyDeadlineSecondsList().size() > 0) { - output.writeUInt32NoTag(26); - output.writeUInt32NoTag(modifyDeadlineSecondsMemoizedSerializedSize); - } - for (int i = 0; i < modifyDeadlineSeconds_.size(); i++) { - output.writeInt32NoTag(modifyDeadlineSeconds_.getInt(i)); - } - for (int i = 0; i < modifyDeadlineAckIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( - output, 4, modifyDeadlineAckIds_.getRaw(i)); - } - if (streamAckDeadlineSeconds_ != 0) { - output.writeInt32(5, streamAckDeadlineSeconds_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, clientId_); - } - if (maxOutstandingMessages_ != 0L) { - output.writeInt64(7, maxOutstandingMessages_); - } - if (maxOutstandingBytes_ != 0L) { - output.writeInt64(8, maxOutstandingBytes_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_); - } - { - int dataSize = 0; - for (int i = 0; i < ackIds_.size(); i++) { - dataSize += computeStringSizeNoTag(ackIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getAckIdsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < modifyDeadlineSeconds_.size(); i++) { - dataSize += - com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag( - modifyDeadlineSeconds_.getInt(i)); - } - size += dataSize; - if (!getModifyDeadlineSecondsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); - } - modifyDeadlineSecondsMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < modifyDeadlineAckIds_.size(); i++) { - dataSize += computeStringSizeNoTag(modifyDeadlineAckIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getModifyDeadlineAckIdsList().size(); - } - if (streamAckDeadlineSeconds_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, streamAckDeadlineSeconds_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, clientId_); - } - if (maxOutstandingMessages_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, maxOutstandingMessages_); - } - if (maxOutstandingBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, maxOutstandingBytes_); - } - size += getUnknownFields().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.StreamingPullRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.StreamingPullRequest other = - (com.google.pubsub.v1.StreamingPullRequest) obj; - - if (!getSubscription().equals(other.getSubscription())) return false; - if (!getAckIdsList().equals(other.getAckIdsList())) return false; - if (!getModifyDeadlineSecondsList().equals(other.getModifyDeadlineSecondsList())) return false; - if (!getModifyDeadlineAckIdsList().equals(other.getModifyDeadlineAckIdsList())) return false; - if (getStreamAckDeadlineSeconds() != other.getStreamAckDeadlineSeconds()) return false; - if (!getClientId().equals(other.getClientId())) return false; - if (getMaxOutstandingMessages() != other.getMaxOutstandingMessages()) return false; - if (getMaxOutstandingBytes() != other.getMaxOutstandingBytes()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - if (getAckIdsCount() > 0) { - hash = (37 * hash) + ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getAckIdsList().hashCode(); - } - if (getModifyDeadlineSecondsCount() > 0) { - hash = (37 * hash) + MODIFY_DEADLINE_SECONDS_FIELD_NUMBER; - hash = (53 * hash) + getModifyDeadlineSecondsList().hashCode(); - } - if (getModifyDeadlineAckIdsCount() > 0) { - hash = (37 * hash) + MODIFY_DEADLINE_ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getModifyDeadlineAckIdsList().hashCode(); - } - hash = (37 * hash) + STREAM_ACK_DEADLINE_SECONDS_FIELD_NUMBER; - hash = (53 * hash) + getStreamAckDeadlineSeconds(); - hash = (37 * hash) + CLIENT_ID_FIELD_NUMBER; - hash = (53 * hash) + getClientId().hashCode(); - hash = (37 * hash) + MAX_OUTSTANDING_MESSAGES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxOutstandingMessages()); - hash = (37 * hash) + MAX_OUTSTANDING_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMaxOutstandingBytes()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.StreamingPullRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullRequest 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.StreamingPullRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullRequest 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.StreamingPullRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.StreamingPullRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullRequest 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.StreamingPullRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullRequest 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.StreamingPullRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullRequest 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.StreamingPullRequest 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 `StreamingPull` streaming RPC method. This request is used to
-   * establish the initial stream as well as to stream acknowledgements and ack
-   * deadline modifications from the client to the server.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.StreamingPullRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.StreamingPullRequest) - com.google.pubsub.v1.StreamingPullRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.StreamingPullRequest.class, - com.google.pubsub.v1.StreamingPullRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.StreamingPullRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscription_ = ""; - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - modifyDeadlineSeconds_ = emptyIntList(); - modifyDeadlineAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - streamAckDeadlineSeconds_ = 0; - clientId_ = ""; - maxOutstandingMessages_ = 0L; - maxOutstandingBytes_ = 0L; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.StreamingPullRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullRequest build() { - com.google.pubsub.v1.StreamingPullRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullRequest buildPartial() { - com.google.pubsub.v1.StreamingPullRequest result = - new com.google.pubsub.v1.StreamingPullRequest(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(com.google.pubsub.v1.StreamingPullRequest result) { - if (((bitField0_ & 0x00000004) != 0)) { - modifyDeadlineSeconds_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.modifyDeadlineSeconds_ = modifyDeadlineSeconds_; - } - - private void buildPartial0(com.google.pubsub.v1.StreamingPullRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.subscription_ = subscription_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - ackIds_.makeImmutable(); - result.ackIds_ = ackIds_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - modifyDeadlineAckIds_.makeImmutable(); - result.modifyDeadlineAckIds_ = modifyDeadlineAckIds_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.streamAckDeadlineSeconds_ = streamAckDeadlineSeconds_; - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.clientId_ = clientId_; - } - if (((from_bitField0_ & 0x00000040) != 0)) { - result.maxOutstandingMessages_ = maxOutstandingMessages_; - } - if (((from_bitField0_ & 0x00000080) != 0)) { - result.maxOutstandingBytes_ = maxOutstandingBytes_; - } - } - - @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.StreamingPullRequest) { - return mergeFrom((com.google.pubsub.v1.StreamingPullRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.StreamingPullRequest other) { - if (other == com.google.pubsub.v1.StreamingPullRequest.getDefaultInstance()) return this; - if (!other.getSubscription().isEmpty()) { - subscription_ = other.subscription_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.ackIds_.isEmpty()) { - if (ackIds_.isEmpty()) { - ackIds_ = other.ackIds_; - bitField0_ |= 0x00000002; - } else { - ensureAckIdsIsMutable(); - ackIds_.addAll(other.ackIds_); - } - onChanged(); - } - if (!other.modifyDeadlineSeconds_.isEmpty()) { - if (modifyDeadlineSeconds_.isEmpty()) { - modifyDeadlineSeconds_ = other.modifyDeadlineSeconds_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureModifyDeadlineSecondsIsMutable(); - modifyDeadlineSeconds_.addAll(other.modifyDeadlineSeconds_); - } - onChanged(); - } - if (!other.modifyDeadlineAckIds_.isEmpty()) { - if (modifyDeadlineAckIds_.isEmpty()) { - modifyDeadlineAckIds_ = other.modifyDeadlineAckIds_; - bitField0_ |= 0x00000008; - } else { - ensureModifyDeadlineAckIdsIsMutable(); - modifyDeadlineAckIds_.addAll(other.modifyDeadlineAckIds_); - } - onChanged(); - } - if (other.getStreamAckDeadlineSeconds() != 0) { - setStreamAckDeadlineSeconds(other.getStreamAckDeadlineSeconds()); - } - if (!other.getClientId().isEmpty()) { - clientId_ = other.clientId_; - bitField0_ |= 0x00000020; - onChanged(); - } - if (other.getMaxOutstandingMessages() != 0L) { - setMaxOutstandingMessages(other.getMaxOutstandingMessages()); - } - if (other.getMaxOutstandingBytes() != 0L) { - setMaxOutstandingBytes(other.getMaxOutstandingBytes()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - subscription_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureAckIdsIsMutable(); - ackIds_.add(s); - break; - } // case 18 - case 24: - { - int v = input.readInt32(); - ensureModifyDeadlineSecondsIsMutable(); - modifyDeadlineSeconds_.addInt(v); - break; - } // case 24 - case 26: - { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - ensureModifyDeadlineSecondsIsMutable(); - while (input.getBytesUntilLimit() > 0) { - modifyDeadlineSeconds_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } // case 26 - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureModifyDeadlineAckIdsIsMutable(); - modifyDeadlineAckIds_.add(s); - break; - } // case 34 - case 40: - { - streamAckDeadlineSeconds_ = input.readInt32(); - bitField0_ |= 0x00000010; - break; - } // case 40 - case 50: - { - clientId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000020; - break; - } // case 50 - case 56: - { - maxOutstandingMessages_ = input.readInt64(); - bitField0_ |= 0x00000040; - break; - } // case 56 - case 64: - { - maxOutstandingBytes_ = input.readInt64(); - bitField0_ |= 0x00000080; - break; - } // case 64 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object subscription_ = ""; - /** - * - * - *
-     * Required. The subscription for which to initialize the new stream. This
-     * must be provided in the first request on the stream, and must not be set in
-     * subsequent requests from client to server.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - public java.lang.String getSubscription() { - java.lang.Object ref = subscription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subscription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The subscription for which to initialize the new stream. This
-     * must be provided in the first request on the stream, and must not be set in
-     * subsequent requests from client to server.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - public com.google.protobuf.ByteString getSubscriptionBytes() { - java.lang.Object ref = subscription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subscription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The subscription for which to initialize the new stream. This
-     * must be provided in the first request on the stream, and must not be set in
-     * subsequent requests from client to server.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription for which to initialize the new stream. This
-     * must be provided in the first request on the stream, and must not be set in
-     * subsequent requests from client to server.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearSubscription() { - subscription_ = getDefaultInstance().getSubscription(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The subscription for which to initialize the new stream. This
-     * must be provided in the first request on the stream, and must not be set in
-     * subsequent requests from client to server.
-     * Format is `projects/{project}/subscriptions/{sub}`.
-     * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for subscription to set. - * @return This builder for chaining. - */ - public Builder setSubscriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - subscription_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringArrayList ackIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureAckIdsIsMutable() { - if (!ackIds_.isModifiable()) { - ackIds_ = new com.google.protobuf.LazyStringArrayList(ackIds_); - } - bitField0_ |= 0x00000002; - } - /** - * - * - *
-     * List of acknowledgement IDs for acknowledging previously received messages
-     * (received on this stream or a different stream). If an ack ID has expired,
-     * the corresponding message may be redelivered later. Acknowledging a message
-     * more than once will not result in an error. If the acknowledgement ID is
-     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated string ack_ids = 2; - * - * @return A list containing the ackIds. - */ - public com.google.protobuf.ProtocolStringList getAckIdsList() { - ackIds_.makeImmutable(); - return ackIds_; - } - /** - * - * - *
-     * List of acknowledgement IDs for acknowledging previously received messages
-     * (received on this stream or a different stream). If an ack ID has expired,
-     * the corresponding message may be redelivered later. Acknowledging a message
-     * more than once will not result in an error. If the acknowledgement ID is
-     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated string ack_ids = 2; - * - * @return The count of ackIds. - */ - public int getAckIdsCount() { - return ackIds_.size(); - } - /** - * - * - *
-     * List of acknowledgement IDs for acknowledging previously received messages
-     * (received on this stream or a different stream). If an ack ID has expired,
-     * the corresponding message may be redelivered later. Acknowledging a message
-     * more than once will not result in an error. If the acknowledgement ID is
-     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated string ack_ids = 2; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - public java.lang.String getAckIds(int index) { - return ackIds_.get(index); - } - /** - * - * - *
-     * List of acknowledgement IDs for acknowledging previously received messages
-     * (received on this stream or a different stream). If an ack ID has expired,
-     * the corresponding message may be redelivered later. Acknowledging a message
-     * more than once will not result in an error. If the acknowledgement ID is
-     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated string ack_ids = 2; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - public com.google.protobuf.ByteString getAckIdsBytes(int index) { - return ackIds_.getByteString(index); - } - /** - * - * - *
-     * List of acknowledgement IDs for acknowledging previously received messages
-     * (received on this stream or a different stream). If an ack ID has expired,
-     * the corresponding message may be redelivered later. Acknowledging a message
-     * more than once will not result in an error. If the acknowledgement ID is
-     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated string ack_ids = 2; - * - * @param index The index to set the value at. - * @param value The ackIds to set. - * @return This builder for chaining. - */ - public Builder setAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAckIdsIsMutable(); - ackIds_.set(index, value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * List of acknowledgement IDs for acknowledging previously received messages
-     * (received on this stream or a different stream). If an ack ID has expired,
-     * the corresponding message may be redelivered later. Acknowledging a message
-     * more than once will not result in an error. If the acknowledgement ID is
-     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated string ack_ids = 2; - * - * @param value The ackIds to add. - * @return This builder for chaining. - */ - public Builder addAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAckIdsIsMutable(); - ackIds_.add(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * List of acknowledgement IDs for acknowledging previously received messages
-     * (received on this stream or a different stream). If an ack ID has expired,
-     * the corresponding message may be redelivered later. Acknowledging a message
-     * more than once will not result in an error. If the acknowledgement ID is
-     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated string ack_ids = 2; - * - * @param values The ackIds to add. - * @return This builder for chaining. - */ - public Builder addAllAckIds(java.lang.Iterable values) { - ensureAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ackIds_); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * List of acknowledgement IDs for acknowledging previously received messages
-     * (received on this stream or a different stream). If an ack ID has expired,
-     * the corresponding message may be redelivered later. Acknowledging a message
-     * more than once will not result in an error. If the acknowledgement ID is
-     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated string ack_ids = 2; - * - * @return This builder for chaining. - */ - public Builder clearAckIds() { - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - ; - onChanged(); - return this; - } - /** - * - * - *
-     * List of acknowledgement IDs for acknowledging previously received messages
-     * (received on this stream or a different stream). If an ack ID has expired,
-     * the corresponding message may be redelivered later. Acknowledging a message
-     * more than once will not result in an error. If the acknowledgement ID is
-     * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated string ack_ids = 2; - * - * @param value The bytes of the ackIds to add. - * @return This builder for chaining. - */ - public Builder addAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAckIdsIsMutable(); - ackIds_.add(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList modifyDeadlineSeconds_ = emptyIntList(); - - private void ensureModifyDeadlineSecondsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - modifyDeadlineSeconds_ = mutableCopy(modifyDeadlineSeconds_); - bitField0_ |= 0x00000004; - } - } - /** - * - * - *
-     * The list of new ack deadlines for the IDs listed in
-     * `modify_deadline_ack_ids`. The size of this list must be the same as the
-     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-     * element in the same position in `modify_deadline_ack_ids`. The new ack
-     * deadline is with respect to the time this request was sent to the Pub/Sub
-     * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-     * will expire 10 seconds after this request is received. If the value is 0,
-     * the message is immediately made available for another streaming or
-     * non-streaming pull request. If the value is < 0 (an error), the stream will
-     * be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @return A list containing the modifyDeadlineSeconds. - */ - public java.util.List getModifyDeadlineSecondsList() { - return ((bitField0_ & 0x00000004) != 0) - ? java.util.Collections.unmodifiableList(modifyDeadlineSeconds_) - : modifyDeadlineSeconds_; - } - /** - * - * - *
-     * The list of new ack deadlines for the IDs listed in
-     * `modify_deadline_ack_ids`. The size of this list must be the same as the
-     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-     * element in the same position in `modify_deadline_ack_ids`. The new ack
-     * deadline is with respect to the time this request was sent to the Pub/Sub
-     * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-     * will expire 10 seconds after this request is received. If the value is 0,
-     * the message is immediately made available for another streaming or
-     * non-streaming pull request. If the value is < 0 (an error), the stream will
-     * be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @return The count of modifyDeadlineSeconds. - */ - public int getModifyDeadlineSecondsCount() { - return modifyDeadlineSeconds_.size(); - } - /** - * - * - *
-     * The list of new ack deadlines for the IDs listed in
-     * `modify_deadline_ack_ids`. The size of this list must be the same as the
-     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-     * element in the same position in `modify_deadline_ack_ids`. The new ack
-     * deadline is with respect to the time this request was sent to the Pub/Sub
-     * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-     * will expire 10 seconds after this request is received. If the value is 0,
-     * the message is immediately made available for another streaming or
-     * non-streaming pull request. If the value is < 0 (an error), the stream will
-     * be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @param index The index of the element to return. - * @return The modifyDeadlineSeconds at the given index. - */ - public int getModifyDeadlineSeconds(int index) { - return modifyDeadlineSeconds_.getInt(index); - } - /** - * - * - *
-     * The list of new ack deadlines for the IDs listed in
-     * `modify_deadline_ack_ids`. The size of this list must be the same as the
-     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-     * element in the same position in `modify_deadline_ack_ids`. The new ack
-     * deadline is with respect to the time this request was sent to the Pub/Sub
-     * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-     * will expire 10 seconds after this request is received. If the value is 0,
-     * the message is immediately made available for another streaming or
-     * non-streaming pull request. If the value is < 0 (an error), the stream will
-     * be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @param index The index to set the value at. - * @param value The modifyDeadlineSeconds to set. - * @return This builder for chaining. - */ - public Builder setModifyDeadlineSeconds(int index, int value) { - - ensureModifyDeadlineSecondsIsMutable(); - modifyDeadlineSeconds_.setInt(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * The list of new ack deadlines for the IDs listed in
-     * `modify_deadline_ack_ids`. The size of this list must be the same as the
-     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-     * element in the same position in `modify_deadline_ack_ids`. The new ack
-     * deadline is with respect to the time this request was sent to the Pub/Sub
-     * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-     * will expire 10 seconds after this request is received. If the value is 0,
-     * the message is immediately made available for another streaming or
-     * non-streaming pull request. If the value is < 0 (an error), the stream will
-     * be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @param value The modifyDeadlineSeconds to add. - * @return This builder for chaining. - */ - public Builder addModifyDeadlineSeconds(int value) { - - ensureModifyDeadlineSecondsIsMutable(); - modifyDeadlineSeconds_.addInt(value); - onChanged(); - return this; - } - /** - * - * - *
-     * The list of new ack deadlines for the IDs listed in
-     * `modify_deadline_ack_ids`. The size of this list must be the same as the
-     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-     * element in the same position in `modify_deadline_ack_ids`. The new ack
-     * deadline is with respect to the time this request was sent to the Pub/Sub
-     * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-     * will expire 10 seconds after this request is received. If the value is 0,
-     * the message is immediately made available for another streaming or
-     * non-streaming pull request. If the value is < 0 (an error), the stream will
-     * be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @param values The modifyDeadlineSeconds to add. - * @return This builder for chaining. - */ - public Builder addAllModifyDeadlineSeconds( - java.lang.Iterable values) { - ensureModifyDeadlineSecondsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, modifyDeadlineSeconds_); - onChanged(); - return this; - } - /** - * - * - *
-     * The list of new ack deadlines for the IDs listed in
-     * `modify_deadline_ack_ids`. The size of this list must be the same as the
-     * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-     * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-     * element in the same position in `modify_deadline_ack_ids`. The new ack
-     * deadline is with respect to the time this request was sent to the Pub/Sub
-     * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-     * will expire 10 seconds after this request is received. If the value is 0,
-     * the message is immediately made available for another streaming or
-     * non-streaming pull request. If the value is < 0 (an error), the stream will
-     * be aborted with status `INVALID_ARGUMENT`.
-     * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @return This builder for chaining. - */ - public Builder clearModifyDeadlineSeconds() { - modifyDeadlineSeconds_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringArrayList modifyDeadlineAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureModifyDeadlineAckIdsIsMutable() { - if (!modifyDeadlineAckIds_.isModifiable()) { - modifyDeadlineAckIds_ = new com.google.protobuf.LazyStringArrayList(modifyDeadlineAckIds_); - } - bitField0_ |= 0x00000008; - } - /** - * - * - *
-     * List of acknowledgement IDs whose deadline will be modified based on the
-     * corresponding element in `modify_deadline_seconds`. This field can be used
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted.
-     * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @return A list containing the modifyDeadlineAckIds. - */ - public com.google.protobuf.ProtocolStringList getModifyDeadlineAckIdsList() { - modifyDeadlineAckIds_.makeImmutable(); - return modifyDeadlineAckIds_; - } - /** - * - * - *
-     * List of acknowledgement IDs whose deadline will be modified based on the
-     * corresponding element in `modify_deadline_seconds`. This field can be used
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted.
-     * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @return The count of modifyDeadlineAckIds. - */ - public int getModifyDeadlineAckIdsCount() { - return modifyDeadlineAckIds_.size(); - } - /** - * - * - *
-     * List of acknowledgement IDs whose deadline will be modified based on the
-     * corresponding element in `modify_deadline_seconds`. This field can be used
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted.
-     * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @param index The index of the element to return. - * @return The modifyDeadlineAckIds at the given index. - */ - public java.lang.String getModifyDeadlineAckIds(int index) { - return modifyDeadlineAckIds_.get(index); - } - /** - * - * - *
-     * List of acknowledgement IDs whose deadline will be modified based on the
-     * corresponding element in `modify_deadline_seconds`. This field can be used
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted.
-     * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @param index The index of the value to return. - * @return The bytes of the modifyDeadlineAckIds at the given index. - */ - public com.google.protobuf.ByteString getModifyDeadlineAckIdsBytes(int index) { - return modifyDeadlineAckIds_.getByteString(index); - } - /** - * - * - *
-     * List of acknowledgement IDs whose deadline will be modified based on the
-     * corresponding element in `modify_deadline_seconds`. This field can be used
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted.
-     * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @param index The index to set the value at. - * @param value The modifyDeadlineAckIds to set. - * @return This builder for chaining. - */ - public Builder setModifyDeadlineAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureModifyDeadlineAckIdsIsMutable(); - modifyDeadlineAckIds_.set(index, value); - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * List of acknowledgement IDs whose deadline will be modified based on the
-     * corresponding element in `modify_deadline_seconds`. This field can be used
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted.
-     * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @param value The modifyDeadlineAckIds to add. - * @return This builder for chaining. - */ - public Builder addModifyDeadlineAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureModifyDeadlineAckIdsIsMutable(); - modifyDeadlineAckIds_.add(value); - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * List of acknowledgement IDs whose deadline will be modified based on the
-     * corresponding element in `modify_deadline_seconds`. This field can be used
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted.
-     * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @param values The modifyDeadlineAckIds to add. - * @return This builder for chaining. - */ - public Builder addAllModifyDeadlineAckIds(java.lang.Iterable values) { - ensureModifyDeadlineAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, modifyDeadlineAckIds_); - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * List of acknowledgement IDs whose deadline will be modified based on the
-     * corresponding element in `modify_deadline_seconds`. This field can be used
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted.
-     * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @return This builder for chaining. - */ - public Builder clearModifyDeadlineAckIds() { - modifyDeadlineAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - ; - onChanged(); - return this; - } - /** - * - * - *
-     * List of acknowledgement IDs whose deadline will be modified based on the
-     * corresponding element in `modify_deadline_seconds`. This field can be used
-     * to indicate that more time is needed to process a message by the
-     * subscriber, or to make the message available for redelivery if the
-     * processing was interrupted.
-     * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @param value The bytes of the modifyDeadlineAckIds to add. - * @return This builder for chaining. - */ - public Builder addModifyDeadlineAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureModifyDeadlineAckIdsIsMutable(); - modifyDeadlineAckIds_.add(value); - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - private int streamAckDeadlineSeconds_; - /** - * - * - *
-     * Required. The ack deadline to use for the stream. This must be provided in
-     * the first request on the stream, but it can also be updated on subsequent
-     * requests from client to server. The minimum deadline you can specify is 10
-     * seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
-     * 
- * - * int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The streamAckDeadlineSeconds. - */ - @java.lang.Override - public int getStreamAckDeadlineSeconds() { - return streamAckDeadlineSeconds_; - } - /** - * - * - *
-     * Required. The ack deadline to use for the stream. This must be provided in
-     * the first request on the stream, but it can also be updated on subsequent
-     * requests from client to server. The minimum deadline you can specify is 10
-     * seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
-     * 
- * - * int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The streamAckDeadlineSeconds to set. - * @return This builder for chaining. - */ - public Builder setStreamAckDeadlineSeconds(int value) { - - streamAckDeadlineSeconds_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The ack deadline to use for the stream. This must be provided in
-     * the first request on the stream, but it can also be updated on subsequent
-     * requests from client to server. The minimum deadline you can specify is 10
-     * seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
-     * 
- * - * int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearStreamAckDeadlineSeconds() { - bitField0_ = (bitField0_ & ~0x00000010); - streamAckDeadlineSeconds_ = 0; - onChanged(); - return this; - } - - private java.lang.Object clientId_ = ""; - /** - * - * - *
-     * A unique identifier that is used to distinguish client instances from each
-     * other. Only needs to be provided on the initial request. When a stream
-     * disconnects and reconnects for the same stream, the client_id should be set
-     * to the same value so that state associated with the old stream can be
-     * transferred to the new stream. The same client_id should not be used for
-     * different client instances.
-     * 
- * - * string client_id = 6; - * - * @return The clientId. - */ - public java.lang.String getClientId() { - java.lang.Object ref = clientId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - clientId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * A unique identifier that is used to distinguish client instances from each
-     * other. Only needs to be provided on the initial request. When a stream
-     * disconnects and reconnects for the same stream, the client_id should be set
-     * to the same value so that state associated with the old stream can be
-     * transferred to the new stream. The same client_id should not be used for
-     * different client instances.
-     * 
- * - * string client_id = 6; - * - * @return The bytes for clientId. - */ - public com.google.protobuf.ByteString getClientIdBytes() { - java.lang.Object ref = clientId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - clientId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * A unique identifier that is used to distinguish client instances from each
-     * other. Only needs to be provided on the initial request. When a stream
-     * disconnects and reconnects for the same stream, the client_id should be set
-     * to the same value so that state associated with the old stream can be
-     * transferred to the new stream. The same client_id should not be used for
-     * different client instances.
-     * 
- * - * string client_id = 6; - * - * @param value The clientId to set. - * @return This builder for chaining. - */ - public Builder setClientId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - clientId_ = value; - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - /** - * - * - *
-     * A unique identifier that is used to distinguish client instances from each
-     * other. Only needs to be provided on the initial request. When a stream
-     * disconnects and reconnects for the same stream, the client_id should be set
-     * to the same value so that state associated with the old stream can be
-     * transferred to the new stream. The same client_id should not be used for
-     * different client instances.
-     * 
- * - * string client_id = 6; - * - * @return This builder for chaining. - */ - public Builder clearClientId() { - clientId_ = getDefaultInstance().getClientId(); - bitField0_ = (bitField0_ & ~0x00000020); - onChanged(); - return this; - } - /** - * - * - *
-     * A unique identifier that is used to distinguish client instances from each
-     * other. Only needs to be provided on the initial request. When a stream
-     * disconnects and reconnects for the same stream, the client_id should be set
-     * to the same value so that state associated with the old stream can be
-     * transferred to the new stream. The same client_id should not be used for
-     * different client instances.
-     * 
- * - * string client_id = 6; - * - * @param value The bytes for clientId to set. - * @return This builder for chaining. - */ - public Builder setClientIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - clientId_ = value; - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - - private long maxOutstandingMessages_; - /** - * - * - *
-     * Flow control settings for the maximum number of outstanding messages. When
-     * there are `max_outstanding_messages` or more currently sent to the
-     * streaming pull client that have not yet been acked or nacked, the server
-     * stops sending more messages. The sending of messages resumes once the
-     * number of outstanding messages is less than this value. If the value is
-     * <= 0, there is no limit to the number of outstanding messages. This
-     * property can only be set on the initial StreamingPullRequest. If it is set
-     * on a subsequent request, the stream will be aborted with status
-     * `INVALID_ARGUMENT`.
-     * 
- * - * int64 max_outstanding_messages = 7; - * - * @return The maxOutstandingMessages. - */ - @java.lang.Override - public long getMaxOutstandingMessages() { - return maxOutstandingMessages_; - } - /** - * - * - *
-     * Flow control settings for the maximum number of outstanding messages. When
-     * there are `max_outstanding_messages` or more currently sent to the
-     * streaming pull client that have not yet been acked or nacked, the server
-     * stops sending more messages. The sending of messages resumes once the
-     * number of outstanding messages is less than this value. If the value is
-     * <= 0, there is no limit to the number of outstanding messages. This
-     * property can only be set on the initial StreamingPullRequest. If it is set
-     * on a subsequent request, the stream will be aborted with status
-     * `INVALID_ARGUMENT`.
-     * 
- * - * int64 max_outstanding_messages = 7; - * - * @param value The maxOutstandingMessages to set. - * @return This builder for chaining. - */ - public Builder setMaxOutstandingMessages(long value) { - - maxOutstandingMessages_ = value; - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - /** - * - * - *
-     * Flow control settings for the maximum number of outstanding messages. When
-     * there are `max_outstanding_messages` or more currently sent to the
-     * streaming pull client that have not yet been acked or nacked, the server
-     * stops sending more messages. The sending of messages resumes once the
-     * number of outstanding messages is less than this value. If the value is
-     * <= 0, there is no limit to the number of outstanding messages. This
-     * property can only be set on the initial StreamingPullRequest. If it is set
-     * on a subsequent request, the stream will be aborted with status
-     * `INVALID_ARGUMENT`.
-     * 
- * - * int64 max_outstanding_messages = 7; - * - * @return This builder for chaining. - */ - public Builder clearMaxOutstandingMessages() { - bitField0_ = (bitField0_ & ~0x00000040); - maxOutstandingMessages_ = 0L; - onChanged(); - return this; - } - - private long maxOutstandingBytes_; - /** - * - * - *
-     * Flow control settings for the maximum number of outstanding bytes. When
-     * there are `max_outstanding_bytes` or more worth of messages currently sent
-     * to the streaming pull client that have not yet been acked or nacked, the
-     * server will stop sending more messages. The sending of messages resumes
-     * once the number of outstanding bytes is less than this value. If the value
-     * is <= 0, there is no limit to the number of outstanding bytes. This
-     * property can only be set on the initial StreamingPullRequest. If it is set
-     * on a subsequent request, the stream will be aborted with status
-     * `INVALID_ARGUMENT`.
-     * 
- * - * int64 max_outstanding_bytes = 8; - * - * @return The maxOutstandingBytes. - */ - @java.lang.Override - public long getMaxOutstandingBytes() { - return maxOutstandingBytes_; - } - /** - * - * - *
-     * Flow control settings for the maximum number of outstanding bytes. When
-     * there are `max_outstanding_bytes` or more worth of messages currently sent
-     * to the streaming pull client that have not yet been acked or nacked, the
-     * server will stop sending more messages. The sending of messages resumes
-     * once the number of outstanding bytes is less than this value. If the value
-     * is <= 0, there is no limit to the number of outstanding bytes. This
-     * property can only be set on the initial StreamingPullRequest. If it is set
-     * on a subsequent request, the stream will be aborted with status
-     * `INVALID_ARGUMENT`.
-     * 
- * - * int64 max_outstanding_bytes = 8; - * - * @param value The maxOutstandingBytes to set. - * @return This builder for chaining. - */ - public Builder setMaxOutstandingBytes(long value) { - - maxOutstandingBytes_ = value; - bitField0_ |= 0x00000080; - onChanged(); - return this; - } - /** - * - * - *
-     * Flow control settings for the maximum number of outstanding bytes. When
-     * there are `max_outstanding_bytes` or more worth of messages currently sent
-     * to the streaming pull client that have not yet been acked or nacked, the
-     * server will stop sending more messages. The sending of messages resumes
-     * once the number of outstanding bytes is less than this value. If the value
-     * is <= 0, there is no limit to the number of outstanding bytes. This
-     * property can only be set on the initial StreamingPullRequest. If it is set
-     * on a subsequent request, the stream will be aborted with status
-     * `INVALID_ARGUMENT`.
-     * 
- * - * int64 max_outstanding_bytes = 8; - * - * @return This builder for chaining. - */ - public Builder clearMaxOutstandingBytes() { - bitField0_ = (bitField0_ & ~0x00000080); - maxOutstandingBytes_ = 0L; - 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.StreamingPullRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.StreamingPullRequest) - private static final com.google.pubsub.v1.StreamingPullRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.StreamingPullRequest(); - } - - public static com.google.pubsub.v1.StreamingPullRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingPullRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.StreamingPullRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullRequestOrBuilder.java deleted file mode 100644 index 1a8ca38b5..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullRequestOrBuilder.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright 2023 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 StreamingPullRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.StreamingPullRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The subscription for which to initialize the new stream. This
-   * must be provided in the first request on the stream, and must not be set in
-   * subsequent requests from client to server.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The subscription. - */ - java.lang.String getSubscription(); - /** - * - * - *
-   * Required. The subscription for which to initialize the new stream. This
-   * must be provided in the first request on the stream, and must not be set in
-   * subsequent requests from client to server.
-   * Format is `projects/{project}/subscriptions/{sub}`.
-   * 
- * - * - * string subscription = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for subscription. - */ - com.google.protobuf.ByteString getSubscriptionBytes(); - - /** - * - * - *
-   * List of acknowledgement IDs for acknowledging previously received messages
-   * (received on this stream or a different stream). If an ack ID has expired,
-   * the corresponding message may be redelivered later. Acknowledging a message
-   * more than once will not result in an error. If the acknowledgement ID is
-   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated string ack_ids = 2; - * - * @return A list containing the ackIds. - */ - java.util.List getAckIdsList(); - /** - * - * - *
-   * List of acknowledgement IDs for acknowledging previously received messages
-   * (received on this stream or a different stream). If an ack ID has expired,
-   * the corresponding message may be redelivered later. Acknowledging a message
-   * more than once will not result in an error. If the acknowledgement ID is
-   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated string ack_ids = 2; - * - * @return The count of ackIds. - */ - int getAckIdsCount(); - /** - * - * - *
-   * List of acknowledgement IDs for acknowledging previously received messages
-   * (received on this stream or a different stream). If an ack ID has expired,
-   * the corresponding message may be redelivered later. Acknowledging a message
-   * more than once will not result in an error. If the acknowledgement ID is
-   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated string ack_ids = 2; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - java.lang.String getAckIds(int index); - /** - * - * - *
-   * List of acknowledgement IDs for acknowledging previously received messages
-   * (received on this stream or a different stream). If an ack ID has expired,
-   * the corresponding message may be redelivered later. Acknowledging a message
-   * more than once will not result in an error. If the acknowledgement ID is
-   * malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated string ack_ids = 2; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - com.google.protobuf.ByteString getAckIdsBytes(int index); - - /** - * - * - *
-   * The list of new ack deadlines for the IDs listed in
-   * `modify_deadline_ack_ids`. The size of this list must be the same as the
-   * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-   * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-   * element in the same position in `modify_deadline_ack_ids`. The new ack
-   * deadline is with respect to the time this request was sent to the Pub/Sub
-   * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-   * will expire 10 seconds after this request is received. If the value is 0,
-   * the message is immediately made available for another streaming or
-   * non-streaming pull request. If the value is < 0 (an error), the stream will
-   * be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @return A list containing the modifyDeadlineSeconds. - */ - java.util.List getModifyDeadlineSecondsList(); - /** - * - * - *
-   * The list of new ack deadlines for the IDs listed in
-   * `modify_deadline_ack_ids`. The size of this list must be the same as the
-   * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-   * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-   * element in the same position in `modify_deadline_ack_ids`. The new ack
-   * deadline is with respect to the time this request was sent to the Pub/Sub
-   * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-   * will expire 10 seconds after this request is received. If the value is 0,
-   * the message is immediately made available for another streaming or
-   * non-streaming pull request. If the value is < 0 (an error), the stream will
-   * be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @return The count of modifyDeadlineSeconds. - */ - int getModifyDeadlineSecondsCount(); - /** - * - * - *
-   * The list of new ack deadlines for the IDs listed in
-   * `modify_deadline_ack_ids`. The size of this list must be the same as the
-   * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
-   * with `INVALID_ARGUMENT`. Each element in this list is applied to the
-   * element in the same position in `modify_deadline_ack_ids`. The new ack
-   * deadline is with respect to the time this request was sent to the Pub/Sub
-   * system. Must be >= 0. For example, if the value is 10, the new ack deadline
-   * will expire 10 seconds after this request is received. If the value is 0,
-   * the message is immediately made available for another streaming or
-   * non-streaming pull request. If the value is < 0 (an error), the stream will
-   * be aborted with status `INVALID_ARGUMENT`.
-   * 
- * - * repeated int32 modify_deadline_seconds = 3; - * - * @param index The index of the element to return. - * @return The modifyDeadlineSeconds at the given index. - */ - int getModifyDeadlineSeconds(int index); - - /** - * - * - *
-   * List of acknowledgement IDs whose deadline will be modified based on the
-   * corresponding element in `modify_deadline_seconds`. This field can be used
-   * to indicate that more time is needed to process a message by the
-   * subscriber, or to make the message available for redelivery if the
-   * processing was interrupted.
-   * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @return A list containing the modifyDeadlineAckIds. - */ - java.util.List getModifyDeadlineAckIdsList(); - /** - * - * - *
-   * List of acknowledgement IDs whose deadline will be modified based on the
-   * corresponding element in `modify_deadline_seconds`. This field can be used
-   * to indicate that more time is needed to process a message by the
-   * subscriber, or to make the message available for redelivery if the
-   * processing was interrupted.
-   * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @return The count of modifyDeadlineAckIds. - */ - int getModifyDeadlineAckIdsCount(); - /** - * - * - *
-   * List of acknowledgement IDs whose deadline will be modified based on the
-   * corresponding element in `modify_deadline_seconds`. This field can be used
-   * to indicate that more time is needed to process a message by the
-   * subscriber, or to make the message available for redelivery if the
-   * processing was interrupted.
-   * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @param index The index of the element to return. - * @return The modifyDeadlineAckIds at the given index. - */ - java.lang.String getModifyDeadlineAckIds(int index); - /** - * - * - *
-   * List of acknowledgement IDs whose deadline will be modified based on the
-   * corresponding element in `modify_deadline_seconds`. This field can be used
-   * to indicate that more time is needed to process a message by the
-   * subscriber, or to make the message available for redelivery if the
-   * processing was interrupted.
-   * 
- * - * repeated string modify_deadline_ack_ids = 4; - * - * @param index The index of the value to return. - * @return The bytes of the modifyDeadlineAckIds at the given index. - */ - com.google.protobuf.ByteString getModifyDeadlineAckIdsBytes(int index); - - /** - * - * - *
-   * Required. The ack deadline to use for the stream. This must be provided in
-   * the first request on the stream, but it can also be updated on subsequent
-   * requests from client to server. The minimum deadline you can specify is 10
-   * seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
-   * 
- * - * int32 stream_ack_deadline_seconds = 5 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The streamAckDeadlineSeconds. - */ - int getStreamAckDeadlineSeconds(); - - /** - * - * - *
-   * A unique identifier that is used to distinguish client instances from each
-   * other. Only needs to be provided on the initial request. When a stream
-   * disconnects and reconnects for the same stream, the client_id should be set
-   * to the same value so that state associated with the old stream can be
-   * transferred to the new stream. The same client_id should not be used for
-   * different client instances.
-   * 
- * - * string client_id = 6; - * - * @return The clientId. - */ - java.lang.String getClientId(); - /** - * - * - *
-   * A unique identifier that is used to distinguish client instances from each
-   * other. Only needs to be provided on the initial request. When a stream
-   * disconnects and reconnects for the same stream, the client_id should be set
-   * to the same value so that state associated with the old stream can be
-   * transferred to the new stream. The same client_id should not be used for
-   * different client instances.
-   * 
- * - * string client_id = 6; - * - * @return The bytes for clientId. - */ - com.google.protobuf.ByteString getClientIdBytes(); - - /** - * - * - *
-   * Flow control settings for the maximum number of outstanding messages. When
-   * there are `max_outstanding_messages` or more currently sent to the
-   * streaming pull client that have not yet been acked or nacked, the server
-   * stops sending more messages. The sending of messages resumes once the
-   * number of outstanding messages is less than this value. If the value is
-   * <= 0, there is no limit to the number of outstanding messages. This
-   * property can only be set on the initial StreamingPullRequest. If it is set
-   * on a subsequent request, the stream will be aborted with status
-   * `INVALID_ARGUMENT`.
-   * 
- * - * int64 max_outstanding_messages = 7; - * - * @return The maxOutstandingMessages. - */ - long getMaxOutstandingMessages(); - - /** - * - * - *
-   * Flow control settings for the maximum number of outstanding bytes. When
-   * there are `max_outstanding_bytes` or more worth of messages currently sent
-   * to the streaming pull client that have not yet been acked or nacked, the
-   * server will stop sending more messages. The sending of messages resumes
-   * once the number of outstanding bytes is less than this value. If the value
-   * is <= 0, there is no limit to the number of outstanding bytes. This
-   * property can only be set on the initial StreamingPullRequest. If it is set
-   * on a subsequent request, the stream will be aborted with status
-   * `INVALID_ARGUMENT`.
-   * 
- * - * int64 max_outstanding_bytes = 8; - * - * @return The maxOutstandingBytes. - */ - long getMaxOutstandingBytes(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullResponse.java deleted file mode 100644 index 52505da10..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullResponse.java +++ /dev/null @@ -1,5794 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Response for the `StreamingPull` method. This response is used to stream
- * messages from the server to the client.
- * 
- * - * Protobuf type {@code google.pubsub.v1.StreamingPullResponse} - */ -public final class StreamingPullResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.StreamingPullResponse) - StreamingPullResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use StreamingPullResponse.newBuilder() to construct. - private StreamingPullResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StreamingPullResponse() { - receivedMessages_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new StreamingPullResponse(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.StreamingPullResponse.class, - com.google.pubsub.v1.StreamingPullResponse.Builder.class); - } - - public interface AcknowledgeConfirmationOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @return A list containing the ackIds. - */ - java.util.List getAckIdsList(); - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @return The count of ackIds. - */ - int getAckIdsCount(); - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - java.lang.String getAckIds(int index); - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - com.google.protobuf.ByteString getAckIdsBytes(int index); - - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return A list containing the invalidAckIds. - */ - java.util.List getInvalidAckIdsList(); - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return The count of invalidAckIds. - */ - int getInvalidAckIdsCount(); - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the element to return. - * @return The invalidAckIds at the given index. - */ - java.lang.String getInvalidAckIds(int index); - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the value to return. - * @return The bytes of the invalidAckIds at the given index. - */ - com.google.protobuf.ByteString getInvalidAckIdsBytes(int index); - - /** - * - * - *
-     * List of acknowledgement IDs that were out of order.
-     * 
- * - * repeated string unordered_ack_ids = 3; - * - * @return A list containing the unorderedAckIds. - */ - java.util.List getUnorderedAckIdsList(); - /** - * - * - *
-     * List of acknowledgement IDs that were out of order.
-     * 
- * - * repeated string unordered_ack_ids = 3; - * - * @return The count of unorderedAckIds. - */ - int getUnorderedAckIdsCount(); - /** - * - * - *
-     * List of acknowledgement IDs that were out of order.
-     * 
- * - * repeated string unordered_ack_ids = 3; - * - * @param index The index of the element to return. - * @return The unorderedAckIds at the given index. - */ - java.lang.String getUnorderedAckIds(int index); - /** - * - * - *
-     * List of acknowledgement IDs that were out of order.
-     * 
- * - * repeated string unordered_ack_ids = 3; - * - * @param index The index of the value to return. - * @return The bytes of the unorderedAckIds at the given index. - */ - com.google.protobuf.ByteString getUnorderedAckIdsBytes(int index); - - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @return A list containing the temporaryFailedAckIds. - */ - java.util.List getTemporaryFailedAckIdsList(); - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @return The count of temporaryFailedAckIds. - */ - int getTemporaryFailedAckIdsCount(); - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @param index The index of the element to return. - * @return The temporaryFailedAckIds at the given index. - */ - java.lang.String getTemporaryFailedAckIds(int index); - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @param index The index of the value to return. - * @return The bytes of the temporaryFailedAckIds at the given index. - */ - com.google.protobuf.ByteString getTemporaryFailedAckIdsBytes(int index); - } - /** - * - * - *
-   * Acknowledgement IDs sent in one or more previous requests to acknowledge a
-   * previously received message.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} - */ - public static final class AcknowledgeConfirmation extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation) - AcknowledgeConfirmationOrBuilder { - private static final long serialVersionUID = 0L; - // Use AcknowledgeConfirmation.newBuilder() to construct. - private AcknowledgeConfirmation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AcknowledgeConfirmation() { - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - invalidAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - unorderedAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - temporaryFailedAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AcknowledgeConfirmation(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_AcknowledgeConfirmation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_AcknowledgeConfirmation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.class, - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.Builder.class); - } - - public static final int ACK_IDS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList ackIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @return A list containing the ackIds. - */ - public com.google.protobuf.ProtocolStringList getAckIdsList() { - return ackIds_; - } - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @return The count of ackIds. - */ - public int getAckIdsCount() { - return ackIds_.size(); - } - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - public java.lang.String getAckIds(int index) { - return ackIds_.get(index); - } - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - public com.google.protobuf.ByteString getAckIdsBytes(int index) { - return ackIds_.getByteString(index); - } - - public static final int INVALID_ACK_IDS_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList invalidAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return A list containing the invalidAckIds. - */ - public com.google.protobuf.ProtocolStringList getInvalidAckIdsList() { - return invalidAckIds_; - } - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return The count of invalidAckIds. - */ - public int getInvalidAckIdsCount() { - return invalidAckIds_.size(); - } - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the element to return. - * @return The invalidAckIds at the given index. - */ - public java.lang.String getInvalidAckIds(int index) { - return invalidAckIds_.get(index); - } - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the value to return. - * @return The bytes of the invalidAckIds at the given index. - */ - public com.google.protobuf.ByteString getInvalidAckIdsBytes(int index) { - return invalidAckIds_.getByteString(index); - } - - public static final int UNORDERED_ACK_IDS_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList unorderedAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-     * List of acknowledgement IDs that were out of order.
-     * 
- * - * repeated string unordered_ack_ids = 3; - * - * @return A list containing the unorderedAckIds. - */ - public com.google.protobuf.ProtocolStringList getUnorderedAckIdsList() { - return unorderedAckIds_; - } - /** - * - * - *
-     * List of acknowledgement IDs that were out of order.
-     * 
- * - * repeated string unordered_ack_ids = 3; - * - * @return The count of unorderedAckIds. - */ - public int getUnorderedAckIdsCount() { - return unorderedAckIds_.size(); - } - /** - * - * - *
-     * List of acknowledgement IDs that were out of order.
-     * 
- * - * repeated string unordered_ack_ids = 3; - * - * @param index The index of the element to return. - * @return The unorderedAckIds at the given index. - */ - public java.lang.String getUnorderedAckIds(int index) { - return unorderedAckIds_.get(index); - } - /** - * - * - *
-     * List of acknowledgement IDs that were out of order.
-     * 
- * - * repeated string unordered_ack_ids = 3; - * - * @param index The index of the value to return. - * @return The bytes of the unorderedAckIds at the given index. - */ - public com.google.protobuf.ByteString getUnorderedAckIdsBytes(int index) { - return unorderedAckIds_.getByteString(index); - } - - public static final int TEMPORARY_FAILED_ACK_IDS_FIELD_NUMBER = 4; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList temporaryFailedAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @return A list containing the temporaryFailedAckIds. - */ - public com.google.protobuf.ProtocolStringList getTemporaryFailedAckIdsList() { - return temporaryFailedAckIds_; - } - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @return The count of temporaryFailedAckIds. - */ - public int getTemporaryFailedAckIdsCount() { - return temporaryFailedAckIds_.size(); - } - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @param index The index of the element to return. - * @return The temporaryFailedAckIds at the given index. - */ - public java.lang.String getTemporaryFailedAckIds(int index) { - return temporaryFailedAckIds_.get(index); - } - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @param index The index of the value to return. - * @return The bytes of the temporaryFailedAckIds at the given index. - */ - public com.google.protobuf.ByteString getTemporaryFailedAckIdsBytes(int index) { - return temporaryFailedAckIds_.getByteString(index); - } - - 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 < ackIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ackIds_.getRaw(i)); - } - for (int i = 0; i < invalidAckIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, invalidAckIds_.getRaw(i)); - } - for (int i = 0; i < unorderedAckIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unorderedAckIds_.getRaw(i)); - } - for (int i = 0; i < temporaryFailedAckIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( - output, 4, temporaryFailedAckIds_.getRaw(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < ackIds_.size(); i++) { - dataSize += computeStringSizeNoTag(ackIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getAckIdsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < invalidAckIds_.size(); i++) { - dataSize += computeStringSizeNoTag(invalidAckIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getInvalidAckIdsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < unorderedAckIds_.size(); i++) { - dataSize += computeStringSizeNoTag(unorderedAckIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getUnorderedAckIdsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < temporaryFailedAckIds_.size(); i++) { - dataSize += computeStringSizeNoTag(temporaryFailedAckIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getTemporaryFailedAckIdsList().size(); - } - size += getUnknownFields().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.StreamingPullResponse.AcknowledgeConfirmation)) { - return super.equals(obj); - } - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation other = - (com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation) obj; - - if (!getAckIdsList().equals(other.getAckIdsList())) return false; - if (!getInvalidAckIdsList().equals(other.getInvalidAckIdsList())) return false; - if (!getUnorderedAckIdsList().equals(other.getUnorderedAckIdsList())) return false; - if (!getTemporaryFailedAckIdsList().equals(other.getTemporaryFailedAckIdsList())) - return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAckIdsCount() > 0) { - hash = (37 * hash) + ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getAckIdsList().hashCode(); - } - if (getInvalidAckIdsCount() > 0) { - hash = (37 * hash) + INVALID_ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getInvalidAckIdsList().hashCode(); - } - if (getUnorderedAckIdsCount() > 0) { - hash = (37 * hash) + UNORDERED_ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getUnorderedAckIdsList().hashCode(); - } - if (getTemporaryFailedAckIdsCount() > 0) { - hash = (37 * hash) + TEMPORARY_FAILED_ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getTemporaryFailedAckIdsList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation 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.StreamingPullResponse.AcknowledgeConfirmation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation 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.StreamingPullResponse.AcknowledgeConfirmation parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation 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.StreamingPullResponse.AcknowledgeConfirmation - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - 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.StreamingPullResponse.AcknowledgeConfirmation parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation 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.StreamingPullResponse.AcknowledgeConfirmation 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; - } - /** - * - * - *
-     * Acknowledgement IDs sent in one or more previous requests to acknowledge a
-     * previously received message.
-     * 
- * - * Protobuf type {@code google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation) - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_AcknowledgeConfirmation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_AcknowledgeConfirmation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.class, - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.Builder.class); - } - - // Construct using - // com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - invalidAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - unorderedAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - temporaryFailedAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_AcknowledgeConfirmation_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - getDefaultInstanceForType() { - return com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation build() { - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation buildPartial() { - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation result = - new com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - ackIds_.makeImmutable(); - result.ackIds_ = ackIds_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - invalidAckIds_.makeImmutable(); - result.invalidAckIds_ = invalidAckIds_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - unorderedAckIds_.makeImmutable(); - result.unorderedAckIds_ = unorderedAckIds_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - temporaryFailedAckIds_.makeImmutable(); - result.temporaryFailedAckIds_ = temporaryFailedAckIds_; - } - } - - @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.StreamingPullResponse.AcknowledgeConfirmation) { - return mergeFrom( - (com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation other) { - if (other - == com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - .getDefaultInstance()) return this; - if (!other.ackIds_.isEmpty()) { - if (ackIds_.isEmpty()) { - ackIds_ = other.ackIds_; - bitField0_ |= 0x00000001; - } else { - ensureAckIdsIsMutable(); - ackIds_.addAll(other.ackIds_); - } - onChanged(); - } - if (!other.invalidAckIds_.isEmpty()) { - if (invalidAckIds_.isEmpty()) { - invalidAckIds_ = other.invalidAckIds_; - bitField0_ |= 0x00000002; - } else { - ensureInvalidAckIdsIsMutable(); - invalidAckIds_.addAll(other.invalidAckIds_); - } - onChanged(); - } - if (!other.unorderedAckIds_.isEmpty()) { - if (unorderedAckIds_.isEmpty()) { - unorderedAckIds_ = other.unorderedAckIds_; - bitField0_ |= 0x00000004; - } else { - ensureUnorderedAckIdsIsMutable(); - unorderedAckIds_.addAll(other.unorderedAckIds_); - } - onChanged(); - } - if (!other.temporaryFailedAckIds_.isEmpty()) { - if (temporaryFailedAckIds_.isEmpty()) { - temporaryFailedAckIds_ = other.temporaryFailedAckIds_; - bitField0_ |= 0x00000008; - } else { - ensureTemporaryFailedAckIdsIsMutable(); - temporaryFailedAckIds_.addAll(other.temporaryFailedAckIds_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - 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(); - ensureAckIdsIsMutable(); - ackIds_.add(s); - break; - } // case 10 - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureInvalidAckIdsIsMutable(); - invalidAckIds_.add(s); - break; - } // case 18 - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureUnorderedAckIdsIsMutable(); - unorderedAckIds_.add(s); - break; - } // case 26 - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureTemporaryFailedAckIdsIsMutable(); - temporaryFailedAckIds_.add(s); - break; - } // case 34 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringArrayList ackIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureAckIdsIsMutable() { - if (!ackIds_.isModifiable()) { - ackIds_ = new com.google.protobuf.LazyStringArrayList(ackIds_); - } - bitField0_ |= 0x00000001; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @return A list containing the ackIds. - */ - public com.google.protobuf.ProtocolStringList getAckIdsList() { - ackIds_.makeImmutable(); - return ackIds_; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @return The count of ackIds. - */ - public int getAckIdsCount() { - return ackIds_.size(); - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - public java.lang.String getAckIds(int index) { - return ackIds_.get(index); - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - public com.google.protobuf.ByteString getAckIdsBytes(int index) { - return ackIds_.getByteString(index); - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param index The index to set the value at. - * @param value The ackIds to set. - * @return This builder for chaining. - */ - public Builder setAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAckIdsIsMutable(); - ackIds_.set(index, value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param value The ackIds to add. - * @return This builder for chaining. - */ - public Builder addAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAckIdsIsMutable(); - ackIds_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param values The ackIds to add. - * @return This builder for chaining. - */ - public Builder addAllAckIds(java.lang.Iterable values) { - ensureAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ackIds_); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @return This builder for chaining. - */ - public Builder clearAckIds() { - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - ; - onChanged(); - return this; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param value The bytes of the ackIds to add. - * @return This builder for chaining. - */ - public Builder addAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAckIdsIsMutable(); - ackIds_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringArrayList invalidAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureInvalidAckIdsIsMutable() { - if (!invalidAckIds_.isModifiable()) { - invalidAckIds_ = new com.google.protobuf.LazyStringArrayList(invalidAckIds_); - } - bitField0_ |= 0x00000002; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return A list containing the invalidAckIds. - */ - public com.google.protobuf.ProtocolStringList getInvalidAckIdsList() { - invalidAckIds_.makeImmutable(); - return invalidAckIds_; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return The count of invalidAckIds. - */ - public int getInvalidAckIdsCount() { - return invalidAckIds_.size(); - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the element to return. - * @return The invalidAckIds at the given index. - */ - public java.lang.String getInvalidAckIds(int index) { - return invalidAckIds_.get(index); - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the value to return. - * @return The bytes of the invalidAckIds at the given index. - */ - public com.google.protobuf.ByteString getInvalidAckIdsBytes(int index) { - return invalidAckIds_.getByteString(index); - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index to set the value at. - * @param value The invalidAckIds to set. - * @return This builder for chaining. - */ - public Builder setInvalidAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInvalidAckIdsIsMutable(); - invalidAckIds_.set(index, value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param value The invalidAckIds to add. - * @return This builder for chaining. - */ - public Builder addInvalidAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInvalidAckIdsIsMutable(); - invalidAckIds_.add(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param values The invalidAckIds to add. - * @return This builder for chaining. - */ - public Builder addAllInvalidAckIds(java.lang.Iterable values) { - ensureInvalidAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, invalidAckIds_); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return This builder for chaining. - */ - public Builder clearInvalidAckIds() { - invalidAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - ; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param value The bytes of the invalidAckIds to add. - * @return This builder for chaining. - */ - public Builder addInvalidAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureInvalidAckIdsIsMutable(); - invalidAckIds_.add(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringArrayList unorderedAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureUnorderedAckIdsIsMutable() { - if (!unorderedAckIds_.isModifiable()) { - unorderedAckIds_ = new com.google.protobuf.LazyStringArrayList(unorderedAckIds_); - } - bitField0_ |= 0x00000004; - } - /** - * - * - *
-       * List of acknowledgement IDs that were out of order.
-       * 
- * - * repeated string unordered_ack_ids = 3; - * - * @return A list containing the unorderedAckIds. - */ - public com.google.protobuf.ProtocolStringList getUnorderedAckIdsList() { - unorderedAckIds_.makeImmutable(); - return unorderedAckIds_; - } - /** - * - * - *
-       * List of acknowledgement IDs that were out of order.
-       * 
- * - * repeated string unordered_ack_ids = 3; - * - * @return The count of unorderedAckIds. - */ - public int getUnorderedAckIdsCount() { - return unorderedAckIds_.size(); - } - /** - * - * - *
-       * List of acknowledgement IDs that were out of order.
-       * 
- * - * repeated string unordered_ack_ids = 3; - * - * @param index The index of the element to return. - * @return The unorderedAckIds at the given index. - */ - public java.lang.String getUnorderedAckIds(int index) { - return unorderedAckIds_.get(index); - } - /** - * - * - *
-       * List of acknowledgement IDs that were out of order.
-       * 
- * - * repeated string unordered_ack_ids = 3; - * - * @param index The index of the value to return. - * @return The bytes of the unorderedAckIds at the given index. - */ - public com.google.protobuf.ByteString getUnorderedAckIdsBytes(int index) { - return unorderedAckIds_.getByteString(index); - } - /** - * - * - *
-       * List of acknowledgement IDs that were out of order.
-       * 
- * - * repeated string unordered_ack_ids = 3; - * - * @param index The index to set the value at. - * @param value The unorderedAckIds to set. - * @return This builder for chaining. - */ - public Builder setUnorderedAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureUnorderedAckIdsIsMutable(); - unorderedAckIds_.set(index, value); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were out of order.
-       * 
- * - * repeated string unordered_ack_ids = 3; - * - * @param value The unorderedAckIds to add. - * @return This builder for chaining. - */ - public Builder addUnorderedAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureUnorderedAckIdsIsMutable(); - unorderedAckIds_.add(value); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were out of order.
-       * 
- * - * repeated string unordered_ack_ids = 3; - * - * @param values The unorderedAckIds to add. - * @return This builder for chaining. - */ - public Builder addAllUnorderedAckIds(java.lang.Iterable values) { - ensureUnorderedAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unorderedAckIds_); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were out of order.
-       * 
- * - * repeated string unordered_ack_ids = 3; - * - * @return This builder for chaining. - */ - public Builder clearUnorderedAckIds() { - unorderedAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - ; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were out of order.
-       * 
- * - * repeated string unordered_ack_ids = 3; - * - * @param value The bytes of the unorderedAckIds to add. - * @return This builder for chaining. - */ - public Builder addUnorderedAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureUnorderedAckIdsIsMutable(); - unorderedAckIds_.add(value); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringArrayList temporaryFailedAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureTemporaryFailedAckIdsIsMutable() { - if (!temporaryFailedAckIds_.isModifiable()) { - temporaryFailedAckIds_ = - new com.google.protobuf.LazyStringArrayList(temporaryFailedAckIds_); - } - bitField0_ |= 0x00000008; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @return A list containing the temporaryFailedAckIds. - */ - public com.google.protobuf.ProtocolStringList getTemporaryFailedAckIdsList() { - temporaryFailedAckIds_.makeImmutable(); - return temporaryFailedAckIds_; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @return The count of temporaryFailedAckIds. - */ - public int getTemporaryFailedAckIdsCount() { - return temporaryFailedAckIds_.size(); - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @param index The index of the element to return. - * @return The temporaryFailedAckIds at the given index. - */ - public java.lang.String getTemporaryFailedAckIds(int index) { - return temporaryFailedAckIds_.get(index); - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @param index The index of the value to return. - * @return The bytes of the temporaryFailedAckIds at the given index. - */ - public com.google.protobuf.ByteString getTemporaryFailedAckIdsBytes(int index) { - return temporaryFailedAckIds_.getByteString(index); - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @param index The index to set the value at. - * @param value The temporaryFailedAckIds to set. - * @return This builder for chaining. - */ - public Builder setTemporaryFailedAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTemporaryFailedAckIdsIsMutable(); - temporaryFailedAckIds_.set(index, value); - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @param value The temporaryFailedAckIds to add. - * @return This builder for chaining. - */ - public Builder addTemporaryFailedAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTemporaryFailedAckIdsIsMutable(); - temporaryFailedAckIds_.add(value); - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @param values The temporaryFailedAckIds to add. - * @return This builder for chaining. - */ - public Builder addAllTemporaryFailedAckIds(java.lang.Iterable values) { - ensureTemporaryFailedAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, temporaryFailedAckIds_); - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @return This builder for chaining. - */ - public Builder clearTemporaryFailedAckIds() { - temporaryFailedAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - ; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 4; - * - * @param value The bytes of the temporaryFailedAckIds to add. - * @return This builder for chaining. - */ - public Builder addTemporaryFailedAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureTemporaryFailedAckIdsIsMutable(); - temporaryFailedAckIds_.add(value); - bitField0_ |= 0x00000008; - 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.StreamingPullResponse.AcknowledgeConfirmation) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation) - private static final com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation(); - } - - public static com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AcknowledgeConfirmation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.StreamingPullResponse.AcknowledgeConfirmation - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface ModifyAckDeadlineConfirmationOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @return A list containing the ackIds. - */ - java.util.List getAckIdsList(); - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @return The count of ackIds. - */ - int getAckIdsCount(); - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - java.lang.String getAckIds(int index); - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - com.google.protobuf.ByteString getAckIdsBytes(int index); - - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return A list containing the invalidAckIds. - */ - java.util.List getInvalidAckIdsList(); - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return The count of invalidAckIds. - */ - int getInvalidAckIdsCount(); - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the element to return. - * @return The invalidAckIds at the given index. - */ - java.lang.String getInvalidAckIds(int index); - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the value to return. - * @return The bytes of the invalidAckIds at the given index. - */ - com.google.protobuf.ByteString getInvalidAckIdsBytes(int index); - - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @return A list containing the temporaryFailedAckIds. - */ - java.util.List getTemporaryFailedAckIdsList(); - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @return The count of temporaryFailedAckIds. - */ - int getTemporaryFailedAckIdsCount(); - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @param index The index of the element to return. - * @return The temporaryFailedAckIds at the given index. - */ - java.lang.String getTemporaryFailedAckIds(int index); - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @param index The index of the value to return. - * @return The bytes of the temporaryFailedAckIds at the given index. - */ - com.google.protobuf.ByteString getTemporaryFailedAckIdsBytes(int index); - } - /** - * - * - *
-   * Acknowledgement IDs sent in one or more previous requests to modify the
-   * deadline for a specific message.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} - */ - public static final class ModifyAckDeadlineConfirmation - extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation) - ModifyAckDeadlineConfirmationOrBuilder { - private static final long serialVersionUID = 0L; - // Use ModifyAckDeadlineConfirmation.newBuilder() to construct. - private ModifyAckDeadlineConfirmation( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ModifyAckDeadlineConfirmation() { - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - invalidAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - temporaryFailedAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ModifyAckDeadlineConfirmation(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_ModifyAckDeadlineConfirmation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_ModifyAckDeadlineConfirmation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.class, - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.Builder - .class); - } - - public static final int ACK_IDS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList ackIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @return A list containing the ackIds. - */ - public com.google.protobuf.ProtocolStringList getAckIdsList() { - return ackIds_; - } - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @return The count of ackIds. - */ - public int getAckIdsCount() { - return ackIds_.size(); - } - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - public java.lang.String getAckIds(int index) { - return ackIds_.get(index); - } - /** - * - * - *
-     * Successfully processed acknowledgement IDs.
-     * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - public com.google.protobuf.ByteString getAckIdsBytes(int index) { - return ackIds_.getByteString(index); - } - - public static final int INVALID_ACK_IDS_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList invalidAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return A list containing the invalidAckIds. - */ - public com.google.protobuf.ProtocolStringList getInvalidAckIdsList() { - return invalidAckIds_; - } - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return The count of invalidAckIds. - */ - public int getInvalidAckIdsCount() { - return invalidAckIds_.size(); - } - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the element to return. - * @return The invalidAckIds at the given index. - */ - public java.lang.String getInvalidAckIds(int index) { - return invalidAckIds_.get(index); - } - /** - * - * - *
-     * List of acknowledgement IDs that were malformed or whose acknowledgement
-     * deadline has expired.
-     * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the value to return. - * @return The bytes of the invalidAckIds at the given index. - */ - public com.google.protobuf.ByteString getInvalidAckIdsBytes(int index) { - return invalidAckIds_.getByteString(index); - } - - public static final int TEMPORARY_FAILED_ACK_IDS_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList temporaryFailedAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @return A list containing the temporaryFailedAckIds. - */ - public com.google.protobuf.ProtocolStringList getTemporaryFailedAckIdsList() { - return temporaryFailedAckIds_; - } - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @return The count of temporaryFailedAckIds. - */ - public int getTemporaryFailedAckIdsCount() { - return temporaryFailedAckIds_.size(); - } - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @param index The index of the element to return. - * @return The temporaryFailedAckIds at the given index. - */ - public java.lang.String getTemporaryFailedAckIds(int index) { - return temporaryFailedAckIds_.get(index); - } - /** - * - * - *
-     * List of acknowledgement IDs that failed processing with temporary issues.
-     * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @param index The index of the value to return. - * @return The bytes of the temporaryFailedAckIds at the given index. - */ - public com.google.protobuf.ByteString getTemporaryFailedAckIdsBytes(int index) { - return temporaryFailedAckIds_.getByteString(index); - } - - 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 < ackIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ackIds_.getRaw(i)); - } - for (int i = 0; i < invalidAckIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, invalidAckIds_.getRaw(i)); - } - for (int i = 0; i < temporaryFailedAckIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( - output, 3, temporaryFailedAckIds_.getRaw(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < ackIds_.size(); i++) { - dataSize += computeStringSizeNoTag(ackIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getAckIdsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < invalidAckIds_.size(); i++) { - dataSize += computeStringSizeNoTag(invalidAckIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getInvalidAckIdsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < temporaryFailedAckIds_.size(); i++) { - dataSize += computeStringSizeNoTag(temporaryFailedAckIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getTemporaryFailedAckIdsList().size(); - } - size += getUnknownFields().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.StreamingPullResponse.ModifyAckDeadlineConfirmation)) { - return super.equals(obj); - } - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation other = - (com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation) obj; - - if (!getAckIdsList().equals(other.getAckIdsList())) return false; - if (!getInvalidAckIdsList().equals(other.getInvalidAckIdsList())) return false; - if (!getTemporaryFailedAckIdsList().equals(other.getTemporaryFailedAckIdsList())) - return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAckIdsCount() > 0) { - hash = (37 * hash) + ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getAckIdsList().hashCode(); - } - if (getInvalidAckIdsCount() > 0) { - hash = (37 * hash) + INVALID_ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getInvalidAckIdsList().hashCode(); - } - if (getTemporaryFailedAckIdsCount() > 0) { - hash = (37 * hash) + TEMPORARY_FAILED_ACK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getTemporaryFailedAckIdsList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - 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.StreamingPullResponse.ModifyAckDeadlineConfirmation - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - 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.StreamingPullResponse.ModifyAckDeadlineConfirmation - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - 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.StreamingPullResponse.ModifyAckDeadlineConfirmation - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - 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.StreamingPullResponse.ModifyAckDeadlineConfirmation - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - 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.StreamingPullResponse.ModifyAckDeadlineConfirmation 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; - } - /** - * - * - *
-     * Acknowledgement IDs sent in one or more previous requests to modify the
-     * deadline for a specific message.
-     * 
- * - * Protobuf type {@code google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation) - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_ModifyAckDeadlineConfirmation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_ModifyAckDeadlineConfirmation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.class, - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.Builder - .class); - } - - // Construct using - // com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - invalidAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - temporaryFailedAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_ModifyAckDeadlineConfirmation_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - getDefaultInstanceForType() { - return com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation build() { - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - buildPartial() { - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation result = - new com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - ackIds_.makeImmutable(); - result.ackIds_ = ackIds_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - invalidAckIds_.makeImmutable(); - result.invalidAckIds_ = invalidAckIds_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - temporaryFailedAckIds_.makeImmutable(); - result.temporaryFailedAckIds_ = temporaryFailedAckIds_; - } - } - - @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.StreamingPullResponse.ModifyAckDeadlineConfirmation) { - return mergeFrom( - (com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation other) { - if (other - == com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - .getDefaultInstance()) return this; - if (!other.ackIds_.isEmpty()) { - if (ackIds_.isEmpty()) { - ackIds_ = other.ackIds_; - bitField0_ |= 0x00000001; - } else { - ensureAckIdsIsMutable(); - ackIds_.addAll(other.ackIds_); - } - onChanged(); - } - if (!other.invalidAckIds_.isEmpty()) { - if (invalidAckIds_.isEmpty()) { - invalidAckIds_ = other.invalidAckIds_; - bitField0_ |= 0x00000002; - } else { - ensureInvalidAckIdsIsMutable(); - invalidAckIds_.addAll(other.invalidAckIds_); - } - onChanged(); - } - if (!other.temporaryFailedAckIds_.isEmpty()) { - if (temporaryFailedAckIds_.isEmpty()) { - temporaryFailedAckIds_ = other.temporaryFailedAckIds_; - bitField0_ |= 0x00000004; - } else { - ensureTemporaryFailedAckIdsIsMutable(); - temporaryFailedAckIds_.addAll(other.temporaryFailedAckIds_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - 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(); - ensureAckIdsIsMutable(); - ackIds_.add(s); - break; - } // case 10 - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureInvalidAckIdsIsMutable(); - invalidAckIds_.add(s); - break; - } // case 18 - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureTemporaryFailedAckIdsIsMutable(); - temporaryFailedAckIds_.add(s); - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringArrayList ackIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureAckIdsIsMutable() { - if (!ackIds_.isModifiable()) { - ackIds_ = new com.google.protobuf.LazyStringArrayList(ackIds_); - } - bitField0_ |= 0x00000001; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @return A list containing the ackIds. - */ - public com.google.protobuf.ProtocolStringList getAckIdsList() { - ackIds_.makeImmutable(); - return ackIds_; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @return The count of ackIds. - */ - public int getAckIdsCount() { - return ackIds_.size(); - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the element to return. - * @return The ackIds at the given index. - */ - public java.lang.String getAckIds(int index) { - return ackIds_.get(index); - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param index The index of the value to return. - * @return The bytes of the ackIds at the given index. - */ - public com.google.protobuf.ByteString getAckIdsBytes(int index) { - return ackIds_.getByteString(index); - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param index The index to set the value at. - * @param value The ackIds to set. - * @return This builder for chaining. - */ - public Builder setAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAckIdsIsMutable(); - ackIds_.set(index, value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param value The ackIds to add. - * @return This builder for chaining. - */ - public Builder addAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAckIdsIsMutable(); - ackIds_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param values The ackIds to add. - * @return This builder for chaining. - */ - public Builder addAllAckIds(java.lang.Iterable values) { - ensureAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ackIds_); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @return This builder for chaining. - */ - public Builder clearAckIds() { - ackIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - ; - onChanged(); - return this; - } - /** - * - * - *
-       * Successfully processed acknowledgement IDs.
-       * 
- * - * repeated string ack_ids = 1; - * - * @param value The bytes of the ackIds to add. - * @return This builder for chaining. - */ - public Builder addAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAckIdsIsMutable(); - ackIds_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringArrayList invalidAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureInvalidAckIdsIsMutable() { - if (!invalidAckIds_.isModifiable()) { - invalidAckIds_ = new com.google.protobuf.LazyStringArrayList(invalidAckIds_); - } - bitField0_ |= 0x00000002; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return A list containing the invalidAckIds. - */ - public com.google.protobuf.ProtocolStringList getInvalidAckIdsList() { - invalidAckIds_.makeImmutable(); - return invalidAckIds_; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return The count of invalidAckIds. - */ - public int getInvalidAckIdsCount() { - return invalidAckIds_.size(); - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the element to return. - * @return The invalidAckIds at the given index. - */ - public java.lang.String getInvalidAckIds(int index) { - return invalidAckIds_.get(index); - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index of the value to return. - * @return The bytes of the invalidAckIds at the given index. - */ - public com.google.protobuf.ByteString getInvalidAckIdsBytes(int index) { - return invalidAckIds_.getByteString(index); - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param index The index to set the value at. - * @param value The invalidAckIds to set. - * @return This builder for chaining. - */ - public Builder setInvalidAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInvalidAckIdsIsMutable(); - invalidAckIds_.set(index, value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param value The invalidAckIds to add. - * @return This builder for chaining. - */ - public Builder addInvalidAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInvalidAckIdsIsMutable(); - invalidAckIds_.add(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param values The invalidAckIds to add. - * @return This builder for chaining. - */ - public Builder addAllInvalidAckIds(java.lang.Iterable values) { - ensureInvalidAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, invalidAckIds_); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @return This builder for chaining. - */ - public Builder clearInvalidAckIds() { - invalidAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - ; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that were malformed or whose acknowledgement
-       * deadline has expired.
-       * 
- * - * repeated string invalid_ack_ids = 2; - * - * @param value The bytes of the invalidAckIds to add. - * @return This builder for chaining. - */ - public Builder addInvalidAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureInvalidAckIdsIsMutable(); - invalidAckIds_.add(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringArrayList temporaryFailedAckIds_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - - private void ensureTemporaryFailedAckIdsIsMutable() { - if (!temporaryFailedAckIds_.isModifiable()) { - temporaryFailedAckIds_ = - new com.google.protobuf.LazyStringArrayList(temporaryFailedAckIds_); - } - bitField0_ |= 0x00000004; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @return A list containing the temporaryFailedAckIds. - */ - public com.google.protobuf.ProtocolStringList getTemporaryFailedAckIdsList() { - temporaryFailedAckIds_.makeImmutable(); - return temporaryFailedAckIds_; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @return The count of temporaryFailedAckIds. - */ - public int getTemporaryFailedAckIdsCount() { - return temporaryFailedAckIds_.size(); - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @param index The index of the element to return. - * @return The temporaryFailedAckIds at the given index. - */ - public java.lang.String getTemporaryFailedAckIds(int index) { - return temporaryFailedAckIds_.get(index); - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @param index The index of the value to return. - * @return The bytes of the temporaryFailedAckIds at the given index. - */ - public com.google.protobuf.ByteString getTemporaryFailedAckIdsBytes(int index) { - return temporaryFailedAckIds_.getByteString(index); - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @param index The index to set the value at. - * @param value The temporaryFailedAckIds to set. - * @return This builder for chaining. - */ - public Builder setTemporaryFailedAckIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTemporaryFailedAckIdsIsMutable(); - temporaryFailedAckIds_.set(index, value); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @param value The temporaryFailedAckIds to add. - * @return This builder for chaining. - */ - public Builder addTemporaryFailedAckIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTemporaryFailedAckIdsIsMutable(); - temporaryFailedAckIds_.add(value); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @param values The temporaryFailedAckIds to add. - * @return This builder for chaining. - */ - public Builder addAllTemporaryFailedAckIds(java.lang.Iterable values) { - ensureTemporaryFailedAckIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, temporaryFailedAckIds_); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @return This builder for chaining. - */ - public Builder clearTemporaryFailedAckIds() { - temporaryFailedAckIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - ; - onChanged(); - return this; - } - /** - * - * - *
-       * List of acknowledgement IDs that failed processing with temporary issues.
-       * 
- * - * repeated string temporary_failed_ack_ids = 3; - * - * @param value The bytes of the temporaryFailedAckIds to add. - * @return This builder for chaining. - */ - public Builder addTemporaryFailedAckIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureTemporaryFailedAckIdsIsMutable(); - temporaryFailedAckIds_.add(value); - bitField0_ |= 0x00000004; - 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.StreamingPullResponse.ModifyAckDeadlineConfirmation) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation) - private static final com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation(); - } - - public static com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ModifyAckDeadlineConfirmation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.StreamingPullResponse.ModifyAckDeadlineConfirmation - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface SubscriptionPropertiesOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.StreamingPullResponse.SubscriptionProperties) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * True iff exactly once delivery is enabled for this subscription.
-     * 
- * - * bool exactly_once_delivery_enabled = 1; - * - * @return The exactlyOnceDeliveryEnabled. - */ - boolean getExactlyOnceDeliveryEnabled(); - - /** - * - * - *
-     * True iff message ordering is enabled for this subscription.
-     * 
- * - * bool message_ordering_enabled = 2; - * - * @return The messageOrderingEnabled. - */ - boolean getMessageOrderingEnabled(); - } - /** - * - * - *
-   * Subscription properties sent as part of the response.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} - */ - public static final class SubscriptionProperties extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.StreamingPullResponse.SubscriptionProperties) - SubscriptionPropertiesOrBuilder { - private static final long serialVersionUID = 0L; - // Use SubscriptionProperties.newBuilder() to construct. - private SubscriptionProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SubscriptionProperties() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SubscriptionProperties(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_SubscriptionProperties_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_SubscriptionProperties_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.class, - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.Builder.class); - } - - public static final int EXACTLY_ONCE_DELIVERY_ENABLED_FIELD_NUMBER = 1; - private boolean exactlyOnceDeliveryEnabled_ = false; - /** - * - * - *
-     * True iff exactly once delivery is enabled for this subscription.
-     * 
- * - * bool exactly_once_delivery_enabled = 1; - * - * @return The exactlyOnceDeliveryEnabled. - */ - @java.lang.Override - public boolean getExactlyOnceDeliveryEnabled() { - return exactlyOnceDeliveryEnabled_; - } - - public static final int MESSAGE_ORDERING_ENABLED_FIELD_NUMBER = 2; - private boolean messageOrderingEnabled_ = false; - /** - * - * - *
-     * True iff message ordering is enabled for this subscription.
-     * 
- * - * bool message_ordering_enabled = 2; - * - * @return The messageOrderingEnabled. - */ - @java.lang.Override - public boolean getMessageOrderingEnabled() { - return messageOrderingEnabled_; - } - - 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 (exactlyOnceDeliveryEnabled_ != false) { - output.writeBool(1, exactlyOnceDeliveryEnabled_); - } - if (messageOrderingEnabled_ != false) { - output.writeBool(2, messageOrderingEnabled_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (exactlyOnceDeliveryEnabled_ != false) { - size += - com.google.protobuf.CodedOutputStream.computeBoolSize(1, exactlyOnceDeliveryEnabled_); - } - if (messageOrderingEnabled_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, messageOrderingEnabled_); - } - size += getUnknownFields().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.StreamingPullResponse.SubscriptionProperties)) { - return super.equals(obj); - } - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties other = - (com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties) obj; - - if (getExactlyOnceDeliveryEnabled() != other.getExactlyOnceDeliveryEnabled()) return false; - if (getMessageOrderingEnabled() != other.getMessageOrderingEnabled()) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + EXACTLY_ONCE_DELIVERY_ENABLED_FIELD_NUMBER; - hash = - (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExactlyOnceDeliveryEnabled()); - hash = (37 * hash) + MESSAGE_ORDERING_ENABLED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getMessageOrderingEnabled()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties 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.StreamingPullResponse.SubscriptionProperties parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties 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.StreamingPullResponse.SubscriptionProperties parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties 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.StreamingPullResponse.SubscriptionProperties - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - 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.StreamingPullResponse.SubscriptionProperties parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties 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.StreamingPullResponse.SubscriptionProperties 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; - } - /** - * - * - *
-     * Subscription properties sent as part of the response.
-     * 
- * - * Protobuf type {@code google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.StreamingPullResponse.SubscriptionProperties) - com.google.pubsub.v1.StreamingPullResponse.SubscriptionPropertiesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_SubscriptionProperties_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_SubscriptionProperties_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.class, - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.Builder.class); - } - - // Construct using - // com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - exactlyOnceDeliveryEnabled_ = false; - messageOrderingEnabled_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_SubscriptionProperties_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - getDefaultInstanceForType() { - return com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties build() { - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties buildPartial() { - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties result = - new com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.exactlyOnceDeliveryEnabled_ = exactlyOnceDeliveryEnabled_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.messageOrderingEnabled_ = messageOrderingEnabled_; - } - } - - @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.StreamingPullResponse.SubscriptionProperties) { - return mergeFrom( - (com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties other) { - if (other - == com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - .getDefaultInstance()) return this; - if (other.getExactlyOnceDeliveryEnabled() != false) { - setExactlyOnceDeliveryEnabled(other.getExactlyOnceDeliveryEnabled()); - } - if (other.getMessageOrderingEnabled() != false) { - setMessageOrderingEnabled(other.getMessageOrderingEnabled()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - exactlyOnceDeliveryEnabled_ = input.readBool(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: - { - messageOrderingEnabled_ = input.readBool(); - bitField0_ |= 0x00000002; - break; - } // case 16 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private boolean exactlyOnceDeliveryEnabled_; - /** - * - * - *
-       * True iff exactly once delivery is enabled for this subscription.
-       * 
- * - * bool exactly_once_delivery_enabled = 1; - * - * @return The exactlyOnceDeliveryEnabled. - */ - @java.lang.Override - public boolean getExactlyOnceDeliveryEnabled() { - return exactlyOnceDeliveryEnabled_; - } - /** - * - * - *
-       * True iff exactly once delivery is enabled for this subscription.
-       * 
- * - * bool exactly_once_delivery_enabled = 1; - * - * @param value The exactlyOnceDeliveryEnabled to set. - * @return This builder for chaining. - */ - public Builder setExactlyOnceDeliveryEnabled(boolean value) { - - exactlyOnceDeliveryEnabled_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * True iff exactly once delivery is enabled for this subscription.
-       * 
- * - * bool exactly_once_delivery_enabled = 1; - * - * @return This builder for chaining. - */ - public Builder clearExactlyOnceDeliveryEnabled() { - bitField0_ = (bitField0_ & ~0x00000001); - exactlyOnceDeliveryEnabled_ = false; - onChanged(); - return this; - } - - private boolean messageOrderingEnabled_; - /** - * - * - *
-       * True iff message ordering is enabled for this subscription.
-       * 
- * - * bool message_ordering_enabled = 2; - * - * @return The messageOrderingEnabled. - */ - @java.lang.Override - public boolean getMessageOrderingEnabled() { - return messageOrderingEnabled_; - } - /** - * - * - *
-       * True iff message ordering is enabled for this subscription.
-       * 
- * - * bool message_ordering_enabled = 2; - * - * @param value The messageOrderingEnabled to set. - * @return This builder for chaining. - */ - public Builder setMessageOrderingEnabled(boolean value) { - - messageOrderingEnabled_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-       * True iff message ordering is enabled for this subscription.
-       * 
- * - * bool message_ordering_enabled = 2; - * - * @return This builder for chaining. - */ - public Builder clearMessageOrderingEnabled() { - bitField0_ = (bitField0_ & ~0x00000002); - messageOrderingEnabled_ = false; - 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.StreamingPullResponse.SubscriptionProperties) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.StreamingPullResponse.SubscriptionProperties) - private static final com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties(); - } - - public static com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SubscriptionProperties parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.StreamingPullResponse.SubscriptionProperties - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public static final int RECEIVED_MESSAGES_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private java.util.List receivedMessages_; - /** - * - * - *
-   * Received Pub/Sub messages. This will not be empty.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - @java.lang.Override - public java.util.List getReceivedMessagesList() { - return receivedMessages_; - } - /** - * - * - *
-   * Received Pub/Sub messages. This will not be empty.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - @java.lang.Override - public java.util.List - getReceivedMessagesOrBuilderList() { - return receivedMessages_; - } - /** - * - * - *
-   * Received Pub/Sub messages. This will not be empty.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - @java.lang.Override - public int getReceivedMessagesCount() { - return receivedMessages_.size(); - } - /** - * - * - *
-   * Received Pub/Sub messages. This will not be empty.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.ReceivedMessage getReceivedMessages(int index) { - return receivedMessages_.get(index); - } - /** - * - * - *
-   * Received Pub/Sub messages. This will not be empty.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - @java.lang.Override - public com.google.pubsub.v1.ReceivedMessageOrBuilder getReceivedMessagesOrBuilder(int index) { - return receivedMessages_.get(index); - } - - public static final int ACKNOWLEDGE_CONFIRMATION_FIELD_NUMBER = 5; - private com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - acknowledgeConfirmation_; - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - * - * @return Whether the acknowledgeConfirmation field is set. - */ - @java.lang.Override - public boolean hasAcknowledgeConfirmation() { - return acknowledgeConfirmation_ != null; - } - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - * - * @return The acknowledgeConfirmation. - */ - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - getAcknowledgeConfirmation() { - return acknowledgeConfirmation_ == null - ? com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.getDefaultInstance() - : acknowledgeConfirmation_; - } - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - */ - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmationOrBuilder - getAcknowledgeConfirmationOrBuilder() { - return acknowledgeConfirmation_ == null - ? com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.getDefaultInstance() - : acknowledgeConfirmation_; - } - - public static final int MODIFY_ACK_DEADLINE_CONFIRMATION_FIELD_NUMBER = 3; - private com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - modifyAckDeadlineConfirmation_; - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - * - * @return Whether the modifyAckDeadlineConfirmation field is set. - */ - @java.lang.Override - public boolean hasModifyAckDeadlineConfirmation() { - return modifyAckDeadlineConfirmation_ != null; - } - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - * - * @return The modifyAckDeadlineConfirmation. - */ - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - getModifyAckDeadlineConfirmation() { - return modifyAckDeadlineConfirmation_ == null - ? com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - .getDefaultInstance() - : modifyAckDeadlineConfirmation_; - } - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - */ - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmationOrBuilder - getModifyAckDeadlineConfirmationOrBuilder() { - return modifyAckDeadlineConfirmation_ == null - ? com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - .getDefaultInstance() - : modifyAckDeadlineConfirmation_; - } - - public static final int SUBSCRIPTION_PROPERTIES_FIELD_NUMBER = 4; - private com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscriptionProperties_; - /** - * - * - *
-   * Properties associated with this subscription.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - * - * @return Whether the subscriptionProperties field is set. - */ - @java.lang.Override - public boolean hasSubscriptionProperties() { - return subscriptionProperties_ != null; - } - /** - * - * - *
-   * Properties associated with this subscription.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - * - * @return The subscriptionProperties. - */ - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - getSubscriptionProperties() { - return subscriptionProperties_ == null - ? com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.getDefaultInstance() - : subscriptionProperties_; - } - /** - * - * - *
-   * Properties associated with this subscription.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - */ - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse.SubscriptionPropertiesOrBuilder - getSubscriptionPropertiesOrBuilder() { - return subscriptionProperties_ == null - ? com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.getDefaultInstance() - : subscriptionProperties_; - } - - 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 < receivedMessages_.size(); i++) { - output.writeMessage(1, receivedMessages_.get(i)); - } - if (modifyAckDeadlineConfirmation_ != null) { - output.writeMessage(3, getModifyAckDeadlineConfirmation()); - } - if (subscriptionProperties_ != null) { - output.writeMessage(4, getSubscriptionProperties()); - } - if (acknowledgeConfirmation_ != null) { - output.writeMessage(5, getAcknowledgeConfirmation()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < receivedMessages_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, receivedMessages_.get(i)); - } - if (modifyAckDeadlineConfirmation_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 3, getModifyAckDeadlineConfirmation()); - } - if (subscriptionProperties_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSubscriptionProperties()); - } - if (acknowledgeConfirmation_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(5, getAcknowledgeConfirmation()); - } - size += getUnknownFields().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.StreamingPullResponse)) { - return super.equals(obj); - } - com.google.pubsub.v1.StreamingPullResponse other = - (com.google.pubsub.v1.StreamingPullResponse) obj; - - if (!getReceivedMessagesList().equals(other.getReceivedMessagesList())) return false; - if (hasAcknowledgeConfirmation() != other.hasAcknowledgeConfirmation()) return false; - if (hasAcknowledgeConfirmation()) { - if (!getAcknowledgeConfirmation().equals(other.getAcknowledgeConfirmation())) return false; - } - if (hasModifyAckDeadlineConfirmation() != other.hasModifyAckDeadlineConfirmation()) - return false; - if (hasModifyAckDeadlineConfirmation()) { - if (!getModifyAckDeadlineConfirmation().equals(other.getModifyAckDeadlineConfirmation())) - return false; - } - if (hasSubscriptionProperties() != other.hasSubscriptionProperties()) return false; - if (hasSubscriptionProperties()) { - if (!getSubscriptionProperties().equals(other.getSubscriptionProperties())) return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getReceivedMessagesCount() > 0) { - hash = (37 * hash) + RECEIVED_MESSAGES_FIELD_NUMBER; - hash = (53 * hash) + getReceivedMessagesList().hashCode(); - } - if (hasAcknowledgeConfirmation()) { - hash = (37 * hash) + ACKNOWLEDGE_CONFIRMATION_FIELD_NUMBER; - hash = (53 * hash) + getAcknowledgeConfirmation().hashCode(); - } - if (hasModifyAckDeadlineConfirmation()) { - hash = (37 * hash) + MODIFY_ACK_DEADLINE_CONFIRMATION_FIELD_NUMBER; - hash = (53 * hash) + getModifyAckDeadlineConfirmation().hashCode(); - } - if (hasSubscriptionProperties()) { - hash = (37 * hash) + SUBSCRIPTION_PROPERTIES_FIELD_NUMBER; - hash = (53 * hash) + getSubscriptionProperties().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.StreamingPullResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse 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.StreamingPullResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse 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.StreamingPullResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.StreamingPullResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.StreamingPullResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse 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.StreamingPullResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse 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.StreamingPullResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.StreamingPullResponse 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.StreamingPullResponse 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 `StreamingPull` method. This response is used to stream
-   * messages from the server to the client.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.StreamingPullResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.StreamingPullResponse) - com.google.pubsub.v1.StreamingPullResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.StreamingPullResponse.class, - com.google.pubsub.v1.StreamingPullResponse.Builder.class); - } - - // Construct using com.google.pubsub.v1.StreamingPullResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (receivedMessagesBuilder_ == null) { - receivedMessages_ = java.util.Collections.emptyList(); - } else { - receivedMessages_ = null; - receivedMessagesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - acknowledgeConfirmation_ = null; - if (acknowledgeConfirmationBuilder_ != null) { - acknowledgeConfirmationBuilder_.dispose(); - acknowledgeConfirmationBuilder_ = null; - } - modifyAckDeadlineConfirmation_ = null; - if (modifyAckDeadlineConfirmationBuilder_ != null) { - modifyAckDeadlineConfirmationBuilder_.dispose(); - modifyAckDeadlineConfirmationBuilder_ = null; - } - subscriptionProperties_ = null; - if (subscriptionPropertiesBuilder_ != null) { - subscriptionPropertiesBuilder_.dispose(); - subscriptionPropertiesBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_StreamingPullResponse_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse getDefaultInstanceForType() { - return com.google.pubsub.v1.StreamingPullResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse build() { - com.google.pubsub.v1.StreamingPullResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.StreamingPullResponse buildPartial() { - com.google.pubsub.v1.StreamingPullResponse result = - new com.google.pubsub.v1.StreamingPullResponse(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(com.google.pubsub.v1.StreamingPullResponse result) { - if (receivedMessagesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - receivedMessages_ = java.util.Collections.unmodifiableList(receivedMessages_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.receivedMessages_ = receivedMessages_; - } else { - result.receivedMessages_ = receivedMessagesBuilder_.build(); - } - } - - private void buildPartial0(com.google.pubsub.v1.StreamingPullResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.acknowledgeConfirmation_ = - acknowledgeConfirmationBuilder_ == null - ? acknowledgeConfirmation_ - : acknowledgeConfirmationBuilder_.build(); - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.modifyAckDeadlineConfirmation_ = - modifyAckDeadlineConfirmationBuilder_ == null - ? modifyAckDeadlineConfirmation_ - : modifyAckDeadlineConfirmationBuilder_.build(); - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.subscriptionProperties_ = - subscriptionPropertiesBuilder_ == null - ? subscriptionProperties_ - : subscriptionPropertiesBuilder_.build(); - } - } - - @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.StreamingPullResponse) { - return mergeFrom((com.google.pubsub.v1.StreamingPullResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.StreamingPullResponse other) { - if (other == com.google.pubsub.v1.StreamingPullResponse.getDefaultInstance()) return this; - if (receivedMessagesBuilder_ == null) { - if (!other.receivedMessages_.isEmpty()) { - if (receivedMessages_.isEmpty()) { - receivedMessages_ = other.receivedMessages_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureReceivedMessagesIsMutable(); - receivedMessages_.addAll(other.receivedMessages_); - } - onChanged(); - } - } else { - if (!other.receivedMessages_.isEmpty()) { - if (receivedMessagesBuilder_.isEmpty()) { - receivedMessagesBuilder_.dispose(); - receivedMessagesBuilder_ = null; - receivedMessages_ = other.receivedMessages_; - bitField0_ = (bitField0_ & ~0x00000001); - receivedMessagesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getReceivedMessagesFieldBuilder() - : null; - } else { - receivedMessagesBuilder_.addAllMessages(other.receivedMessages_); - } - } - } - if (other.hasAcknowledgeConfirmation()) { - mergeAcknowledgeConfirmation(other.getAcknowledgeConfirmation()); - } - if (other.hasModifyAckDeadlineConfirmation()) { - mergeModifyAckDeadlineConfirmation(other.getModifyAckDeadlineConfirmation()); - } - if (other.hasSubscriptionProperties()) { - mergeSubscriptionProperties(other.getSubscriptionProperties()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.pubsub.v1.ReceivedMessage m = - input.readMessage( - com.google.pubsub.v1.ReceivedMessage.parser(), extensionRegistry); - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - receivedMessages_.add(m); - } else { - receivedMessagesBuilder_.addMessage(m); - } - break; - } // case 10 - case 26: - { - input.readMessage( - getModifyAckDeadlineConfirmationFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 34: - { - input.readMessage( - getSubscriptionPropertiesFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000008; - break; - } // case 34 - case 42: - { - input.readMessage( - getAcknowledgeConfirmationFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 42 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List receivedMessages_ = - java.util.Collections.emptyList(); - - private void ensureReceivedMessagesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - receivedMessages_ = - new java.util.ArrayList(receivedMessages_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.ReceivedMessage, - com.google.pubsub.v1.ReceivedMessage.Builder, - com.google.pubsub.v1.ReceivedMessageOrBuilder> - receivedMessagesBuilder_; - - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public java.util.List getReceivedMessagesList() { - if (receivedMessagesBuilder_ == null) { - return java.util.Collections.unmodifiableList(receivedMessages_); - } else { - return receivedMessagesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public int getReceivedMessagesCount() { - if (receivedMessagesBuilder_ == null) { - return receivedMessages_.size(); - } else { - return receivedMessagesBuilder_.getCount(); - } - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public com.google.pubsub.v1.ReceivedMessage getReceivedMessages(int index) { - if (receivedMessagesBuilder_ == null) { - return receivedMessages_.get(index); - } else { - return receivedMessagesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder setReceivedMessages(int index, com.google.pubsub.v1.ReceivedMessage value) { - if (receivedMessagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReceivedMessagesIsMutable(); - receivedMessages_.set(index, value); - onChanged(); - } else { - receivedMessagesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder setReceivedMessages( - int index, com.google.pubsub.v1.ReceivedMessage.Builder builderForValue) { - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - receivedMessages_.set(index, builderForValue.build()); - onChanged(); - } else { - receivedMessagesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder addReceivedMessages(com.google.pubsub.v1.ReceivedMessage value) { - if (receivedMessagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReceivedMessagesIsMutable(); - receivedMessages_.add(value); - onChanged(); - } else { - receivedMessagesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder addReceivedMessages(int index, com.google.pubsub.v1.ReceivedMessage value) { - if (receivedMessagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReceivedMessagesIsMutable(); - receivedMessages_.add(index, value); - onChanged(); - } else { - receivedMessagesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder addReceivedMessages( - com.google.pubsub.v1.ReceivedMessage.Builder builderForValue) { - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - receivedMessages_.add(builderForValue.build()); - onChanged(); - } else { - receivedMessagesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder addReceivedMessages( - int index, com.google.pubsub.v1.ReceivedMessage.Builder builderForValue) { - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - receivedMessages_.add(index, builderForValue.build()); - onChanged(); - } else { - receivedMessagesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder addAllReceivedMessages( - java.lang.Iterable values) { - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, receivedMessages_); - onChanged(); - } else { - receivedMessagesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder clearReceivedMessages() { - if (receivedMessagesBuilder_ == null) { - receivedMessages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - receivedMessagesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public Builder removeReceivedMessages(int index) { - if (receivedMessagesBuilder_ == null) { - ensureReceivedMessagesIsMutable(); - receivedMessages_.remove(index); - onChanged(); - } else { - receivedMessagesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public com.google.pubsub.v1.ReceivedMessage.Builder getReceivedMessagesBuilder(int index) { - return getReceivedMessagesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public com.google.pubsub.v1.ReceivedMessageOrBuilder getReceivedMessagesOrBuilder(int index) { - if (receivedMessagesBuilder_ == null) { - return receivedMessages_.get(index); - } else { - return receivedMessagesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public java.util.List - getReceivedMessagesOrBuilderList() { - if (receivedMessagesBuilder_ != null) { - return receivedMessagesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(receivedMessages_); - } - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public com.google.pubsub.v1.ReceivedMessage.Builder addReceivedMessagesBuilder() { - return getReceivedMessagesFieldBuilder() - .addBuilder(com.google.pubsub.v1.ReceivedMessage.getDefaultInstance()); - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public com.google.pubsub.v1.ReceivedMessage.Builder addReceivedMessagesBuilder(int index) { - return getReceivedMessagesFieldBuilder() - .addBuilder(index, com.google.pubsub.v1.ReceivedMessage.getDefaultInstance()); - } - /** - * - * - *
-     * Received Pub/Sub messages. This will not be empty.
-     * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - public java.util.List - getReceivedMessagesBuilderList() { - return getReceivedMessagesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.ReceivedMessage, - com.google.pubsub.v1.ReceivedMessage.Builder, - com.google.pubsub.v1.ReceivedMessageOrBuilder> - getReceivedMessagesFieldBuilder() { - if (receivedMessagesBuilder_ == null) { - receivedMessagesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.pubsub.v1.ReceivedMessage, - com.google.pubsub.v1.ReceivedMessage.Builder, - com.google.pubsub.v1.ReceivedMessageOrBuilder>( - receivedMessages_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - receivedMessages_ = null; - } - return receivedMessagesBuilder_; - } - - private com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - acknowledgeConfirmation_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation, - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.Builder, - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmationOrBuilder> - acknowledgeConfirmationBuilder_; - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - * - * @return Whether the acknowledgeConfirmation field is set. - */ - public boolean hasAcknowledgeConfirmation() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - * - * @return The acknowledgeConfirmation. - */ - public com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - getAcknowledgeConfirmation() { - if (acknowledgeConfirmationBuilder_ == null) { - return acknowledgeConfirmation_ == null - ? com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - .getDefaultInstance() - : acknowledgeConfirmation_; - } else { - return acknowledgeConfirmationBuilder_.getMessage(); - } - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - */ - public Builder setAcknowledgeConfirmation( - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation value) { - if (acknowledgeConfirmationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - acknowledgeConfirmation_ = value; - } else { - acknowledgeConfirmationBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - */ - public Builder setAcknowledgeConfirmation( - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.Builder - builderForValue) { - if (acknowledgeConfirmationBuilder_ == null) { - acknowledgeConfirmation_ = builderForValue.build(); - } else { - acknowledgeConfirmationBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - */ - public Builder mergeAcknowledgeConfirmation( - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation value) { - if (acknowledgeConfirmationBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) - && acknowledgeConfirmation_ != null - && acknowledgeConfirmation_ - != com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - .getDefaultInstance()) { - getAcknowledgeConfirmationBuilder().mergeFrom(value); - } else { - acknowledgeConfirmation_ = value; - } - } else { - acknowledgeConfirmationBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - */ - public Builder clearAcknowledgeConfirmation() { - bitField0_ = (bitField0_ & ~0x00000002); - acknowledgeConfirmation_ = null; - if (acknowledgeConfirmationBuilder_ != null) { - acknowledgeConfirmationBuilder_.dispose(); - acknowledgeConfirmationBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - */ - public com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.Builder - getAcknowledgeConfirmationBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getAcknowledgeConfirmationFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - */ - public com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmationOrBuilder - getAcknowledgeConfirmationOrBuilder() { - if (acknowledgeConfirmationBuilder_ != null) { - return acknowledgeConfirmationBuilder_.getMessageOrBuilder(); - } else { - return acknowledgeConfirmation_ == null - ? com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation - .getDefaultInstance() - : acknowledgeConfirmation_; - } - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation, - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.Builder, - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmationOrBuilder> - getAcknowledgeConfirmationFieldBuilder() { - if (acknowledgeConfirmationBuilder_ == null) { - acknowledgeConfirmationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation, - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.Builder, - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmationOrBuilder>( - getAcknowledgeConfirmation(), getParentForChildren(), isClean()); - acknowledgeConfirmation_ = null; - } - return acknowledgeConfirmationBuilder_; - } - - private com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - modifyAckDeadlineConfirmation_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation, - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.Builder, - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmationOrBuilder> - modifyAckDeadlineConfirmationBuilder_; - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - * - * @return Whether the modifyAckDeadlineConfirmation field is set. - */ - public boolean hasModifyAckDeadlineConfirmation() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - * - * @return The modifyAckDeadlineConfirmation. - */ - public com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - getModifyAckDeadlineConfirmation() { - if (modifyAckDeadlineConfirmationBuilder_ == null) { - return modifyAckDeadlineConfirmation_ == null - ? com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - .getDefaultInstance() - : modifyAckDeadlineConfirmation_; - } else { - return modifyAckDeadlineConfirmationBuilder_.getMessage(); - } - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - */ - public Builder setModifyAckDeadlineConfirmation( - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation value) { - if (modifyAckDeadlineConfirmationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - modifyAckDeadlineConfirmation_ = value; - } else { - modifyAckDeadlineConfirmationBuilder_.setMessage(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - */ - public Builder setModifyAckDeadlineConfirmation( - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.Builder - builderForValue) { - if (modifyAckDeadlineConfirmationBuilder_ == null) { - modifyAckDeadlineConfirmation_ = builderForValue.build(); - } else { - modifyAckDeadlineConfirmationBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - */ - public Builder mergeModifyAckDeadlineConfirmation( - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation value) { - if (modifyAckDeadlineConfirmationBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0) - && modifyAckDeadlineConfirmation_ != null - && modifyAckDeadlineConfirmation_ - != com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - .getDefaultInstance()) { - getModifyAckDeadlineConfirmationBuilder().mergeFrom(value); - } else { - modifyAckDeadlineConfirmation_ = value; - } - } else { - modifyAckDeadlineConfirmationBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - */ - public Builder clearModifyAckDeadlineConfirmation() { - bitField0_ = (bitField0_ & ~0x00000004); - modifyAckDeadlineConfirmation_ = null; - if (modifyAckDeadlineConfirmationBuilder_ != null) { - modifyAckDeadlineConfirmationBuilder_.dispose(); - modifyAckDeadlineConfirmationBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - */ - public com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.Builder - getModifyAckDeadlineConfirmationBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return getModifyAckDeadlineConfirmationFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - */ - public com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmationOrBuilder - getModifyAckDeadlineConfirmationOrBuilder() { - if (modifyAckDeadlineConfirmationBuilder_ != null) { - return modifyAckDeadlineConfirmationBuilder_.getMessageOrBuilder(); - } else { - return modifyAckDeadlineConfirmation_ == null - ? com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - .getDefaultInstance() - : modifyAckDeadlineConfirmation_; - } - } - /** - * - * - *
-     * This field will only be set if `enable_exactly_once_delivery` is set to
-     * `true`.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation, - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.Builder, - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmationOrBuilder> - getModifyAckDeadlineConfirmationFieldBuilder() { - if (modifyAckDeadlineConfirmationBuilder_ == null) { - modifyAckDeadlineConfirmationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation, - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.Builder, - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmationOrBuilder>( - getModifyAckDeadlineConfirmation(), getParentForChildren(), isClean()); - modifyAckDeadlineConfirmation_ = null; - } - return modifyAckDeadlineConfirmationBuilder_; - } - - private com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - subscriptionProperties_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties, - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.Builder, - com.google.pubsub.v1.StreamingPullResponse.SubscriptionPropertiesOrBuilder> - subscriptionPropertiesBuilder_; - /** - * - * - *
-     * Properties associated with this subscription.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - * - * @return Whether the subscriptionProperties field is set. - */ - public boolean hasSubscriptionProperties() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-     * Properties associated with this subscription.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - * - * @return The subscriptionProperties. - */ - public com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - getSubscriptionProperties() { - if (subscriptionPropertiesBuilder_ == null) { - return subscriptionProperties_ == null - ? com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.getDefaultInstance() - : subscriptionProperties_; - } else { - return subscriptionPropertiesBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Properties associated with this subscription.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - */ - public Builder setSubscriptionProperties( - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties value) { - if (subscriptionPropertiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - subscriptionProperties_ = value; - } else { - subscriptionPropertiesBuilder_.setMessage(value); - } - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * Properties associated with this subscription.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - */ - public Builder setSubscriptionProperties( - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.Builder builderForValue) { - if (subscriptionPropertiesBuilder_ == null) { - subscriptionProperties_ = builderForValue.build(); - } else { - subscriptionPropertiesBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * Properties associated with this subscription.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - */ - public Builder mergeSubscriptionProperties( - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties value) { - if (subscriptionPropertiesBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0) - && subscriptionProperties_ != null - && subscriptionProperties_ - != com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties - .getDefaultInstance()) { - getSubscriptionPropertiesBuilder().mergeFrom(value); - } else { - subscriptionProperties_ = value; - } - } else { - subscriptionPropertiesBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * Properties associated with this subscription.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - */ - public Builder clearSubscriptionProperties() { - bitField0_ = (bitField0_ & ~0x00000008); - subscriptionProperties_ = null; - if (subscriptionPropertiesBuilder_ != null) { - subscriptionPropertiesBuilder_.dispose(); - subscriptionPropertiesBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Properties associated with this subscription.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - */ - public com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.Builder - getSubscriptionPropertiesBuilder() { - bitField0_ |= 0x00000008; - onChanged(); - return getSubscriptionPropertiesFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Properties associated with this subscription.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - */ - public com.google.pubsub.v1.StreamingPullResponse.SubscriptionPropertiesOrBuilder - getSubscriptionPropertiesOrBuilder() { - if (subscriptionPropertiesBuilder_ != null) { - return subscriptionPropertiesBuilder_.getMessageOrBuilder(); - } else { - return subscriptionProperties_ == null - ? com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.getDefaultInstance() - : subscriptionProperties_; - } - } - /** - * - * - *
-     * Properties associated with this subscription.
-     * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties, - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.Builder, - com.google.pubsub.v1.StreamingPullResponse.SubscriptionPropertiesOrBuilder> - getSubscriptionPropertiesFieldBuilder() { - if (subscriptionPropertiesBuilder_ == null) { - subscriptionPropertiesBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties, - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.Builder, - com.google.pubsub.v1.StreamingPullResponse.SubscriptionPropertiesOrBuilder>( - getSubscriptionProperties(), getParentForChildren(), isClean()); - subscriptionProperties_ = null; - } - return subscriptionPropertiesBuilder_; - } - - @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.StreamingPullResponse) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.StreamingPullResponse) - private static final com.google.pubsub.v1.StreamingPullResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.StreamingPullResponse(); - } - - public static com.google.pubsub.v1.StreamingPullResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingPullResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.StreamingPullResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullResponseOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullResponseOrBuilder.java deleted file mode 100644 index e9d7b80f8..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullResponseOrBuilder.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2023 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 StreamingPullResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.StreamingPullResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Received Pub/Sub messages. This will not be empty.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - java.util.List getReceivedMessagesList(); - /** - * - * - *
-   * Received Pub/Sub messages. This will not be empty.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - com.google.pubsub.v1.ReceivedMessage getReceivedMessages(int index); - /** - * - * - *
-   * Received Pub/Sub messages. This will not be empty.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - int getReceivedMessagesCount(); - /** - * - * - *
-   * Received Pub/Sub messages. This will not be empty.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - java.util.List - getReceivedMessagesOrBuilderList(); - /** - * - * - *
-   * Received Pub/Sub messages. This will not be empty.
-   * 
- * - * repeated .google.pubsub.v1.ReceivedMessage received_messages = 1; - */ - com.google.pubsub.v1.ReceivedMessageOrBuilder getReceivedMessagesOrBuilder(int index); - - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - * - * @return Whether the acknowledgeConfirmation field is set. - */ - boolean hasAcknowledgeConfirmation(); - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - * - * @return The acknowledgeConfirmation. - */ - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation getAcknowledgeConfirmation(); - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation acknowledge_confirmation = 5; - * - */ - com.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmationOrBuilder - getAcknowledgeConfirmationOrBuilder(); - - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - * - * @return Whether the modifyAckDeadlineConfirmation field is set. - */ - boolean hasModifyAckDeadlineConfirmation(); - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - * - * @return The modifyAckDeadlineConfirmation. - */ - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation - getModifyAckDeadlineConfirmation(); - /** - * - * - *
-   * This field will only be set if `enable_exactly_once_delivery` is set to
-   * `true`.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - * - */ - com.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmationOrBuilder - getModifyAckDeadlineConfirmationOrBuilder(); - - /** - * - * - *
-   * Properties associated with this subscription.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - * - * @return Whether the subscriptionProperties field is set. - */ - boolean hasSubscriptionProperties(); - /** - * - * - *
-   * Properties associated with this subscription.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - * - * @return The subscriptionProperties. - */ - com.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties getSubscriptionProperties(); - /** - * - * - *
-   * Properties associated with this subscription.
-   * 
- * - * - * .google.pubsub.v1.StreamingPullResponse.SubscriptionProperties subscription_properties = 4; - * - */ - com.google.pubsub.v1.StreamingPullResponse.SubscriptionPropertiesOrBuilder - getSubscriptionPropertiesOrBuilder(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Subscription.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Subscription.java deleted file mode 100644 index 6e21f6ef2..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Subscription.java +++ /dev/null @@ -1,4928 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * A subscription resource. If none of `push_config`, `bigquery_config`, or
- * `cloud_storage_config` is set, then the subscriber will pull and ack messages
- * using API methods. At most one of these fields may be set.
- * 
- * - * Protobuf type {@code google.pubsub.v1.Subscription} - */ -public final class Subscription extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.Subscription) - SubscriptionOrBuilder { - private static final long serialVersionUID = 0L; - // Use Subscription.newBuilder() to construct. - private Subscription(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Subscription() { - name_ = ""; - topic_ = ""; - filter_ = ""; - state_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Subscription(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Subscription_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 9: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Subscription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.Subscription.class, - com.google.pubsub.v1.Subscription.Builder.class); - } - - /** - * - * - *
-   * Possible states for a subscription.
-   * 
- * - * Protobuf enum {@code google.pubsub.v1.Subscription.State} - */ - public enum State implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-     * Default value. This value is unused.
-     * 
- * - * STATE_UNSPECIFIED = 0; - */ - STATE_UNSPECIFIED(0), - /** - * - * - *
-     * The subscription can actively receive messages
-     * 
- * - * ACTIVE = 1; - */ - ACTIVE(1), - /** - * - * - *
-     * The subscription cannot receive messages because of an error with the
-     * resource to which it pushes messages. See the more detailed error state
-     * in the corresponding configuration.
-     * 
- * - * RESOURCE_ERROR = 2; - */ - RESOURCE_ERROR(2), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-     * Default value. This value is unused.
-     * 
- * - * STATE_UNSPECIFIED = 0; - */ - public static final int STATE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-     * The subscription can actively receive messages
-     * 
- * - * ACTIVE = 1; - */ - public static final int ACTIVE_VALUE = 1; - /** - * - * - *
-     * The subscription cannot receive messages because of an error with the
-     * resource to which it pushes messages. See the more detailed error state
-     * in the corresponding configuration.
-     * 
- * - * RESOURCE_ERROR = 2; - */ - public static final int RESOURCE_ERROR_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 State 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 State forNumber(int value) { - switch (value) { - case 0: - return STATE_UNSPECIFIED; - case 1: - return ACTIVE; - case 2: - return RESOURCE_ERROR; - 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 State findValueByNumber(int number) { - return State.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.Subscription.getDescriptor().getEnumTypes().get(0); - } - - private static final State[] VALUES = values(); - - public static State 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 State(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.pubsub.v1.Subscription.State) - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * Required. The name of the subscription. It must have the format
-   * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
-   * start with a letter, and contain only letters (`[A-Za-z]`), numbers
-   * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
-   * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
-   * in length, and it must not start with `"goog"`.
-   * 
- * - * 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. The name of the subscription. It must have the format
-   * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
-   * start with a letter, and contain only letters (`[A-Za-z]`), numbers
-   * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
-   * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
-   * in length, and it must not start with `"goog"`.
-   * 
- * - * 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 TOPIC_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object topic_ = ""; - /** - * - * - *
-   * Required. The name of the topic from which this subscription is receiving
-   * messages. Format is `projects/{project}/topics/{topic}`. The value of this
-   * field will be `_deleted-topic_` if the topic has been deleted.
-   * 
- * - * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - @java.lang.Override - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - 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(); - topic_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The name of the topic from which this subscription is receiving
-   * messages. Format is `projects/{project}/topics/{topic}`. The value of this
-   * field will be `_deleted-topic_` if the topic has been deleted.
-   * 
- * - * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PUSH_CONFIG_FIELD_NUMBER = 4; - private com.google.pubsub.v1.PushConfig pushConfig_; - /** - * - * - *
-   * If push delivery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - * - * @return Whether the pushConfig field is set. - */ - @java.lang.Override - public boolean hasPushConfig() { - return pushConfig_ != null; - } - /** - * - * - *
-   * If push delivery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - * - * @return The pushConfig. - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfig getPushConfig() { - return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; - } - /** - * - * - *
-   * If push delivery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - */ - @java.lang.Override - public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() { - return pushConfig_ == null ? com.google.pubsub.v1.PushConfig.getDefaultInstance() : pushConfig_; - } - - public static final int BIGQUERY_CONFIG_FIELD_NUMBER = 18; - private com.google.pubsub.v1.BigQueryConfig bigqueryConfig_; - /** - * - * - *
-   * If delivery to BigQuery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - * - * @return Whether the bigqueryConfig field is set. - */ - @java.lang.Override - public boolean hasBigqueryConfig() { - return bigqueryConfig_ != null; - } - /** - * - * - *
-   * If delivery to BigQuery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - * - * @return The bigqueryConfig. - */ - @java.lang.Override - public com.google.pubsub.v1.BigQueryConfig getBigqueryConfig() { - return bigqueryConfig_ == null - ? com.google.pubsub.v1.BigQueryConfig.getDefaultInstance() - : bigqueryConfig_; - } - /** - * - * - *
-   * If delivery to BigQuery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - */ - @java.lang.Override - public com.google.pubsub.v1.BigQueryConfigOrBuilder getBigqueryConfigOrBuilder() { - return bigqueryConfig_ == null - ? com.google.pubsub.v1.BigQueryConfig.getDefaultInstance() - : bigqueryConfig_; - } - - public static final int CLOUD_STORAGE_CONFIG_FIELD_NUMBER = 22; - private com.google.pubsub.v1.CloudStorageConfig cloudStorageConfig_; - /** - * - * - *
-   * If delivery to Google Cloud Storage is used with this subscription, this
-   * field is used to configure it.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - * - * @return Whether the cloudStorageConfig field is set. - */ - @java.lang.Override - public boolean hasCloudStorageConfig() { - return cloudStorageConfig_ != null; - } - /** - * - * - *
-   * If delivery to Google Cloud Storage is used with this subscription, this
-   * field is used to configure it.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - * - * @return The cloudStorageConfig. - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfig getCloudStorageConfig() { - return cloudStorageConfig_ == null - ? com.google.pubsub.v1.CloudStorageConfig.getDefaultInstance() - : cloudStorageConfig_; - } - /** - * - * - *
-   * If delivery to Google Cloud Storage is used with this subscription, this
-   * field is used to configure it.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - */ - @java.lang.Override - public com.google.pubsub.v1.CloudStorageConfigOrBuilder getCloudStorageConfigOrBuilder() { - return cloudStorageConfig_ == null - ? com.google.pubsub.v1.CloudStorageConfig.getDefaultInstance() - : cloudStorageConfig_; - } - - public static final int ACK_DEADLINE_SECONDS_FIELD_NUMBER = 5; - private int ackDeadlineSeconds_ = 0; - /** - * - * - *
-   * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
-   * the subscriber to acknowledge receipt before resending the message. In the
-   * interval after the message is delivered and before it is acknowledged, it
-   * is considered to be _outstanding_. During that time period, the
-   * message will not be redelivered (on a best-effort basis).
-   *
-   * For pull subscriptions, this value is used as the initial value for the ack
-   * deadline. To override this value for a given message, call
-   * `ModifyAckDeadline` with the corresponding `ack_id` if using
-   * non-streaming pull or send the `ack_id` in a
-   * `StreamingModifyAckDeadlineRequest` if using streaming pull.
-   * The minimum custom deadline you can specify is 10 seconds.
-   * The maximum custom deadline you can specify is 600 seconds (10 minutes).
-   * If this parameter is 0, a default value of 10 seconds is used.
-   *
-   * For push delivery, this value is also used to set the request timeout for
-   * the call to the push endpoint.
-   *
-   * If the subscriber never acknowledges the message, the Pub/Sub
-   * system will eventually redeliver the message.
-   * 
- * - * int32 ack_deadline_seconds = 5; - * - * @return The ackDeadlineSeconds. - */ - @java.lang.Override - public int getAckDeadlineSeconds() { - return ackDeadlineSeconds_; - } - - public static final int RETAIN_ACKED_MESSAGES_FIELD_NUMBER = 7; - private boolean retainAckedMessages_ = false; - /** - * - * - *
-   * Indicates whether to retain acknowledged messages. If true, then
-   * messages are not expunged from the subscription's backlog, even if they are
-   * acknowledged, until they fall out of the `message_retention_duration`
-   * window. This must be true if you would like to [`Seek` to a timestamp]
-   * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
-   * the past to replay previously-acknowledged messages.
-   * 
- * - * bool retain_acked_messages = 7; - * - * @return The retainAckedMessages. - */ - @java.lang.Override - public boolean getRetainAckedMessages() { - return retainAckedMessages_; - } - - public static final int MESSAGE_RETENTION_DURATION_FIELD_NUMBER = 8; - private com.google.protobuf.Duration messageRetentionDuration_; - /** - * - * - *
-   * How long to retain unacknowledged messages in the subscription's backlog,
-   * from the moment a message is published.
-   * If `retain_acked_messages` is true, then this also configures the retention
-   * of acknowledged messages, and thus configures how far back in time a `Seek`
-   * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-   * minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return Whether the messageRetentionDuration field is set. - */ - @java.lang.Override - public boolean hasMessageRetentionDuration() { - return messageRetentionDuration_ != null; - } - /** - * - * - *
-   * How long to retain unacknowledged messages in the subscription's backlog,
-   * from the moment a message is published.
-   * If `retain_acked_messages` is true, then this also configures the retention
-   * of acknowledged messages, and thus configures how far back in time a `Seek`
-   * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-   * minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return The messageRetentionDuration. - */ - @java.lang.Override - public com.google.protobuf.Duration getMessageRetentionDuration() { - return messageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : messageRetentionDuration_; - } - /** - * - * - *
-   * How long to retain unacknowledged messages in the subscription's backlog,
-   * from the moment a message is published.
-   * If `retain_acked_messages` is true, then this also configures the retention
-   * of acknowledged messages, and thus configures how far back in time a `Seek`
-   * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-   * minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getMessageRetentionDurationOrBuilder() { - return messageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : messageRetentionDuration_; - } - - public static final int LABELS_FIELD_NUMBER = 9; - - private static final class LabelsDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Subscription_LabelsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - @SuppressWarnings("serial") - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 9; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 9; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 9; - */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 9; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int ENABLE_MESSAGE_ORDERING_FIELD_NUMBER = 10; - private boolean enableMessageOrdering_ = false; - /** - * - * - *
-   * If true, messages published with the same `ordering_key` in `PubsubMessage`
-   * will be delivered to the subscribers in the order in which they
-   * are received by the Pub/Sub system. Otherwise, they may be delivered in
-   * any order.
-   * 
- * - * bool enable_message_ordering = 10; - * - * @return The enableMessageOrdering. - */ - @java.lang.Override - public boolean getEnableMessageOrdering() { - return enableMessageOrdering_; - } - - public static final int EXPIRATION_POLICY_FIELD_NUMBER = 11; - private com.google.pubsub.v1.ExpirationPolicy expirationPolicy_; - /** - * - * - *
-   * A policy that specifies the conditions for this subscription's expiration.
-   * A subscription is considered active as long as any connected subscriber is
-   * successfully consuming messages from the subscription or is issuing
-   * operations on the subscription. If `expiration_policy` is not set, a
-   * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-   * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-   * but `expiration_policy.ttl` is not set, the subscription never expires.
-   * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - * - * @return Whether the expirationPolicy field is set. - */ - @java.lang.Override - public boolean hasExpirationPolicy() { - return expirationPolicy_ != null; - } - /** - * - * - *
-   * A policy that specifies the conditions for this subscription's expiration.
-   * A subscription is considered active as long as any connected subscriber is
-   * successfully consuming messages from the subscription or is issuing
-   * operations on the subscription. If `expiration_policy` is not set, a
-   * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-   * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-   * but `expiration_policy.ttl` is not set, the subscription never expires.
-   * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - * - * @return The expirationPolicy. - */ - @java.lang.Override - public com.google.pubsub.v1.ExpirationPolicy getExpirationPolicy() { - return expirationPolicy_ == null - ? com.google.pubsub.v1.ExpirationPolicy.getDefaultInstance() - : expirationPolicy_; - } - /** - * - * - *
-   * A policy that specifies the conditions for this subscription's expiration.
-   * A subscription is considered active as long as any connected subscriber is
-   * successfully consuming messages from the subscription or is issuing
-   * operations on the subscription. If `expiration_policy` is not set, a
-   * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-   * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-   * but `expiration_policy.ttl` is not set, the subscription never expires.
-   * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - */ - @java.lang.Override - public com.google.pubsub.v1.ExpirationPolicyOrBuilder getExpirationPolicyOrBuilder() { - return expirationPolicy_ == null - ? com.google.pubsub.v1.ExpirationPolicy.getDefaultInstance() - : expirationPolicy_; - } - - public static final int FILTER_FIELD_NUMBER = 12; - - @SuppressWarnings("serial") - private volatile java.lang.Object filter_ = ""; - /** - * - * - *
-   * An expression written in the Pub/Sub [filter
-   * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
-   * then only `PubsubMessage`s whose `attributes` field matches the filter are
-   * delivered on this subscription. If empty, then no messages are filtered
-   * out.
-   * 
- * - * string filter = 12; - * - * @return The filter. - */ - @java.lang.Override - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - 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(); - filter_ = s; - return s; - } - } - /** - * - * - *
-   * An expression written in the Pub/Sub [filter
-   * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
-   * then only `PubsubMessage`s whose `attributes` field matches the filter are
-   * delivered on this subscription. If empty, then no messages are filtered
-   * out.
-   * 
- * - * string filter = 12; - * - * @return The bytes for filter. - */ - @java.lang.Override - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEAD_LETTER_POLICY_FIELD_NUMBER = 13; - private com.google.pubsub.v1.DeadLetterPolicy deadLetterPolicy_; - /** - * - * - *
-   * A policy that specifies the conditions for dead lettering messages in
-   * this subscription. If dead_letter_policy is not set, dead lettering
-   * is disabled.
-   *
-   * The Cloud Pub/Sub service account associated with this subscriptions's
-   * parent project (i.e.,
-   * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-   * permission to Acknowledge() messages on this subscription.
-   * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - * - * @return Whether the deadLetterPolicy field is set. - */ - @java.lang.Override - public boolean hasDeadLetterPolicy() { - return deadLetterPolicy_ != null; - } - /** - * - * - *
-   * A policy that specifies the conditions for dead lettering messages in
-   * this subscription. If dead_letter_policy is not set, dead lettering
-   * is disabled.
-   *
-   * The Cloud Pub/Sub service account associated with this subscriptions's
-   * parent project (i.e.,
-   * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-   * permission to Acknowledge() messages on this subscription.
-   * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - * - * @return The deadLetterPolicy. - */ - @java.lang.Override - public com.google.pubsub.v1.DeadLetterPolicy getDeadLetterPolicy() { - return deadLetterPolicy_ == null - ? com.google.pubsub.v1.DeadLetterPolicy.getDefaultInstance() - : deadLetterPolicy_; - } - /** - * - * - *
-   * A policy that specifies the conditions for dead lettering messages in
-   * this subscription. If dead_letter_policy is not set, dead lettering
-   * is disabled.
-   *
-   * The Cloud Pub/Sub service account associated with this subscriptions's
-   * parent project (i.e.,
-   * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-   * permission to Acknowledge() messages on this subscription.
-   * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - */ - @java.lang.Override - public com.google.pubsub.v1.DeadLetterPolicyOrBuilder getDeadLetterPolicyOrBuilder() { - return deadLetterPolicy_ == null - ? com.google.pubsub.v1.DeadLetterPolicy.getDefaultInstance() - : deadLetterPolicy_; - } - - public static final int RETRY_POLICY_FIELD_NUMBER = 14; - private com.google.pubsub.v1.RetryPolicy retryPolicy_; - /** - * - * - *
-   * A policy that specifies how Pub/Sub retries message delivery for this
-   * subscription.
-   *
-   * If not set, the default retry policy is applied. This generally implies
-   * that messages will be retried as soon as possible for healthy subscribers.
-   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-   * exceeded events for a given message.
-   * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - * - * @return Whether the retryPolicy field is set. - */ - @java.lang.Override - public boolean hasRetryPolicy() { - return retryPolicy_ != null; - } - /** - * - * - *
-   * A policy that specifies how Pub/Sub retries message delivery for this
-   * subscription.
-   *
-   * If not set, the default retry policy is applied. This generally implies
-   * that messages will be retried as soon as possible for healthy subscribers.
-   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-   * exceeded events for a given message.
-   * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - * - * @return The retryPolicy. - */ - @java.lang.Override - public com.google.pubsub.v1.RetryPolicy getRetryPolicy() { - return retryPolicy_ == null - ? com.google.pubsub.v1.RetryPolicy.getDefaultInstance() - : retryPolicy_; - } - /** - * - * - *
-   * A policy that specifies how Pub/Sub retries message delivery for this
-   * subscription.
-   *
-   * If not set, the default retry policy is applied. This generally implies
-   * that messages will be retried as soon as possible for healthy subscribers.
-   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-   * exceeded events for a given message.
-   * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - */ - @java.lang.Override - public com.google.pubsub.v1.RetryPolicyOrBuilder getRetryPolicyOrBuilder() { - return retryPolicy_ == null - ? com.google.pubsub.v1.RetryPolicy.getDefaultInstance() - : retryPolicy_; - } - - public static final int DETACHED_FIELD_NUMBER = 15; - private boolean detached_ = false; - /** - * - * - *
-   * Indicates whether the subscription is detached from its topic. Detached
-   * subscriptions don't receive messages from their topic and don't retain any
-   * backlog. `Pull` and `StreamingPull` requests will return
-   * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
-   * the endpoint will not be made.
-   * 
- * - * bool detached = 15; - * - * @return The detached. - */ - @java.lang.Override - public boolean getDetached() { - return detached_; - } - - public static final int ENABLE_EXACTLY_ONCE_DELIVERY_FIELD_NUMBER = 16; - private boolean enableExactlyOnceDelivery_ = false; - /** - * - * - *
-   * If true, Pub/Sub provides the following guarantees for the delivery of
-   * a message with a given value of `message_id` on this subscription:
-   *
-   * * The message sent to a subscriber is guaranteed not to be resent
-   * before the message's acknowledgement deadline expires.
-   * * An acknowledged message will not be resent to a subscriber.
-   *
-   * Note that subscribers may still receive multiple copies of a message
-   * when `enable_exactly_once_delivery` is true if the message was published
-   * multiple times by a publisher client. These copies are  considered distinct
-   * by Pub/Sub and have distinct `message_id` values.
-   * 
- * - * bool enable_exactly_once_delivery = 16; - * - * @return The enableExactlyOnceDelivery. - */ - @java.lang.Override - public boolean getEnableExactlyOnceDelivery() { - return enableExactlyOnceDelivery_; - } - - public static final int TOPIC_MESSAGE_RETENTION_DURATION_FIELD_NUMBER = 17; - private com.google.protobuf.Duration topicMessageRetentionDuration_; - /** - * - * - *
-   * Output only. Indicates the minimum duration for which a message is retained
-   * after it is published to the subscription's topic. If this field is set,
-   * messages published to the subscription's topic in the last
-   * `topic_message_retention_duration` are always available to subscribers. See
-   * the `message_retention_duration` field in `Topic`. This field is set only
-   * in responses from the server; it is ignored if it is set in any requests.
-   * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the topicMessageRetentionDuration field is set. - */ - @java.lang.Override - public boolean hasTopicMessageRetentionDuration() { - return topicMessageRetentionDuration_ != null; - } - /** - * - * - *
-   * Output only. Indicates the minimum duration for which a message is retained
-   * after it is published to the subscription's topic. If this field is set,
-   * messages published to the subscription's topic in the last
-   * `topic_message_retention_duration` are always available to subscribers. See
-   * the `message_retention_duration` field in `Topic`. This field is set only
-   * in responses from the server; it is ignored if it is set in any requests.
-   * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The topicMessageRetentionDuration. - */ - @java.lang.Override - public com.google.protobuf.Duration getTopicMessageRetentionDuration() { - return topicMessageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : topicMessageRetentionDuration_; - } - /** - * - * - *
-   * Output only. Indicates the minimum duration for which a message is retained
-   * after it is published to the subscription's topic. If this field is set,
-   * messages published to the subscription's topic in the last
-   * `topic_message_retention_duration` are always available to subscribers. See
-   * the `message_retention_duration` field in `Topic`. This field is set only
-   * in responses from the server; it is ignored if it is set in any requests.
-   * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getTopicMessageRetentionDurationOrBuilder() { - return topicMessageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : topicMessageRetentionDuration_; - } - - public static final int STATE_FIELD_NUMBER = 19; - private int state_ = 0; - /** - * - * - *
-   * Output only. An output-only field indicating whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for state. - */ - @java.lang.Override - public int getStateValue() { - return state_; - } - /** - * - * - *
-   * Output only. An output-only field indicating whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The state. - */ - @java.lang.Override - public com.google.pubsub.v1.Subscription.State getState() { - com.google.pubsub.v1.Subscription.State result = - com.google.pubsub.v1.Subscription.State.forNumber(state_); - return result == null ? com.google.pubsub.v1.Subscription.State.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, topic_); - } - if (pushConfig_ != null) { - output.writeMessage(4, getPushConfig()); - } - if (ackDeadlineSeconds_ != 0) { - output.writeInt32(5, ackDeadlineSeconds_); - } - if (retainAckedMessages_ != false) { - output.writeBool(7, retainAckedMessages_); - } - if (messageRetentionDuration_ != null) { - output.writeMessage(8, getMessageRetentionDuration()); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 9); - if (enableMessageOrdering_ != false) { - output.writeBool(10, enableMessageOrdering_); - } - if (expirationPolicy_ != null) { - output.writeMessage(11, getExpirationPolicy()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, filter_); - } - if (deadLetterPolicy_ != null) { - output.writeMessage(13, getDeadLetterPolicy()); - } - if (retryPolicy_ != null) { - output.writeMessage(14, getRetryPolicy()); - } - if (detached_ != false) { - output.writeBool(15, detached_); - } - if (enableExactlyOnceDelivery_ != false) { - output.writeBool(16, enableExactlyOnceDelivery_); - } - if (topicMessageRetentionDuration_ != null) { - output.writeMessage(17, getTopicMessageRetentionDuration()); - } - if (bigqueryConfig_ != null) { - output.writeMessage(18, getBigqueryConfig()); - } - if (state_ != com.google.pubsub.v1.Subscription.State.STATE_UNSPECIFIED.getNumber()) { - output.writeEnum(19, state_); - } - if (cloudStorageConfig_ != null) { - output.writeMessage(22, getCloudStorageConfig()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, topic_); - } - if (pushConfig_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPushConfig()); - } - if (ackDeadlineSeconds_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, ackDeadlineSeconds_); - } - if (retainAckedMessages_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, retainAckedMessages_); - } - if (messageRetentionDuration_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 8, getMessageRetentionDuration()); - } - for (java.util.Map.Entry entry : - internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry labels__ = - LabelsDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, labels__); - } - if (enableMessageOrdering_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, enableMessageOrdering_); - } - if (expirationPolicy_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getExpirationPolicy()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, filter_); - } - if (deadLetterPolicy_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getDeadLetterPolicy()); - } - if (retryPolicy_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getRetryPolicy()); - } - if (detached_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(15, detached_); - } - if (enableExactlyOnceDelivery_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(16, enableExactlyOnceDelivery_); - } - if (topicMessageRetentionDuration_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 17, getTopicMessageRetentionDuration()); - } - if (bigqueryConfig_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getBigqueryConfig()); - } - if (state_ != com.google.pubsub.v1.Subscription.State.STATE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(19, state_); - } - if (cloudStorageConfig_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getCloudStorageConfig()); - } - size += getUnknownFields().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.Subscription)) { - return super.equals(obj); - } - com.google.pubsub.v1.Subscription other = (com.google.pubsub.v1.Subscription) obj; - - if (!getName().equals(other.getName())) return false; - if (!getTopic().equals(other.getTopic())) return false; - if (hasPushConfig() != other.hasPushConfig()) return false; - if (hasPushConfig()) { - if (!getPushConfig().equals(other.getPushConfig())) return false; - } - if (hasBigqueryConfig() != other.hasBigqueryConfig()) return false; - if (hasBigqueryConfig()) { - if (!getBigqueryConfig().equals(other.getBigqueryConfig())) return false; - } - if (hasCloudStorageConfig() != other.hasCloudStorageConfig()) return false; - if (hasCloudStorageConfig()) { - if (!getCloudStorageConfig().equals(other.getCloudStorageConfig())) return false; - } - if (getAckDeadlineSeconds() != other.getAckDeadlineSeconds()) return false; - if (getRetainAckedMessages() != other.getRetainAckedMessages()) return false; - if (hasMessageRetentionDuration() != other.hasMessageRetentionDuration()) return false; - if (hasMessageRetentionDuration()) { - if (!getMessageRetentionDuration().equals(other.getMessageRetentionDuration())) return false; - } - if (!internalGetLabels().equals(other.internalGetLabels())) return false; - if (getEnableMessageOrdering() != other.getEnableMessageOrdering()) return false; - if (hasExpirationPolicy() != other.hasExpirationPolicy()) return false; - if (hasExpirationPolicy()) { - if (!getExpirationPolicy().equals(other.getExpirationPolicy())) return false; - } - if (!getFilter().equals(other.getFilter())) return false; - if (hasDeadLetterPolicy() != other.hasDeadLetterPolicy()) return false; - if (hasDeadLetterPolicy()) { - if (!getDeadLetterPolicy().equals(other.getDeadLetterPolicy())) return false; - } - if (hasRetryPolicy() != other.hasRetryPolicy()) return false; - if (hasRetryPolicy()) { - if (!getRetryPolicy().equals(other.getRetryPolicy())) return false; - } - if (getDetached() != other.getDetached()) return false; - if (getEnableExactlyOnceDelivery() != other.getEnableExactlyOnceDelivery()) return false; - if (hasTopicMessageRetentionDuration() != other.hasTopicMessageRetentionDuration()) - return false; - if (hasTopicMessageRetentionDuration()) { - if (!getTopicMessageRetentionDuration().equals(other.getTopicMessageRetentionDuration())) - return false; - } - if (state_ != other.state_) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getTopic().hashCode(); - if (hasPushConfig()) { - hash = (37 * hash) + PUSH_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getPushConfig().hashCode(); - } - if (hasBigqueryConfig()) { - hash = (37 * hash) + BIGQUERY_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getBigqueryConfig().hashCode(); - } - if (hasCloudStorageConfig()) { - hash = (37 * hash) + CLOUD_STORAGE_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getCloudStorageConfig().hashCode(); - } - hash = (37 * hash) + ACK_DEADLINE_SECONDS_FIELD_NUMBER; - hash = (53 * hash) + getAckDeadlineSeconds(); - hash = (37 * hash) + RETAIN_ACKED_MESSAGES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRetainAckedMessages()); - if (hasMessageRetentionDuration()) { - hash = (37 * hash) + MESSAGE_RETENTION_DURATION_FIELD_NUMBER; - hash = (53 * hash) + getMessageRetentionDuration().hashCode(); - } - if (!internalGetLabels().getMap().isEmpty()) { - hash = (37 * hash) + LABELS_FIELD_NUMBER; - hash = (53 * hash) + internalGetLabels().hashCode(); - } - hash = (37 * hash) + ENABLE_MESSAGE_ORDERING_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableMessageOrdering()); - if (hasExpirationPolicy()) { - hash = (37 * hash) + EXPIRATION_POLICY_FIELD_NUMBER; - hash = (53 * hash) + getExpirationPolicy().hashCode(); - } - hash = (37 * hash) + FILTER_FIELD_NUMBER; - hash = (53 * hash) + getFilter().hashCode(); - if (hasDeadLetterPolicy()) { - hash = (37 * hash) + DEAD_LETTER_POLICY_FIELD_NUMBER; - hash = (53 * hash) + getDeadLetterPolicy().hashCode(); - } - if (hasRetryPolicy()) { - hash = (37 * hash) + RETRY_POLICY_FIELD_NUMBER; - hash = (53 * hash) + getRetryPolicy().hashCode(); - } - hash = (37 * hash) + DETACHED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDetached()); - hash = (37 * hash) + ENABLE_EXACTLY_ONCE_DELIVERY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableExactlyOnceDelivery()); - if (hasTopicMessageRetentionDuration()) { - hash = (37 * hash) + TOPIC_MESSAGE_RETENTION_DURATION_FIELD_NUMBER; - hash = (53 * hash) + getTopicMessageRetentionDuration().hashCode(); - } - hash = (37 * hash) + STATE_FIELD_NUMBER; - hash = (53 * hash) + state_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.Subscription parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.Subscription 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.Subscription parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.Subscription 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.Subscription parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.Subscription parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.Subscription parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.Subscription 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.Subscription parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.Subscription 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.Subscription parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.Subscription 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.Subscription 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 subscription resource. If none of `push_config`, `bigquery_config`, or
-   * `cloud_storage_config` is set, then the subscriber will pull and ack messages
-   * using API methods. At most one of these fields may be set.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.Subscription} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.Subscription) - com.google.pubsub.v1.SubscriptionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Subscription_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 9: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 9: - return internalGetMutableLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Subscription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.Subscription.class, - com.google.pubsub.v1.Subscription.Builder.class); - } - - // Construct using com.google.pubsub.v1.Subscription.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - topic_ = ""; - pushConfig_ = null; - if (pushConfigBuilder_ != null) { - pushConfigBuilder_.dispose(); - pushConfigBuilder_ = null; - } - bigqueryConfig_ = null; - if (bigqueryConfigBuilder_ != null) { - bigqueryConfigBuilder_.dispose(); - bigqueryConfigBuilder_ = null; - } - cloudStorageConfig_ = null; - if (cloudStorageConfigBuilder_ != null) { - cloudStorageConfigBuilder_.dispose(); - cloudStorageConfigBuilder_ = null; - } - ackDeadlineSeconds_ = 0; - retainAckedMessages_ = false; - messageRetentionDuration_ = null; - if (messageRetentionDurationBuilder_ != null) { - messageRetentionDurationBuilder_.dispose(); - messageRetentionDurationBuilder_ = null; - } - internalGetMutableLabels().clear(); - enableMessageOrdering_ = false; - expirationPolicy_ = null; - if (expirationPolicyBuilder_ != null) { - expirationPolicyBuilder_.dispose(); - expirationPolicyBuilder_ = null; - } - filter_ = ""; - deadLetterPolicy_ = null; - if (deadLetterPolicyBuilder_ != null) { - deadLetterPolicyBuilder_.dispose(); - deadLetterPolicyBuilder_ = null; - } - retryPolicy_ = null; - if (retryPolicyBuilder_ != null) { - retryPolicyBuilder_.dispose(); - retryPolicyBuilder_ = null; - } - detached_ = false; - enableExactlyOnceDelivery_ = false; - topicMessageRetentionDuration_ = null; - if (topicMessageRetentionDurationBuilder_ != null) { - topicMessageRetentionDurationBuilder_.dispose(); - topicMessageRetentionDurationBuilder_ = null; - } - state_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Subscription_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.Subscription getDefaultInstanceForType() { - return com.google.pubsub.v1.Subscription.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.Subscription build() { - com.google.pubsub.v1.Subscription result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.Subscription buildPartial() { - com.google.pubsub.v1.Subscription result = new com.google.pubsub.v1.Subscription(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.Subscription result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.topic_ = topic_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pushConfig_ = pushConfigBuilder_ == null ? pushConfig_ : pushConfigBuilder_.build(); - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.bigqueryConfig_ = - bigqueryConfigBuilder_ == null ? bigqueryConfig_ : bigqueryConfigBuilder_.build(); - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.cloudStorageConfig_ = - cloudStorageConfigBuilder_ == null - ? cloudStorageConfig_ - : cloudStorageConfigBuilder_.build(); - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.ackDeadlineSeconds_ = ackDeadlineSeconds_; - } - if (((from_bitField0_ & 0x00000040) != 0)) { - result.retainAckedMessages_ = retainAckedMessages_; - } - if (((from_bitField0_ & 0x00000080) != 0)) { - result.messageRetentionDuration_ = - messageRetentionDurationBuilder_ == null - ? messageRetentionDuration_ - : messageRetentionDurationBuilder_.build(); - } - if (((from_bitField0_ & 0x00000100) != 0)) { - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - } - if (((from_bitField0_ & 0x00000200) != 0)) { - result.enableMessageOrdering_ = enableMessageOrdering_; - } - if (((from_bitField0_ & 0x00000400) != 0)) { - result.expirationPolicy_ = - expirationPolicyBuilder_ == null ? expirationPolicy_ : expirationPolicyBuilder_.build(); - } - if (((from_bitField0_ & 0x00000800) != 0)) { - result.filter_ = filter_; - } - if (((from_bitField0_ & 0x00001000) != 0)) { - result.deadLetterPolicy_ = - deadLetterPolicyBuilder_ == null ? deadLetterPolicy_ : deadLetterPolicyBuilder_.build(); - } - if (((from_bitField0_ & 0x00002000) != 0)) { - result.retryPolicy_ = - retryPolicyBuilder_ == null ? retryPolicy_ : retryPolicyBuilder_.build(); - } - if (((from_bitField0_ & 0x00004000) != 0)) { - result.detached_ = detached_; - } - if (((from_bitField0_ & 0x00008000) != 0)) { - result.enableExactlyOnceDelivery_ = enableExactlyOnceDelivery_; - } - if (((from_bitField0_ & 0x00010000) != 0)) { - result.topicMessageRetentionDuration_ = - topicMessageRetentionDurationBuilder_ == null - ? topicMessageRetentionDuration_ - : topicMessageRetentionDurationBuilder_.build(); - } - if (((from_bitField0_ & 0x00020000) != 0)) { - result.state_ = state_; - } - } - - @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.Subscription) { - return mergeFrom((com.google.pubsub.v1.Subscription) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.Subscription other) { - if (other == com.google.pubsub.v1.Subscription.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getTopic().isEmpty()) { - topic_ = other.topic_; - bitField0_ |= 0x00000002; - onChanged(); - } - if (other.hasPushConfig()) { - mergePushConfig(other.getPushConfig()); - } - if (other.hasBigqueryConfig()) { - mergeBigqueryConfig(other.getBigqueryConfig()); - } - if (other.hasCloudStorageConfig()) { - mergeCloudStorageConfig(other.getCloudStorageConfig()); - } - if (other.getAckDeadlineSeconds() != 0) { - setAckDeadlineSeconds(other.getAckDeadlineSeconds()); - } - if (other.getRetainAckedMessages() != false) { - setRetainAckedMessages(other.getRetainAckedMessages()); - } - if (other.hasMessageRetentionDuration()) { - mergeMessageRetentionDuration(other.getMessageRetentionDuration()); - } - internalGetMutableLabels().mergeFrom(other.internalGetLabels()); - bitField0_ |= 0x00000100; - if (other.getEnableMessageOrdering() != false) { - setEnableMessageOrdering(other.getEnableMessageOrdering()); - } - if (other.hasExpirationPolicy()) { - mergeExpirationPolicy(other.getExpirationPolicy()); - } - if (!other.getFilter().isEmpty()) { - filter_ = other.filter_; - bitField0_ |= 0x00000800; - onChanged(); - } - if (other.hasDeadLetterPolicy()) { - mergeDeadLetterPolicy(other.getDeadLetterPolicy()); - } - if (other.hasRetryPolicy()) { - mergeRetryPolicy(other.getRetryPolicy()); - } - if (other.getDetached() != false) { - setDetached(other.getDetached()); - } - if (other.getEnableExactlyOnceDelivery() != false) { - setEnableExactlyOnceDelivery(other.getEnableExactlyOnceDelivery()); - } - if (other.hasTopicMessageRetentionDuration()) { - mergeTopicMessageRetentionDuration(other.getTopicMessageRetentionDuration()); - } - if (other.state_ != 0) { - setStateValue(other.getStateValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - topic_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 34: - { - input.readMessage(getPushConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000004; - break; - } // case 34 - case 40: - { - ackDeadlineSeconds_ = input.readInt32(); - bitField0_ |= 0x00000020; - break; - } // case 40 - case 56: - { - retainAckedMessages_ = input.readBool(); - bitField0_ |= 0x00000040; - break; - } // case 56 - case 66: - { - input.readMessage( - getMessageRetentionDurationFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000080; - break; - } // case 66 - case 74: - { - com.google.protobuf.MapEntry labels__ = - input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableLabels() - .getMutableMap() - .put(labels__.getKey(), labels__.getValue()); - bitField0_ |= 0x00000100; - break; - } // case 74 - case 80: - { - enableMessageOrdering_ = input.readBool(); - bitField0_ |= 0x00000200; - break; - } // case 80 - case 90: - { - input.readMessage( - getExpirationPolicyFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000400; - break; - } // case 90 - case 98: - { - filter_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000800; - break; - } // case 98 - case 106: - { - input.readMessage( - getDeadLetterPolicyFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00001000; - break; - } // case 106 - case 114: - { - input.readMessage(getRetryPolicyFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00002000; - break; - } // case 114 - case 120: - { - detached_ = input.readBool(); - bitField0_ |= 0x00004000; - break; - } // case 120 - case 128: - { - enableExactlyOnceDelivery_ = input.readBool(); - bitField0_ |= 0x00008000; - break; - } // case 128 - case 138: - { - input.readMessage( - getTopicMessageRetentionDurationFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00010000; - break; - } // case 138 - case 146: - { - input.readMessage(getBigqueryConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000008; - break; - } // case 146 - case 152: - { - state_ = input.readEnum(); - bitField0_ |= 0x00020000; - break; - } // case 152 - case 178: - { - input.readMessage( - getCloudStorageConfigFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000010; - break; - } // case 178 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The name of the subscription. It must have the format
-     * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
-     * start with a letter, and contain only letters (`[A-Za-z]`), numbers
-     * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
-     * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
-     * in length, and it must not start with `"goog"`.
-     * 
- * - * 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. The name of the subscription. It must have the format
-     * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
-     * start with a letter, and contain only letters (`[A-Za-z]`), numbers
-     * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
-     * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
-     * in length, and it must not start with `"goog"`.
-     * 
- * - * 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. The name of the subscription. It must have the format
-     * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
-     * start with a letter, and contain only letters (`[A-Za-z]`), numbers
-     * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
-     * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
-     * in length, and it must not start with `"goog"`.
-     * 
- * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the subscription. It must have the format
-     * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
-     * start with a letter, and contain only letters (`[A-Za-z]`), numbers
-     * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
-     * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
-     * in length, and it must not start with `"goog"`.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the subscription. It must have the format
-     * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
-     * start with a letter, and contain only letters (`[A-Za-z]`), numbers
-     * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
-     * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
-     * in length, and it must not start with `"goog"`.
-     * 
- * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object topic_ = ""; - /** - * - * - *
-     * Required. The name of the topic from which this subscription is receiving
-     * messages. Format is `projects/{project}/topics/{topic}`. The value of this
-     * field will be `_deleted-topic_` if the topic has been deleted.
-     * 
- * - * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - public java.lang.String getTopic() { - java.lang.Object ref = topic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - topic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The name of the topic from which this subscription is receiving
-     * messages. Format is `projects/{project}/topics/{topic}`. The value of this
-     * field will be `_deleted-topic_` if the topic has been deleted.
-     * 
- * - * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - public com.google.protobuf.ByteString getTopicBytes() { - java.lang.Object ref = topic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - topic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The name of the topic from which this subscription is receiving
-     * messages. Format is `projects/{project}/topics/{topic}`. The value of this
-     * field will be `_deleted-topic_` if the topic has been deleted.
-     * 
- * - * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The topic to set. - * @return This builder for chaining. - */ - public Builder setTopic(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - topic_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the topic from which this subscription is receiving
-     * messages. Format is `projects/{project}/topics/{topic}`. The value of this
-     * field will be `_deleted-topic_` if the topic has been deleted.
-     * 
- * - * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearTopic() { - topic_ = getDefaultInstance().getTopic(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the topic from which this subscription is receiving
-     * messages. Format is `projects/{project}/topics/{topic}`. The value of this
-     * field will be `_deleted-topic_` if the topic has been deleted.
-     * 
- * - * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for topic to set. - * @return This builder for chaining. - */ - public Builder setTopicBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - topic_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private com.google.pubsub.v1.PushConfig pushConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig, - com.google.pubsub.v1.PushConfig.Builder, - com.google.pubsub.v1.PushConfigOrBuilder> - pushConfigBuilder_; - /** - * - * - *
-     * If push delivery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - * - * @return Whether the pushConfig field is set. - */ - public boolean hasPushConfig() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * If push delivery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - * - * @return The pushConfig. - */ - public com.google.pubsub.v1.PushConfig getPushConfig() { - if (pushConfigBuilder_ == null) { - return pushConfig_ == null - ? com.google.pubsub.v1.PushConfig.getDefaultInstance() - : pushConfig_; - } else { - return pushConfigBuilder_.getMessage(); - } - } - /** - * - * - *
-     * If push delivery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - */ - public Builder setPushConfig(com.google.pubsub.v1.PushConfig value) { - if (pushConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - pushConfig_ = value; - } else { - pushConfigBuilder_.setMessage(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * If push delivery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - */ - public Builder setPushConfig(com.google.pubsub.v1.PushConfig.Builder builderForValue) { - if (pushConfigBuilder_ == null) { - pushConfig_ = builderForValue.build(); - } else { - pushConfigBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * If push delivery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - */ - public Builder mergePushConfig(com.google.pubsub.v1.PushConfig value) { - if (pushConfigBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0) - && pushConfig_ != null - && pushConfig_ != com.google.pubsub.v1.PushConfig.getDefaultInstance()) { - getPushConfigBuilder().mergeFrom(value); - } else { - pushConfig_ = value; - } - } else { - pushConfigBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * If push delivery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - */ - public Builder clearPushConfig() { - bitField0_ = (bitField0_ & ~0x00000004); - pushConfig_ = null; - if (pushConfigBuilder_ != null) { - pushConfigBuilder_.dispose(); - pushConfigBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * If push delivery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - */ - public com.google.pubsub.v1.PushConfig.Builder getPushConfigBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return getPushConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * If push delivery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - */ - public com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder() { - if (pushConfigBuilder_ != null) { - return pushConfigBuilder_.getMessageOrBuilder(); - } else { - return pushConfig_ == null - ? com.google.pubsub.v1.PushConfig.getDefaultInstance() - : pushConfig_; - } - } - /** - * - * - *
-     * If push delivery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig, - com.google.pubsub.v1.PushConfig.Builder, - com.google.pubsub.v1.PushConfigOrBuilder> - getPushConfigFieldBuilder() { - if (pushConfigBuilder_ == null) { - pushConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.PushConfig, - com.google.pubsub.v1.PushConfig.Builder, - com.google.pubsub.v1.PushConfigOrBuilder>( - getPushConfig(), getParentForChildren(), isClean()); - pushConfig_ = null; - } - return pushConfigBuilder_; - } - - private com.google.pubsub.v1.BigQueryConfig bigqueryConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.BigQueryConfig, - com.google.pubsub.v1.BigQueryConfig.Builder, - com.google.pubsub.v1.BigQueryConfigOrBuilder> - bigqueryConfigBuilder_; - /** - * - * - *
-     * If delivery to BigQuery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - * - * @return Whether the bigqueryConfig field is set. - */ - public boolean hasBigqueryConfig() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * - * - *
-     * If delivery to BigQuery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - * - * @return The bigqueryConfig. - */ - public com.google.pubsub.v1.BigQueryConfig getBigqueryConfig() { - if (bigqueryConfigBuilder_ == null) { - return bigqueryConfig_ == null - ? com.google.pubsub.v1.BigQueryConfig.getDefaultInstance() - : bigqueryConfig_; - } else { - return bigqueryConfigBuilder_.getMessage(); - } - } - /** - * - * - *
-     * If delivery to BigQuery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - */ - public Builder setBigqueryConfig(com.google.pubsub.v1.BigQueryConfig value) { - if (bigqueryConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - bigqueryConfig_ = value; - } else { - bigqueryConfigBuilder_.setMessage(value); - } - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * If delivery to BigQuery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - */ - public Builder setBigqueryConfig(com.google.pubsub.v1.BigQueryConfig.Builder builderForValue) { - if (bigqueryConfigBuilder_ == null) { - bigqueryConfig_ = builderForValue.build(); - } else { - bigqueryConfigBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * If delivery to BigQuery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - */ - public Builder mergeBigqueryConfig(com.google.pubsub.v1.BigQueryConfig value) { - if (bigqueryConfigBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0) - && bigqueryConfig_ != null - && bigqueryConfig_ != com.google.pubsub.v1.BigQueryConfig.getDefaultInstance()) { - getBigqueryConfigBuilder().mergeFrom(value); - } else { - bigqueryConfig_ = value; - } - } else { - bigqueryConfigBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * If delivery to BigQuery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - */ - public Builder clearBigqueryConfig() { - bitField0_ = (bitField0_ & ~0x00000008); - bigqueryConfig_ = null; - if (bigqueryConfigBuilder_ != null) { - bigqueryConfigBuilder_.dispose(); - bigqueryConfigBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * If delivery to BigQuery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - */ - public com.google.pubsub.v1.BigQueryConfig.Builder getBigqueryConfigBuilder() { - bitField0_ |= 0x00000008; - onChanged(); - return getBigqueryConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * If delivery to BigQuery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - */ - public com.google.pubsub.v1.BigQueryConfigOrBuilder getBigqueryConfigOrBuilder() { - if (bigqueryConfigBuilder_ != null) { - return bigqueryConfigBuilder_.getMessageOrBuilder(); - } else { - return bigqueryConfig_ == null - ? com.google.pubsub.v1.BigQueryConfig.getDefaultInstance() - : bigqueryConfig_; - } - } - /** - * - * - *
-     * If delivery to BigQuery is used with this subscription, this field is
-     * used to configure it.
-     * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.BigQueryConfig, - com.google.pubsub.v1.BigQueryConfig.Builder, - com.google.pubsub.v1.BigQueryConfigOrBuilder> - getBigqueryConfigFieldBuilder() { - if (bigqueryConfigBuilder_ == null) { - bigqueryConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.BigQueryConfig, - com.google.pubsub.v1.BigQueryConfig.Builder, - com.google.pubsub.v1.BigQueryConfigOrBuilder>( - getBigqueryConfig(), getParentForChildren(), isClean()); - bigqueryConfig_ = null; - } - return bigqueryConfigBuilder_; - } - - private com.google.pubsub.v1.CloudStorageConfig cloudStorageConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.CloudStorageConfig, - com.google.pubsub.v1.CloudStorageConfig.Builder, - com.google.pubsub.v1.CloudStorageConfigOrBuilder> - cloudStorageConfigBuilder_; - /** - * - * - *
-     * If delivery to Google Cloud Storage is used with this subscription, this
-     * field is used to configure it.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - * - * @return Whether the cloudStorageConfig field is set. - */ - public boolean hasCloudStorageConfig() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-     * If delivery to Google Cloud Storage is used with this subscription, this
-     * field is used to configure it.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - * - * @return The cloudStorageConfig. - */ - public com.google.pubsub.v1.CloudStorageConfig getCloudStorageConfig() { - if (cloudStorageConfigBuilder_ == null) { - return cloudStorageConfig_ == null - ? com.google.pubsub.v1.CloudStorageConfig.getDefaultInstance() - : cloudStorageConfig_; - } else { - return cloudStorageConfigBuilder_.getMessage(); - } - } - /** - * - * - *
-     * If delivery to Google Cloud Storage is used with this subscription, this
-     * field is used to configure it.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - */ - public Builder setCloudStorageConfig(com.google.pubsub.v1.CloudStorageConfig value) { - if (cloudStorageConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - cloudStorageConfig_ = value; - } else { - cloudStorageConfigBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * If delivery to Google Cloud Storage is used with this subscription, this
-     * field is used to configure it.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - */ - public Builder setCloudStorageConfig( - com.google.pubsub.v1.CloudStorageConfig.Builder builderForValue) { - if (cloudStorageConfigBuilder_ == null) { - cloudStorageConfig_ = builderForValue.build(); - } else { - cloudStorageConfigBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * If delivery to Google Cloud Storage is used with this subscription, this
-     * field is used to configure it.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - */ - public Builder mergeCloudStorageConfig(com.google.pubsub.v1.CloudStorageConfig value) { - if (cloudStorageConfigBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) - && cloudStorageConfig_ != null - && cloudStorageConfig_ - != com.google.pubsub.v1.CloudStorageConfig.getDefaultInstance()) { - getCloudStorageConfigBuilder().mergeFrom(value); - } else { - cloudStorageConfig_ = value; - } - } else { - cloudStorageConfigBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * If delivery to Google Cloud Storage is used with this subscription, this
-     * field is used to configure it.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - */ - public Builder clearCloudStorageConfig() { - bitField0_ = (bitField0_ & ~0x00000010); - cloudStorageConfig_ = null; - if (cloudStorageConfigBuilder_ != null) { - cloudStorageConfigBuilder_.dispose(); - cloudStorageConfigBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * If delivery to Google Cloud Storage is used with this subscription, this
-     * field is used to configure it.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - */ - public com.google.pubsub.v1.CloudStorageConfig.Builder getCloudStorageConfigBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return getCloudStorageConfigFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * If delivery to Google Cloud Storage is used with this subscription, this
-     * field is used to configure it.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - */ - public com.google.pubsub.v1.CloudStorageConfigOrBuilder getCloudStorageConfigOrBuilder() { - if (cloudStorageConfigBuilder_ != null) { - return cloudStorageConfigBuilder_.getMessageOrBuilder(); - } else { - return cloudStorageConfig_ == null - ? com.google.pubsub.v1.CloudStorageConfig.getDefaultInstance() - : cloudStorageConfig_; - } - } - /** - * - * - *
-     * If delivery to Google Cloud Storage is used with this subscription, this
-     * field is used to configure it.
-     * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.CloudStorageConfig, - com.google.pubsub.v1.CloudStorageConfig.Builder, - com.google.pubsub.v1.CloudStorageConfigOrBuilder> - getCloudStorageConfigFieldBuilder() { - if (cloudStorageConfigBuilder_ == null) { - cloudStorageConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.CloudStorageConfig, - com.google.pubsub.v1.CloudStorageConfig.Builder, - com.google.pubsub.v1.CloudStorageConfigOrBuilder>( - getCloudStorageConfig(), getParentForChildren(), isClean()); - cloudStorageConfig_ = null; - } - return cloudStorageConfigBuilder_; - } - - private int ackDeadlineSeconds_; - /** - * - * - *
-     * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
-     * the subscriber to acknowledge receipt before resending the message. In the
-     * interval after the message is delivered and before it is acknowledged, it
-     * is considered to be _outstanding_. During that time period, the
-     * message will not be redelivered (on a best-effort basis).
-     *
-     * For pull subscriptions, this value is used as the initial value for the ack
-     * deadline. To override this value for a given message, call
-     * `ModifyAckDeadline` with the corresponding `ack_id` if using
-     * non-streaming pull or send the `ack_id` in a
-     * `StreamingModifyAckDeadlineRequest` if using streaming pull.
-     * The minimum custom deadline you can specify is 10 seconds.
-     * The maximum custom deadline you can specify is 600 seconds (10 minutes).
-     * If this parameter is 0, a default value of 10 seconds is used.
-     *
-     * For push delivery, this value is also used to set the request timeout for
-     * the call to the push endpoint.
-     *
-     * If the subscriber never acknowledges the message, the Pub/Sub
-     * system will eventually redeliver the message.
-     * 
- * - * int32 ack_deadline_seconds = 5; - * - * @return The ackDeadlineSeconds. - */ - @java.lang.Override - public int getAckDeadlineSeconds() { - return ackDeadlineSeconds_; - } - /** - * - * - *
-     * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
-     * the subscriber to acknowledge receipt before resending the message. In the
-     * interval after the message is delivered and before it is acknowledged, it
-     * is considered to be _outstanding_. During that time period, the
-     * message will not be redelivered (on a best-effort basis).
-     *
-     * For pull subscriptions, this value is used as the initial value for the ack
-     * deadline. To override this value for a given message, call
-     * `ModifyAckDeadline` with the corresponding `ack_id` if using
-     * non-streaming pull or send the `ack_id` in a
-     * `StreamingModifyAckDeadlineRequest` if using streaming pull.
-     * The minimum custom deadline you can specify is 10 seconds.
-     * The maximum custom deadline you can specify is 600 seconds (10 minutes).
-     * If this parameter is 0, a default value of 10 seconds is used.
-     *
-     * For push delivery, this value is also used to set the request timeout for
-     * the call to the push endpoint.
-     *
-     * If the subscriber never acknowledges the message, the Pub/Sub
-     * system will eventually redeliver the message.
-     * 
- * - * int32 ack_deadline_seconds = 5; - * - * @param value The ackDeadlineSeconds to set. - * @return This builder for chaining. - */ - public Builder setAckDeadlineSeconds(int value) { - - ackDeadlineSeconds_ = value; - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - /** - * - * - *
-     * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
-     * the subscriber to acknowledge receipt before resending the message. In the
-     * interval after the message is delivered and before it is acknowledged, it
-     * is considered to be _outstanding_. During that time period, the
-     * message will not be redelivered (on a best-effort basis).
-     *
-     * For pull subscriptions, this value is used as the initial value for the ack
-     * deadline. To override this value for a given message, call
-     * `ModifyAckDeadline` with the corresponding `ack_id` if using
-     * non-streaming pull or send the `ack_id` in a
-     * `StreamingModifyAckDeadlineRequest` if using streaming pull.
-     * The minimum custom deadline you can specify is 10 seconds.
-     * The maximum custom deadline you can specify is 600 seconds (10 minutes).
-     * If this parameter is 0, a default value of 10 seconds is used.
-     *
-     * For push delivery, this value is also used to set the request timeout for
-     * the call to the push endpoint.
-     *
-     * If the subscriber never acknowledges the message, the Pub/Sub
-     * system will eventually redeliver the message.
-     * 
- * - * int32 ack_deadline_seconds = 5; - * - * @return This builder for chaining. - */ - public Builder clearAckDeadlineSeconds() { - bitField0_ = (bitField0_ & ~0x00000020); - ackDeadlineSeconds_ = 0; - onChanged(); - return this; - } - - private boolean retainAckedMessages_; - /** - * - * - *
-     * Indicates whether to retain acknowledged messages. If true, then
-     * messages are not expunged from the subscription's backlog, even if they are
-     * acknowledged, until they fall out of the `message_retention_duration`
-     * window. This must be true if you would like to [`Seek` to a timestamp]
-     * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
-     * the past to replay previously-acknowledged messages.
-     * 
- * - * bool retain_acked_messages = 7; - * - * @return The retainAckedMessages. - */ - @java.lang.Override - public boolean getRetainAckedMessages() { - return retainAckedMessages_; - } - /** - * - * - *
-     * Indicates whether to retain acknowledged messages. If true, then
-     * messages are not expunged from the subscription's backlog, even if they are
-     * acknowledged, until they fall out of the `message_retention_duration`
-     * window. This must be true if you would like to [`Seek` to a timestamp]
-     * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
-     * the past to replay previously-acknowledged messages.
-     * 
- * - * bool retain_acked_messages = 7; - * - * @param value The retainAckedMessages to set. - * @return This builder for chaining. - */ - public Builder setRetainAckedMessages(boolean value) { - - retainAckedMessages_ = value; - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - /** - * - * - *
-     * Indicates whether to retain acknowledged messages. If true, then
-     * messages are not expunged from the subscription's backlog, even if they are
-     * acknowledged, until they fall out of the `message_retention_duration`
-     * window. This must be true if you would like to [`Seek` to a timestamp]
-     * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
-     * the past to replay previously-acknowledged messages.
-     * 
- * - * bool retain_acked_messages = 7; - * - * @return This builder for chaining. - */ - public Builder clearRetainAckedMessages() { - bitField0_ = (bitField0_ & ~0x00000040); - retainAckedMessages_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.Duration messageRetentionDuration_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - messageRetentionDurationBuilder_; - /** - * - * - *
-     * How long to retain unacknowledged messages in the subscription's backlog,
-     * from the moment a message is published.
-     * If `retain_acked_messages` is true, then this also configures the retention
-     * of acknowledged messages, and thus configures how far back in time a `Seek`
-     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-     * minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return Whether the messageRetentionDuration field is set. - */ - public boolean hasMessageRetentionDuration() { - return ((bitField0_ & 0x00000080) != 0); - } - /** - * - * - *
-     * How long to retain unacknowledged messages in the subscription's backlog,
-     * from the moment a message is published.
-     * If `retain_acked_messages` is true, then this also configures the retention
-     * of acknowledged messages, and thus configures how far back in time a `Seek`
-     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-     * minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return The messageRetentionDuration. - */ - public com.google.protobuf.Duration getMessageRetentionDuration() { - if (messageRetentionDurationBuilder_ == null) { - return messageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : messageRetentionDuration_; - } else { - return messageRetentionDurationBuilder_.getMessage(); - } - } - /** - * - * - *
-     * How long to retain unacknowledged messages in the subscription's backlog,
-     * from the moment a message is published.
-     * If `retain_acked_messages` is true, then this also configures the retention
-     * of acknowledged messages, and thus configures how far back in time a `Seek`
-     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-     * minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public Builder setMessageRetentionDuration(com.google.protobuf.Duration value) { - if (messageRetentionDurationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - messageRetentionDuration_ = value; - } else { - messageRetentionDurationBuilder_.setMessage(value); - } - bitField0_ |= 0x00000080; - onChanged(); - return this; - } - /** - * - * - *
-     * How long to retain unacknowledged messages in the subscription's backlog,
-     * from the moment a message is published.
-     * If `retain_acked_messages` is true, then this also configures the retention
-     * of acknowledged messages, and thus configures how far back in time a `Seek`
-     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-     * minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public Builder setMessageRetentionDuration( - com.google.protobuf.Duration.Builder builderForValue) { - if (messageRetentionDurationBuilder_ == null) { - messageRetentionDuration_ = builderForValue.build(); - } else { - messageRetentionDurationBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000080; - onChanged(); - return this; - } - /** - * - * - *
-     * How long to retain unacknowledged messages in the subscription's backlog,
-     * from the moment a message is published.
-     * If `retain_acked_messages` is true, then this also configures the retention
-     * of acknowledged messages, and thus configures how far back in time a `Seek`
-     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-     * minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public Builder mergeMessageRetentionDuration(com.google.protobuf.Duration value) { - if (messageRetentionDurationBuilder_ == null) { - if (((bitField0_ & 0x00000080) != 0) - && messageRetentionDuration_ != null - && messageRetentionDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { - getMessageRetentionDurationBuilder().mergeFrom(value); - } else { - messageRetentionDuration_ = value; - } - } else { - messageRetentionDurationBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000080; - onChanged(); - return this; - } - /** - * - * - *
-     * How long to retain unacknowledged messages in the subscription's backlog,
-     * from the moment a message is published.
-     * If `retain_acked_messages` is true, then this also configures the retention
-     * of acknowledged messages, and thus configures how far back in time a `Seek`
-     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-     * minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public Builder clearMessageRetentionDuration() { - bitField0_ = (bitField0_ & ~0x00000080); - messageRetentionDuration_ = null; - if (messageRetentionDurationBuilder_ != null) { - messageRetentionDurationBuilder_.dispose(); - messageRetentionDurationBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * How long to retain unacknowledged messages in the subscription's backlog,
-     * from the moment a message is published.
-     * If `retain_acked_messages` is true, then this also configures the retention
-     * of acknowledged messages, and thus configures how far back in time a `Seek`
-     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-     * minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public com.google.protobuf.Duration.Builder getMessageRetentionDurationBuilder() { - bitField0_ |= 0x00000080; - onChanged(); - return getMessageRetentionDurationFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * How long to retain unacknowledged messages in the subscription's backlog,
-     * from the moment a message is published.
-     * If `retain_acked_messages` is true, then this also configures the retention
-     * of acknowledged messages, and thus configures how far back in time a `Seek`
-     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-     * minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public com.google.protobuf.DurationOrBuilder getMessageRetentionDurationOrBuilder() { - if (messageRetentionDurationBuilder_ != null) { - return messageRetentionDurationBuilder_.getMessageOrBuilder(); - } else { - return messageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : messageRetentionDuration_; - } - } - /** - * - * - *
-     * How long to retain unacknowledged messages in the subscription's backlog,
-     * from the moment a message is published.
-     * If `retain_acked_messages` is true, then this also configures the retention
-     * of acknowledged messages, and thus configures how far back in time a `Seek`
-     * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-     * minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getMessageRetentionDurationFieldBuilder() { - if (messageRetentionDurationBuilder_ == null) { - messageRetentionDurationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getMessageRetentionDuration(), getParentForChildren(), isClean()); - messageRetentionDuration_ = null; - } - return messageRetentionDurationBuilder_; - } - - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - private com.google.protobuf.MapField - internalGetMutableLabels() { - if (labels_ == null) { - labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - } - if (!labels_.isMutable()) { - labels_ = labels_.copy(); - } - bitField0_ |= 0x00000100; - onChanged(); - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 9; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 9; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 9; - */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 9; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearLabels() { - bitField0_ = (bitField0_ & ~0x00000100); - internalGetMutableLabels().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 9; - */ - public Builder removeLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableLabels().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableLabels() { - bitField0_ |= 0x00000100; - return internalGetMutableLabels().getMutableMap(); - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 9; - */ - public Builder putLabels(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new NullPointerException("map key"); - } - if (value == null) { - throw new NullPointerException("map value"); - } - internalGetMutableLabels().getMutableMap().put(key, value); - bitField0_ |= 0x00000100; - return this; - } - /** - * - * - *
-     * See [Creating and managing
-     * labels](https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 9; - */ - public Builder putAllLabels(java.util.Map values) { - internalGetMutableLabels().getMutableMap().putAll(values); - bitField0_ |= 0x00000100; - return this; - } - - private boolean enableMessageOrdering_; - /** - * - * - *
-     * If true, messages published with the same `ordering_key` in `PubsubMessage`
-     * will be delivered to the subscribers in the order in which they
-     * are received by the Pub/Sub system. Otherwise, they may be delivered in
-     * any order.
-     * 
- * - * bool enable_message_ordering = 10; - * - * @return The enableMessageOrdering. - */ - @java.lang.Override - public boolean getEnableMessageOrdering() { - return enableMessageOrdering_; - } - /** - * - * - *
-     * If true, messages published with the same `ordering_key` in `PubsubMessage`
-     * will be delivered to the subscribers in the order in which they
-     * are received by the Pub/Sub system. Otherwise, they may be delivered in
-     * any order.
-     * 
- * - * bool enable_message_ordering = 10; - * - * @param value The enableMessageOrdering to set. - * @return This builder for chaining. - */ - public Builder setEnableMessageOrdering(boolean value) { - - enableMessageOrdering_ = value; - bitField0_ |= 0x00000200; - onChanged(); - return this; - } - /** - * - * - *
-     * If true, messages published with the same `ordering_key` in `PubsubMessage`
-     * will be delivered to the subscribers in the order in which they
-     * are received by the Pub/Sub system. Otherwise, they may be delivered in
-     * any order.
-     * 
- * - * bool enable_message_ordering = 10; - * - * @return This builder for chaining. - */ - public Builder clearEnableMessageOrdering() { - bitField0_ = (bitField0_ & ~0x00000200); - enableMessageOrdering_ = false; - onChanged(); - return this; - } - - private com.google.pubsub.v1.ExpirationPolicy expirationPolicy_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.ExpirationPolicy, - com.google.pubsub.v1.ExpirationPolicy.Builder, - com.google.pubsub.v1.ExpirationPolicyOrBuilder> - expirationPolicyBuilder_; - /** - * - * - *
-     * A policy that specifies the conditions for this subscription's expiration.
-     * A subscription is considered active as long as any connected subscriber is
-     * successfully consuming messages from the subscription or is issuing
-     * operations on the subscription. If `expiration_policy` is not set, a
-     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-     * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-     * but `expiration_policy.ttl` is not set, the subscription never expires.
-     * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - * - * @return Whether the expirationPolicy field is set. - */ - public boolean hasExpirationPolicy() { - return ((bitField0_ & 0x00000400) != 0); - } - /** - * - * - *
-     * A policy that specifies the conditions for this subscription's expiration.
-     * A subscription is considered active as long as any connected subscriber is
-     * successfully consuming messages from the subscription or is issuing
-     * operations on the subscription. If `expiration_policy` is not set, a
-     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-     * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-     * but `expiration_policy.ttl` is not set, the subscription never expires.
-     * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - * - * @return The expirationPolicy. - */ - public com.google.pubsub.v1.ExpirationPolicy getExpirationPolicy() { - if (expirationPolicyBuilder_ == null) { - return expirationPolicy_ == null - ? com.google.pubsub.v1.ExpirationPolicy.getDefaultInstance() - : expirationPolicy_; - } else { - return expirationPolicyBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A policy that specifies the conditions for this subscription's expiration.
-     * A subscription is considered active as long as any connected subscriber is
-     * successfully consuming messages from the subscription or is issuing
-     * operations on the subscription. If `expiration_policy` is not set, a
-     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-     * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-     * but `expiration_policy.ttl` is not set, the subscription never expires.
-     * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - */ - public Builder setExpirationPolicy(com.google.pubsub.v1.ExpirationPolicy value) { - if (expirationPolicyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - expirationPolicy_ = value; - } else { - expirationPolicyBuilder_.setMessage(value); - } - bitField0_ |= 0x00000400; - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies the conditions for this subscription's expiration.
-     * A subscription is considered active as long as any connected subscriber is
-     * successfully consuming messages from the subscription or is issuing
-     * operations on the subscription. If `expiration_policy` is not set, a
-     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-     * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-     * but `expiration_policy.ttl` is not set, the subscription never expires.
-     * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - */ - public Builder setExpirationPolicy( - com.google.pubsub.v1.ExpirationPolicy.Builder builderForValue) { - if (expirationPolicyBuilder_ == null) { - expirationPolicy_ = builderForValue.build(); - } else { - expirationPolicyBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000400; - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies the conditions for this subscription's expiration.
-     * A subscription is considered active as long as any connected subscriber is
-     * successfully consuming messages from the subscription or is issuing
-     * operations on the subscription. If `expiration_policy` is not set, a
-     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-     * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-     * but `expiration_policy.ttl` is not set, the subscription never expires.
-     * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - */ - public Builder mergeExpirationPolicy(com.google.pubsub.v1.ExpirationPolicy value) { - if (expirationPolicyBuilder_ == null) { - if (((bitField0_ & 0x00000400) != 0) - && expirationPolicy_ != null - && expirationPolicy_ != com.google.pubsub.v1.ExpirationPolicy.getDefaultInstance()) { - getExpirationPolicyBuilder().mergeFrom(value); - } else { - expirationPolicy_ = value; - } - } else { - expirationPolicyBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000400; - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies the conditions for this subscription's expiration.
-     * A subscription is considered active as long as any connected subscriber is
-     * successfully consuming messages from the subscription or is issuing
-     * operations on the subscription. If `expiration_policy` is not set, a
-     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-     * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-     * but `expiration_policy.ttl` is not set, the subscription never expires.
-     * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - */ - public Builder clearExpirationPolicy() { - bitField0_ = (bitField0_ & ~0x00000400); - expirationPolicy_ = null; - if (expirationPolicyBuilder_ != null) { - expirationPolicyBuilder_.dispose(); - expirationPolicyBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies the conditions for this subscription's expiration.
-     * A subscription is considered active as long as any connected subscriber is
-     * successfully consuming messages from the subscription or is issuing
-     * operations on the subscription. If `expiration_policy` is not set, a
-     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-     * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-     * but `expiration_policy.ttl` is not set, the subscription never expires.
-     * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - */ - public com.google.pubsub.v1.ExpirationPolicy.Builder getExpirationPolicyBuilder() { - bitField0_ |= 0x00000400; - onChanged(); - return getExpirationPolicyFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A policy that specifies the conditions for this subscription's expiration.
-     * A subscription is considered active as long as any connected subscriber is
-     * successfully consuming messages from the subscription or is issuing
-     * operations on the subscription. If `expiration_policy` is not set, a
-     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-     * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-     * but `expiration_policy.ttl` is not set, the subscription never expires.
-     * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - */ - public com.google.pubsub.v1.ExpirationPolicyOrBuilder getExpirationPolicyOrBuilder() { - if (expirationPolicyBuilder_ != null) { - return expirationPolicyBuilder_.getMessageOrBuilder(); - } else { - return expirationPolicy_ == null - ? com.google.pubsub.v1.ExpirationPolicy.getDefaultInstance() - : expirationPolicy_; - } - } - /** - * - * - *
-     * A policy that specifies the conditions for this subscription's expiration.
-     * A subscription is considered active as long as any connected subscriber is
-     * successfully consuming messages from the subscription or is issuing
-     * operations on the subscription. If `expiration_policy` is not set, a
-     * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-     * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-     * but `expiration_policy.ttl` is not set, the subscription never expires.
-     * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.ExpirationPolicy, - com.google.pubsub.v1.ExpirationPolicy.Builder, - com.google.pubsub.v1.ExpirationPolicyOrBuilder> - getExpirationPolicyFieldBuilder() { - if (expirationPolicyBuilder_ == null) { - expirationPolicyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.ExpirationPolicy, - com.google.pubsub.v1.ExpirationPolicy.Builder, - com.google.pubsub.v1.ExpirationPolicyOrBuilder>( - getExpirationPolicy(), getParentForChildren(), isClean()); - expirationPolicy_ = null; - } - return expirationPolicyBuilder_; - } - - private java.lang.Object filter_ = ""; - /** - * - * - *
-     * An expression written in the Pub/Sub [filter
-     * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
-     * then only `PubsubMessage`s whose `attributes` field matches the filter are
-     * delivered on this subscription. If empty, then no messages are filtered
-     * out.
-     * 
- * - * string filter = 12; - * - * @return The filter. - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * An expression written in the Pub/Sub [filter
-     * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
-     * then only `PubsubMessage`s whose `attributes` field matches the filter are
-     * delivered on this subscription. If empty, then no messages are filtered
-     * out.
-     * 
- * - * string filter = 12; - * - * @return The bytes for filter. - */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * An expression written in the Pub/Sub [filter
-     * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
-     * then only `PubsubMessage`s whose `attributes` field matches the filter are
-     * delivered on this subscription. If empty, then no messages are filtered
-     * out.
-     * 
- * - * string filter = 12; - * - * @param value The filter to set. - * @return This builder for chaining. - */ - public Builder setFilter(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - filter_ = value; - bitField0_ |= 0x00000800; - onChanged(); - return this; - } - /** - * - * - *
-     * An expression written in the Pub/Sub [filter
-     * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
-     * then only `PubsubMessage`s whose `attributes` field matches the filter are
-     * delivered on this subscription. If empty, then no messages are filtered
-     * out.
-     * 
- * - * string filter = 12; - * - * @return This builder for chaining. - */ - public Builder clearFilter() { - filter_ = getDefaultInstance().getFilter(); - bitField0_ = (bitField0_ & ~0x00000800); - onChanged(); - return this; - } - /** - * - * - *
-     * An expression written in the Pub/Sub [filter
-     * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
-     * then only `PubsubMessage`s whose `attributes` field matches the filter are
-     * delivered on this subscription. If empty, then no messages are filtered
-     * out.
-     * 
- * - * string filter = 12; - * - * @param value The bytes for filter to set. - * @return This builder for chaining. - */ - public Builder setFilterBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - filter_ = value; - bitField0_ |= 0x00000800; - onChanged(); - return this; - } - - private com.google.pubsub.v1.DeadLetterPolicy deadLetterPolicy_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.DeadLetterPolicy, - com.google.pubsub.v1.DeadLetterPolicy.Builder, - com.google.pubsub.v1.DeadLetterPolicyOrBuilder> - deadLetterPolicyBuilder_; - /** - * - * - *
-     * A policy that specifies the conditions for dead lettering messages in
-     * this subscription. If dead_letter_policy is not set, dead lettering
-     * is disabled.
-     *
-     * The Cloud Pub/Sub service account associated with this subscriptions's
-     * parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Acknowledge() messages on this subscription.
-     * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - * - * @return Whether the deadLetterPolicy field is set. - */ - public boolean hasDeadLetterPolicy() { - return ((bitField0_ & 0x00001000) != 0); - } - /** - * - * - *
-     * A policy that specifies the conditions for dead lettering messages in
-     * this subscription. If dead_letter_policy is not set, dead lettering
-     * is disabled.
-     *
-     * The Cloud Pub/Sub service account associated with this subscriptions's
-     * parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Acknowledge() messages on this subscription.
-     * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - * - * @return The deadLetterPolicy. - */ - public com.google.pubsub.v1.DeadLetterPolicy getDeadLetterPolicy() { - if (deadLetterPolicyBuilder_ == null) { - return deadLetterPolicy_ == null - ? com.google.pubsub.v1.DeadLetterPolicy.getDefaultInstance() - : deadLetterPolicy_; - } else { - return deadLetterPolicyBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A policy that specifies the conditions for dead lettering messages in
-     * this subscription. If dead_letter_policy is not set, dead lettering
-     * is disabled.
-     *
-     * The Cloud Pub/Sub service account associated with this subscriptions's
-     * parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Acknowledge() messages on this subscription.
-     * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - */ - public Builder setDeadLetterPolicy(com.google.pubsub.v1.DeadLetterPolicy value) { - if (deadLetterPolicyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deadLetterPolicy_ = value; - } else { - deadLetterPolicyBuilder_.setMessage(value); - } - bitField0_ |= 0x00001000; - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies the conditions for dead lettering messages in
-     * this subscription. If dead_letter_policy is not set, dead lettering
-     * is disabled.
-     *
-     * The Cloud Pub/Sub service account associated with this subscriptions's
-     * parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Acknowledge() messages on this subscription.
-     * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - */ - public Builder setDeadLetterPolicy( - com.google.pubsub.v1.DeadLetterPolicy.Builder builderForValue) { - if (deadLetterPolicyBuilder_ == null) { - deadLetterPolicy_ = builderForValue.build(); - } else { - deadLetterPolicyBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00001000; - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies the conditions for dead lettering messages in
-     * this subscription. If dead_letter_policy is not set, dead lettering
-     * is disabled.
-     *
-     * The Cloud Pub/Sub service account associated with this subscriptions's
-     * parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Acknowledge() messages on this subscription.
-     * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - */ - public Builder mergeDeadLetterPolicy(com.google.pubsub.v1.DeadLetterPolicy value) { - if (deadLetterPolicyBuilder_ == null) { - if (((bitField0_ & 0x00001000) != 0) - && deadLetterPolicy_ != null - && deadLetterPolicy_ != com.google.pubsub.v1.DeadLetterPolicy.getDefaultInstance()) { - getDeadLetterPolicyBuilder().mergeFrom(value); - } else { - deadLetterPolicy_ = value; - } - } else { - deadLetterPolicyBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00001000; - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies the conditions for dead lettering messages in
-     * this subscription. If dead_letter_policy is not set, dead lettering
-     * is disabled.
-     *
-     * The Cloud Pub/Sub service account associated with this subscriptions's
-     * parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Acknowledge() messages on this subscription.
-     * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - */ - public Builder clearDeadLetterPolicy() { - bitField0_ = (bitField0_ & ~0x00001000); - deadLetterPolicy_ = null; - if (deadLetterPolicyBuilder_ != null) { - deadLetterPolicyBuilder_.dispose(); - deadLetterPolicyBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies the conditions for dead lettering messages in
-     * this subscription. If dead_letter_policy is not set, dead lettering
-     * is disabled.
-     *
-     * The Cloud Pub/Sub service account associated with this subscriptions's
-     * parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Acknowledge() messages on this subscription.
-     * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - */ - public com.google.pubsub.v1.DeadLetterPolicy.Builder getDeadLetterPolicyBuilder() { - bitField0_ |= 0x00001000; - onChanged(); - return getDeadLetterPolicyFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A policy that specifies the conditions for dead lettering messages in
-     * this subscription. If dead_letter_policy is not set, dead lettering
-     * is disabled.
-     *
-     * The Cloud Pub/Sub service account associated with this subscriptions's
-     * parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Acknowledge() messages on this subscription.
-     * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - */ - public com.google.pubsub.v1.DeadLetterPolicyOrBuilder getDeadLetterPolicyOrBuilder() { - if (deadLetterPolicyBuilder_ != null) { - return deadLetterPolicyBuilder_.getMessageOrBuilder(); - } else { - return deadLetterPolicy_ == null - ? com.google.pubsub.v1.DeadLetterPolicy.getDefaultInstance() - : deadLetterPolicy_; - } - } - /** - * - * - *
-     * A policy that specifies the conditions for dead lettering messages in
-     * this subscription. If dead_letter_policy is not set, dead lettering
-     * is disabled.
-     *
-     * The Cloud Pub/Sub service account associated with this subscriptions's
-     * parent project (i.e.,
-     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-     * permission to Acknowledge() messages on this subscription.
-     * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.DeadLetterPolicy, - com.google.pubsub.v1.DeadLetterPolicy.Builder, - com.google.pubsub.v1.DeadLetterPolicyOrBuilder> - getDeadLetterPolicyFieldBuilder() { - if (deadLetterPolicyBuilder_ == null) { - deadLetterPolicyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.DeadLetterPolicy, - com.google.pubsub.v1.DeadLetterPolicy.Builder, - com.google.pubsub.v1.DeadLetterPolicyOrBuilder>( - getDeadLetterPolicy(), getParentForChildren(), isClean()); - deadLetterPolicy_ = null; - } - return deadLetterPolicyBuilder_; - } - - private com.google.pubsub.v1.RetryPolicy retryPolicy_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.RetryPolicy, - com.google.pubsub.v1.RetryPolicy.Builder, - com.google.pubsub.v1.RetryPolicyOrBuilder> - retryPolicyBuilder_; - /** - * - * - *
-     * A policy that specifies how Pub/Sub retries message delivery for this
-     * subscription.
-     *
-     * If not set, the default retry policy is applied. This generally implies
-     * that messages will be retried as soon as possible for healthy subscribers.
-     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-     * exceeded events for a given message.
-     * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - * - * @return Whether the retryPolicy field is set. - */ - public boolean hasRetryPolicy() { - return ((bitField0_ & 0x00002000) != 0); - } - /** - * - * - *
-     * A policy that specifies how Pub/Sub retries message delivery for this
-     * subscription.
-     *
-     * If not set, the default retry policy is applied. This generally implies
-     * that messages will be retried as soon as possible for healthy subscribers.
-     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-     * exceeded events for a given message.
-     * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - * - * @return The retryPolicy. - */ - public com.google.pubsub.v1.RetryPolicy getRetryPolicy() { - if (retryPolicyBuilder_ == null) { - return retryPolicy_ == null - ? com.google.pubsub.v1.RetryPolicy.getDefaultInstance() - : retryPolicy_; - } else { - return retryPolicyBuilder_.getMessage(); - } - } - /** - * - * - *
-     * A policy that specifies how Pub/Sub retries message delivery for this
-     * subscription.
-     *
-     * If not set, the default retry policy is applied. This generally implies
-     * that messages will be retried as soon as possible for healthy subscribers.
-     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-     * exceeded events for a given message.
-     * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - */ - public Builder setRetryPolicy(com.google.pubsub.v1.RetryPolicy value) { - if (retryPolicyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - retryPolicy_ = value; - } else { - retryPolicyBuilder_.setMessage(value); - } - bitField0_ |= 0x00002000; - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies how Pub/Sub retries message delivery for this
-     * subscription.
-     *
-     * If not set, the default retry policy is applied. This generally implies
-     * that messages will be retried as soon as possible for healthy subscribers.
-     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-     * exceeded events for a given message.
-     * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - */ - public Builder setRetryPolicy(com.google.pubsub.v1.RetryPolicy.Builder builderForValue) { - if (retryPolicyBuilder_ == null) { - retryPolicy_ = builderForValue.build(); - } else { - retryPolicyBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00002000; - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies how Pub/Sub retries message delivery for this
-     * subscription.
-     *
-     * If not set, the default retry policy is applied. This generally implies
-     * that messages will be retried as soon as possible for healthy subscribers.
-     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-     * exceeded events for a given message.
-     * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - */ - public Builder mergeRetryPolicy(com.google.pubsub.v1.RetryPolicy value) { - if (retryPolicyBuilder_ == null) { - if (((bitField0_ & 0x00002000) != 0) - && retryPolicy_ != null - && retryPolicy_ != com.google.pubsub.v1.RetryPolicy.getDefaultInstance()) { - getRetryPolicyBuilder().mergeFrom(value); - } else { - retryPolicy_ = value; - } - } else { - retryPolicyBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00002000; - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies how Pub/Sub retries message delivery for this
-     * subscription.
-     *
-     * If not set, the default retry policy is applied. This generally implies
-     * that messages will be retried as soon as possible for healthy subscribers.
-     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-     * exceeded events for a given message.
-     * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - */ - public Builder clearRetryPolicy() { - bitField0_ = (bitField0_ & ~0x00002000); - retryPolicy_ = null; - if (retryPolicyBuilder_ != null) { - retryPolicyBuilder_.dispose(); - retryPolicyBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * A policy that specifies how Pub/Sub retries message delivery for this
-     * subscription.
-     *
-     * If not set, the default retry policy is applied. This generally implies
-     * that messages will be retried as soon as possible for healthy subscribers.
-     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-     * exceeded events for a given message.
-     * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - */ - public com.google.pubsub.v1.RetryPolicy.Builder getRetryPolicyBuilder() { - bitField0_ |= 0x00002000; - onChanged(); - return getRetryPolicyFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * A policy that specifies how Pub/Sub retries message delivery for this
-     * subscription.
-     *
-     * If not set, the default retry policy is applied. This generally implies
-     * that messages will be retried as soon as possible for healthy subscribers.
-     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-     * exceeded events for a given message.
-     * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - */ - public com.google.pubsub.v1.RetryPolicyOrBuilder getRetryPolicyOrBuilder() { - if (retryPolicyBuilder_ != null) { - return retryPolicyBuilder_.getMessageOrBuilder(); - } else { - return retryPolicy_ == null - ? com.google.pubsub.v1.RetryPolicy.getDefaultInstance() - : retryPolicy_; - } - } - /** - * - * - *
-     * A policy that specifies how Pub/Sub retries message delivery for this
-     * subscription.
-     *
-     * If not set, the default retry policy is applied. This generally implies
-     * that messages will be retried as soon as possible for healthy subscribers.
-     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-     * exceeded events for a given message.
-     * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.RetryPolicy, - com.google.pubsub.v1.RetryPolicy.Builder, - com.google.pubsub.v1.RetryPolicyOrBuilder> - getRetryPolicyFieldBuilder() { - if (retryPolicyBuilder_ == null) { - retryPolicyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.RetryPolicy, - com.google.pubsub.v1.RetryPolicy.Builder, - com.google.pubsub.v1.RetryPolicyOrBuilder>( - getRetryPolicy(), getParentForChildren(), isClean()); - retryPolicy_ = null; - } - return retryPolicyBuilder_; - } - - private boolean detached_; - /** - * - * - *
-     * Indicates whether the subscription is detached from its topic. Detached
-     * subscriptions don't receive messages from their topic and don't retain any
-     * backlog. `Pull` and `StreamingPull` requests will return
-     * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
-     * the endpoint will not be made.
-     * 
- * - * bool detached = 15; - * - * @return The detached. - */ - @java.lang.Override - public boolean getDetached() { - return detached_; - } - /** - * - * - *
-     * Indicates whether the subscription is detached from its topic. Detached
-     * subscriptions don't receive messages from their topic and don't retain any
-     * backlog. `Pull` and `StreamingPull` requests will return
-     * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
-     * the endpoint will not be made.
-     * 
- * - * bool detached = 15; - * - * @param value The detached to set. - * @return This builder for chaining. - */ - public Builder setDetached(boolean value) { - - detached_ = value; - bitField0_ |= 0x00004000; - onChanged(); - return this; - } - /** - * - * - *
-     * Indicates whether the subscription is detached from its topic. Detached
-     * subscriptions don't receive messages from their topic and don't retain any
-     * backlog. `Pull` and `StreamingPull` requests will return
-     * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
-     * the endpoint will not be made.
-     * 
- * - * bool detached = 15; - * - * @return This builder for chaining. - */ - public Builder clearDetached() { - bitField0_ = (bitField0_ & ~0x00004000); - detached_ = false; - onChanged(); - return this; - } - - private boolean enableExactlyOnceDelivery_; - /** - * - * - *
-     * If true, Pub/Sub provides the following guarantees for the delivery of
-     * a message with a given value of `message_id` on this subscription:
-     *
-     * * The message sent to a subscriber is guaranteed not to be resent
-     * before the message's acknowledgement deadline expires.
-     * * An acknowledged message will not be resent to a subscriber.
-     *
-     * Note that subscribers may still receive multiple copies of a message
-     * when `enable_exactly_once_delivery` is true if the message was published
-     * multiple times by a publisher client. These copies are  considered distinct
-     * by Pub/Sub and have distinct `message_id` values.
-     * 
- * - * bool enable_exactly_once_delivery = 16; - * - * @return The enableExactlyOnceDelivery. - */ - @java.lang.Override - public boolean getEnableExactlyOnceDelivery() { - return enableExactlyOnceDelivery_; - } - /** - * - * - *
-     * If true, Pub/Sub provides the following guarantees for the delivery of
-     * a message with a given value of `message_id` on this subscription:
-     *
-     * * The message sent to a subscriber is guaranteed not to be resent
-     * before the message's acknowledgement deadline expires.
-     * * An acknowledged message will not be resent to a subscriber.
-     *
-     * Note that subscribers may still receive multiple copies of a message
-     * when `enable_exactly_once_delivery` is true if the message was published
-     * multiple times by a publisher client. These copies are  considered distinct
-     * by Pub/Sub and have distinct `message_id` values.
-     * 
- * - * bool enable_exactly_once_delivery = 16; - * - * @param value The enableExactlyOnceDelivery to set. - * @return This builder for chaining. - */ - public Builder setEnableExactlyOnceDelivery(boolean value) { - - enableExactlyOnceDelivery_ = value; - bitField0_ |= 0x00008000; - onChanged(); - return this; - } - /** - * - * - *
-     * If true, Pub/Sub provides the following guarantees for the delivery of
-     * a message with a given value of `message_id` on this subscription:
-     *
-     * * The message sent to a subscriber is guaranteed not to be resent
-     * before the message's acknowledgement deadline expires.
-     * * An acknowledged message will not be resent to a subscriber.
-     *
-     * Note that subscribers may still receive multiple copies of a message
-     * when `enable_exactly_once_delivery` is true if the message was published
-     * multiple times by a publisher client. These copies are  considered distinct
-     * by Pub/Sub and have distinct `message_id` values.
-     * 
- * - * bool enable_exactly_once_delivery = 16; - * - * @return This builder for chaining. - */ - public Builder clearEnableExactlyOnceDelivery() { - bitField0_ = (bitField0_ & ~0x00008000); - enableExactlyOnceDelivery_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.Duration topicMessageRetentionDuration_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - topicMessageRetentionDurationBuilder_; - /** - * - * - *
-     * Output only. Indicates the minimum duration for which a message is retained
-     * after it is published to the subscription's topic. If this field is set,
-     * messages published to the subscription's topic in the last
-     * `topic_message_retention_duration` are always available to subscribers. See
-     * the `message_retention_duration` field in `Topic`. This field is set only
-     * in responses from the server; it is ignored if it is set in any requests.
-     * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the topicMessageRetentionDuration field is set. - */ - public boolean hasTopicMessageRetentionDuration() { - return ((bitField0_ & 0x00010000) != 0); - } - /** - * - * - *
-     * Output only. Indicates the minimum duration for which a message is retained
-     * after it is published to the subscription's topic. If this field is set,
-     * messages published to the subscription's topic in the last
-     * `topic_message_retention_duration` are always available to subscribers. See
-     * the `message_retention_duration` field in `Topic`. This field is set only
-     * in responses from the server; it is ignored if it is set in any requests.
-     * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The topicMessageRetentionDuration. - */ - public com.google.protobuf.Duration getTopicMessageRetentionDuration() { - if (topicMessageRetentionDurationBuilder_ == null) { - return topicMessageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : topicMessageRetentionDuration_; - } else { - return topicMessageRetentionDurationBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. Indicates the minimum duration for which a message is retained
-     * after it is published to the subscription's topic. If this field is set,
-     * messages published to the subscription's topic in the last
-     * `topic_message_retention_duration` are always available to subscribers. See
-     * the `message_retention_duration` field in `Topic`. This field is set only
-     * in responses from the server; it is ignored if it is set in any requests.
-     * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setTopicMessageRetentionDuration(com.google.protobuf.Duration value) { - if (topicMessageRetentionDurationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - topicMessageRetentionDuration_ = value; - } else { - topicMessageRetentionDurationBuilder_.setMessage(value); - } - bitField0_ |= 0x00010000; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Indicates the minimum duration for which a message is retained
-     * after it is published to the subscription's topic. If this field is set,
-     * messages published to the subscription's topic in the last
-     * `topic_message_retention_duration` are always available to subscribers. See
-     * the `message_retention_duration` field in `Topic`. This field is set only
-     * in responses from the server; it is ignored if it is set in any requests.
-     * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setTopicMessageRetentionDuration( - com.google.protobuf.Duration.Builder builderForValue) { - if (topicMessageRetentionDurationBuilder_ == null) { - topicMessageRetentionDuration_ = builderForValue.build(); - } else { - topicMessageRetentionDurationBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00010000; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Indicates the minimum duration for which a message is retained
-     * after it is published to the subscription's topic. If this field is set,
-     * messages published to the subscription's topic in the last
-     * `topic_message_retention_duration` are always available to subscribers. See
-     * the `message_retention_duration` field in `Topic`. This field is set only
-     * in responses from the server; it is ignored if it is set in any requests.
-     * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeTopicMessageRetentionDuration(com.google.protobuf.Duration value) { - if (topicMessageRetentionDurationBuilder_ == null) { - if (((bitField0_ & 0x00010000) != 0) - && topicMessageRetentionDuration_ != null - && topicMessageRetentionDuration_ - != com.google.protobuf.Duration.getDefaultInstance()) { - getTopicMessageRetentionDurationBuilder().mergeFrom(value); - } else { - topicMessageRetentionDuration_ = value; - } - } else { - topicMessageRetentionDurationBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00010000; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Indicates the minimum duration for which a message is retained
-     * after it is published to the subscription's topic. If this field is set,
-     * messages published to the subscription's topic in the last
-     * `topic_message_retention_duration` are always available to subscribers. See
-     * the `message_retention_duration` field in `Topic`. This field is set only
-     * in responses from the server; it is ignored if it is set in any requests.
-     * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearTopicMessageRetentionDuration() { - bitField0_ = (bitField0_ & ~0x00010000); - topicMessageRetentionDuration_ = null; - if (topicMessageRetentionDurationBuilder_ != null) { - topicMessageRetentionDurationBuilder_.dispose(); - topicMessageRetentionDurationBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Indicates the minimum duration for which a message is retained
-     * after it is published to the subscription's topic. If this field is set,
-     * messages published to the subscription's topic in the last
-     * `topic_message_retention_duration` are always available to subscribers. See
-     * the `message_retention_duration` field in `Topic`. This field is set only
-     * in responses from the server; it is ignored if it is set in any requests.
-     * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Duration.Builder getTopicMessageRetentionDurationBuilder() { - bitField0_ |= 0x00010000; - onChanged(); - return getTopicMessageRetentionDurationFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. Indicates the minimum duration for which a message is retained
-     * after it is published to the subscription's topic. If this field is set,
-     * messages published to the subscription's topic in the last
-     * `topic_message_retention_duration` are always available to subscribers. See
-     * the `message_retention_duration` field in `Topic`. This field is set only
-     * in responses from the server; it is ignored if it is set in any requests.
-     * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.DurationOrBuilder getTopicMessageRetentionDurationOrBuilder() { - if (topicMessageRetentionDurationBuilder_ != null) { - return topicMessageRetentionDurationBuilder_.getMessageOrBuilder(); - } else { - return topicMessageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : topicMessageRetentionDuration_; - } - } - /** - * - * - *
-     * Output only. Indicates the minimum duration for which a message is retained
-     * after it is published to the subscription's topic. If this field is set,
-     * messages published to the subscription's topic in the last
-     * `topic_message_retention_duration` are always available to subscribers. See
-     * the `message_retention_duration` field in `Topic`. This field is set only
-     * in responses from the server; it is ignored if it is set in any requests.
-     * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getTopicMessageRetentionDurationFieldBuilder() { - if (topicMessageRetentionDurationBuilder_ == null) { - topicMessageRetentionDurationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getTopicMessageRetentionDuration(), getParentForChildren(), isClean()); - topicMessageRetentionDuration_ = null; - } - return topicMessageRetentionDurationBuilder_; - } - - private int state_ = 0; - /** - * - * - *
-     * Output only. An output-only field indicating whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for state. - */ - @java.lang.Override - public int getStateValue() { - return state_; - } - /** - * - * - *
-     * Output only. An output-only field indicating whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The enum numeric value on the wire for state to set. - * @return This builder for chaining. - */ - public Builder setStateValue(int value) { - state_ = value; - bitField0_ |= 0x00020000; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. An output-only field indicating whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The state. - */ - @java.lang.Override - public com.google.pubsub.v1.Subscription.State getState() { - com.google.pubsub.v1.Subscription.State result = - com.google.pubsub.v1.Subscription.State.forNumber(state_); - return result == null ? com.google.pubsub.v1.Subscription.State.UNRECOGNIZED : result; - } - /** - * - * - *
-     * Output only. An output-only field indicating whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The state to set. - * @return This builder for chaining. - */ - public Builder setState(com.google.pubsub.v1.Subscription.State value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00020000; - state_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. An output-only field indicating whether or not the
-     * subscription can receive messages.
-     * 
- * - * - * .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return This builder for chaining. - */ - public Builder clearState() { - bitField0_ = (bitField0_ & ~0x00020000); - state_ = 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.Subscription) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.Subscription) - private static final com.google.pubsub.v1.Subscription DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.Subscription(); - } - - public static com.google.pubsub.v1.Subscription getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Subscription parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.Subscription getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionName.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionName.java deleted file mode 100644 index ad49b90dd..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionName.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright 2023 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; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class SubscriptionName implements ResourceName { - private static final PathTemplate PROJECT_SUBSCRIPTION = - PathTemplate.createWithoutUrlEncoding("projects/{project}/subscriptions/{subscription}"); - private volatile Map fieldValuesMap; - private final String project; - private final String subscription; - - @Deprecated - protected SubscriptionName() { - project = null; - subscription = null; - } - - private SubscriptionName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - subscription = Preconditions.checkNotNull(builder.getSubscription()); - } - - public String getProject() { - return project; - } - - public String getSubscription() { - return subscription; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SubscriptionName of(String project, String subscription) { - return newBuilder().setProject(project).setSubscription(subscription).build(); - } - - public static String format(String project, String subscription) { - return newBuilder().setProject(project).setSubscription(subscription).build().toString(); - } - - public static SubscriptionName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_SUBSCRIPTION.validatedMatch( - formattedString, "SubscriptionName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("subscription")); - } - - 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 (SubscriptionName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_SUBSCRIPTION.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (subscription != null) { - fieldMapBuilder.put("subscription", subscription); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_SUBSCRIPTION.instantiate("project", project, "subscription", subscription); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null && getClass() == o.getClass()) { - SubscriptionName that = ((SubscriptionName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.subscription, that.subscription); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(subscription); - return h; - } - - /** Builder for projects/{project}/subscriptions/{subscription}. */ - public static class Builder { - private String project; - private String subscription; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getSubscription() { - return subscription; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setSubscription(String subscription) { - this.subscription = subscription; - return this; - } - - private Builder(SubscriptionName subscriptionName) { - this.project = subscriptionName.project; - this.subscription = subscriptionName.subscription; - } - - public SubscriptionName build() { - return new SubscriptionName(this); - } - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java deleted file mode 100644 index c6b27d213..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java +++ /dev/null @@ -1,708 +0,0 @@ -/* - * Copyright 2023 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 SubscriptionOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.Subscription) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the subscription. It must have the format
-   * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
-   * start with a letter, and contain only letters (`[A-Za-z]`), numbers
-   * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
-   * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
-   * in length, and it must not start with `"goog"`.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. The name of the subscription. It must have the format
-   * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
-   * start with a letter, and contain only letters (`[A-Za-z]`), numbers
-   * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
-   * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
-   * in length, and it must not start with `"goog"`.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Required. The name of the topic from which this subscription is receiving
-   * messages. Format is `projects/{project}/topics/{topic}`. The value of this
-   * field will be `_deleted-topic_` if the topic has been deleted.
-   * 
- * - * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The topic. - */ - java.lang.String getTopic(); - /** - * - * - *
-   * Required. The name of the topic from which this subscription is receiving
-   * messages. Format is `projects/{project}/topics/{topic}`. The value of this
-   * field will be `_deleted-topic_` if the topic has been deleted.
-   * 
- * - * - * string topic = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for topic. - */ - com.google.protobuf.ByteString getTopicBytes(); - - /** - * - * - *
-   * If push delivery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - * - * @return Whether the pushConfig field is set. - */ - boolean hasPushConfig(); - /** - * - * - *
-   * If push delivery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - * - * @return The pushConfig. - */ - com.google.pubsub.v1.PushConfig getPushConfig(); - /** - * - * - *
-   * If push delivery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.PushConfig push_config = 4; - */ - com.google.pubsub.v1.PushConfigOrBuilder getPushConfigOrBuilder(); - - /** - * - * - *
-   * If delivery to BigQuery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - * - * @return Whether the bigqueryConfig field is set. - */ - boolean hasBigqueryConfig(); - /** - * - * - *
-   * If delivery to BigQuery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - * - * @return The bigqueryConfig. - */ - com.google.pubsub.v1.BigQueryConfig getBigqueryConfig(); - /** - * - * - *
-   * If delivery to BigQuery is used with this subscription, this field is
-   * used to configure it.
-   * 
- * - * .google.pubsub.v1.BigQueryConfig bigquery_config = 18; - */ - com.google.pubsub.v1.BigQueryConfigOrBuilder getBigqueryConfigOrBuilder(); - - /** - * - * - *
-   * If delivery to Google Cloud Storage is used with this subscription, this
-   * field is used to configure it.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - * - * @return Whether the cloudStorageConfig field is set. - */ - boolean hasCloudStorageConfig(); - /** - * - * - *
-   * If delivery to Google Cloud Storage is used with this subscription, this
-   * field is used to configure it.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - * - * @return The cloudStorageConfig. - */ - com.google.pubsub.v1.CloudStorageConfig getCloudStorageConfig(); - /** - * - * - *
-   * If delivery to Google Cloud Storage is used with this subscription, this
-   * field is used to configure it.
-   * 
- * - * .google.pubsub.v1.CloudStorageConfig cloud_storage_config = 22; - */ - com.google.pubsub.v1.CloudStorageConfigOrBuilder getCloudStorageConfigOrBuilder(); - - /** - * - * - *
-   * The approximate amount of time (on a best-effort basis) Pub/Sub waits for
-   * the subscriber to acknowledge receipt before resending the message. In the
-   * interval after the message is delivered and before it is acknowledged, it
-   * is considered to be _outstanding_. During that time period, the
-   * message will not be redelivered (on a best-effort basis).
-   *
-   * For pull subscriptions, this value is used as the initial value for the ack
-   * deadline. To override this value for a given message, call
-   * `ModifyAckDeadline` with the corresponding `ack_id` if using
-   * non-streaming pull or send the `ack_id` in a
-   * `StreamingModifyAckDeadlineRequest` if using streaming pull.
-   * The minimum custom deadline you can specify is 10 seconds.
-   * The maximum custom deadline you can specify is 600 seconds (10 minutes).
-   * If this parameter is 0, a default value of 10 seconds is used.
-   *
-   * For push delivery, this value is also used to set the request timeout for
-   * the call to the push endpoint.
-   *
-   * If the subscriber never acknowledges the message, the Pub/Sub
-   * system will eventually redeliver the message.
-   * 
- * - * int32 ack_deadline_seconds = 5; - * - * @return The ackDeadlineSeconds. - */ - int getAckDeadlineSeconds(); - - /** - * - * - *
-   * Indicates whether to retain acknowledged messages. If true, then
-   * messages are not expunged from the subscription's backlog, even if they are
-   * acknowledged, until they fall out of the `message_retention_duration`
-   * window. This must be true if you would like to [`Seek` to a timestamp]
-   * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
-   * the past to replay previously-acknowledged messages.
-   * 
- * - * bool retain_acked_messages = 7; - * - * @return The retainAckedMessages. - */ - boolean getRetainAckedMessages(); - - /** - * - * - *
-   * How long to retain unacknowledged messages in the subscription's backlog,
-   * from the moment a message is published.
-   * If `retain_acked_messages` is true, then this also configures the retention
-   * of acknowledged messages, and thus configures how far back in time a `Seek`
-   * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-   * minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return Whether the messageRetentionDuration field is set. - */ - boolean hasMessageRetentionDuration(); - /** - * - * - *
-   * How long to retain unacknowledged messages in the subscription's backlog,
-   * from the moment a message is published.
-   * If `retain_acked_messages` is true, then this also configures the retention
-   * of acknowledged messages, and thus configures how far back in time a `Seek`
-   * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-   * minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return The messageRetentionDuration. - */ - com.google.protobuf.Duration getMessageRetentionDuration(); - /** - * - * - *
-   * How long to retain unacknowledged messages in the subscription's backlog,
-   * from the moment a message is published.
-   * If `retain_acked_messages` is true, then this also configures the retention
-   * of acknowledged messages, and thus configures how far back in time a `Seek`
-   * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
-   * minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - com.google.protobuf.DurationOrBuilder getMessageRetentionDurationOrBuilder(); - - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 9; - */ - int getLabelsCount(); - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 9; - */ - boolean containsLabels(java.lang.String key); - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Deprecated - java.util.Map getLabels(); - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 9; - */ - java.util.Map getLabelsMap(); - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 9; - */ - /* nullable */ - java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue); - /** - * - * - *
-   * See [Creating and managing
-   * labels](https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 9; - */ - java.lang.String getLabelsOrThrow(java.lang.String key); - - /** - * - * - *
-   * If true, messages published with the same `ordering_key` in `PubsubMessage`
-   * will be delivered to the subscribers in the order in which they
-   * are received by the Pub/Sub system. Otherwise, they may be delivered in
-   * any order.
-   * 
- * - * bool enable_message_ordering = 10; - * - * @return The enableMessageOrdering. - */ - boolean getEnableMessageOrdering(); - - /** - * - * - *
-   * A policy that specifies the conditions for this subscription's expiration.
-   * A subscription is considered active as long as any connected subscriber is
-   * successfully consuming messages from the subscription or is issuing
-   * operations on the subscription. If `expiration_policy` is not set, a
-   * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-   * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-   * but `expiration_policy.ttl` is not set, the subscription never expires.
-   * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - * - * @return Whether the expirationPolicy field is set. - */ - boolean hasExpirationPolicy(); - /** - * - * - *
-   * A policy that specifies the conditions for this subscription's expiration.
-   * A subscription is considered active as long as any connected subscriber is
-   * successfully consuming messages from the subscription or is issuing
-   * operations on the subscription. If `expiration_policy` is not set, a
-   * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-   * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-   * but `expiration_policy.ttl` is not set, the subscription never expires.
-   * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - * - * @return The expirationPolicy. - */ - com.google.pubsub.v1.ExpirationPolicy getExpirationPolicy(); - /** - * - * - *
-   * A policy that specifies the conditions for this subscription's expiration.
-   * A subscription is considered active as long as any connected subscriber is
-   * successfully consuming messages from the subscription or is issuing
-   * operations on the subscription. If `expiration_policy` is not set, a
-   * *default policy* with `ttl` of 31 days will be used. The minimum allowed
-   * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
-   * but `expiration_policy.ttl` is not set, the subscription never expires.
-   * 
- * - * .google.pubsub.v1.ExpirationPolicy expiration_policy = 11; - */ - com.google.pubsub.v1.ExpirationPolicyOrBuilder getExpirationPolicyOrBuilder(); - - /** - * - * - *
-   * An expression written in the Pub/Sub [filter
-   * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
-   * then only `PubsubMessage`s whose `attributes` field matches the filter are
-   * delivered on this subscription. If empty, then no messages are filtered
-   * out.
-   * 
- * - * string filter = 12; - * - * @return The filter. - */ - java.lang.String getFilter(); - /** - * - * - *
-   * An expression written in the Pub/Sub [filter
-   * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
-   * then only `PubsubMessage`s whose `attributes` field matches the filter are
-   * delivered on this subscription. If empty, then no messages are filtered
-   * out.
-   * 
- * - * string filter = 12; - * - * @return The bytes for filter. - */ - com.google.protobuf.ByteString getFilterBytes(); - - /** - * - * - *
-   * A policy that specifies the conditions for dead lettering messages in
-   * this subscription. If dead_letter_policy is not set, dead lettering
-   * is disabled.
-   *
-   * The Cloud Pub/Sub service account associated with this subscriptions's
-   * parent project (i.e.,
-   * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-   * permission to Acknowledge() messages on this subscription.
-   * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - * - * @return Whether the deadLetterPolicy field is set. - */ - boolean hasDeadLetterPolicy(); - /** - * - * - *
-   * A policy that specifies the conditions for dead lettering messages in
-   * this subscription. If dead_letter_policy is not set, dead lettering
-   * is disabled.
-   *
-   * The Cloud Pub/Sub service account associated with this subscriptions's
-   * parent project (i.e.,
-   * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-   * permission to Acknowledge() messages on this subscription.
-   * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - * - * @return The deadLetterPolicy. - */ - com.google.pubsub.v1.DeadLetterPolicy getDeadLetterPolicy(); - /** - * - * - *
-   * A policy that specifies the conditions for dead lettering messages in
-   * this subscription. If dead_letter_policy is not set, dead lettering
-   * is disabled.
-   *
-   * The Cloud Pub/Sub service account associated with this subscriptions's
-   * parent project (i.e.,
-   * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
-   * permission to Acknowledge() messages on this subscription.
-   * 
- * - * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; - */ - com.google.pubsub.v1.DeadLetterPolicyOrBuilder getDeadLetterPolicyOrBuilder(); - - /** - * - * - *
-   * A policy that specifies how Pub/Sub retries message delivery for this
-   * subscription.
-   *
-   * If not set, the default retry policy is applied. This generally implies
-   * that messages will be retried as soon as possible for healthy subscribers.
-   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-   * exceeded events for a given message.
-   * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - * - * @return Whether the retryPolicy field is set. - */ - boolean hasRetryPolicy(); - /** - * - * - *
-   * A policy that specifies how Pub/Sub retries message delivery for this
-   * subscription.
-   *
-   * If not set, the default retry policy is applied. This generally implies
-   * that messages will be retried as soon as possible for healthy subscribers.
-   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-   * exceeded events for a given message.
-   * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - * - * @return The retryPolicy. - */ - com.google.pubsub.v1.RetryPolicy getRetryPolicy(); - /** - * - * - *
-   * A policy that specifies how Pub/Sub retries message delivery for this
-   * subscription.
-   *
-   * If not set, the default retry policy is applied. This generally implies
-   * that messages will be retried as soon as possible for healthy subscribers.
-   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
-   * exceeded events for a given message.
-   * 
- * - * .google.pubsub.v1.RetryPolicy retry_policy = 14; - */ - com.google.pubsub.v1.RetryPolicyOrBuilder getRetryPolicyOrBuilder(); - - /** - * - * - *
-   * Indicates whether the subscription is detached from its topic. Detached
-   * subscriptions don't receive messages from their topic and don't retain any
-   * backlog. `Pull` and `StreamingPull` requests will return
-   * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
-   * the endpoint will not be made.
-   * 
- * - * bool detached = 15; - * - * @return The detached. - */ - boolean getDetached(); - - /** - * - * - *
-   * If true, Pub/Sub provides the following guarantees for the delivery of
-   * a message with a given value of `message_id` on this subscription:
-   *
-   * * The message sent to a subscriber is guaranteed not to be resent
-   * before the message's acknowledgement deadline expires.
-   * * An acknowledged message will not be resent to a subscriber.
-   *
-   * Note that subscribers may still receive multiple copies of a message
-   * when `enable_exactly_once_delivery` is true if the message was published
-   * multiple times by a publisher client. These copies are  considered distinct
-   * by Pub/Sub and have distinct `message_id` values.
-   * 
- * - * bool enable_exactly_once_delivery = 16; - * - * @return The enableExactlyOnceDelivery. - */ - boolean getEnableExactlyOnceDelivery(); - - /** - * - * - *
-   * Output only. Indicates the minimum duration for which a message is retained
-   * after it is published to the subscription's topic. If this field is set,
-   * messages published to the subscription's topic in the last
-   * `topic_message_retention_duration` are always available to subscribers. See
-   * the `message_retention_duration` field in `Topic`. This field is set only
-   * in responses from the server; it is ignored if it is set in any requests.
-   * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the topicMessageRetentionDuration field is set. - */ - boolean hasTopicMessageRetentionDuration(); - /** - * - * - *
-   * Output only. Indicates the minimum duration for which a message is retained
-   * after it is published to the subscription's topic. If this field is set,
-   * messages published to the subscription's topic in the last
-   * `topic_message_retention_duration` are always available to subscribers. See
-   * the `message_retention_duration` field in `Topic`. This field is set only
-   * in responses from the server; it is ignored if it is set in any requests.
-   * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The topicMessageRetentionDuration. - */ - com.google.protobuf.Duration getTopicMessageRetentionDuration(); - /** - * - * - *
-   * Output only. Indicates the minimum duration for which a message is retained
-   * after it is published to the subscription's topic. If this field is set,
-   * messages published to the subscription's topic in the last
-   * `topic_message_retention_duration` are always available to subscribers. See
-   * the `message_retention_duration` field in `Topic`. This field is set only
-   * in responses from the server; it is ignored if it is set in any requests.
-   * 
- * - * - * .google.protobuf.Duration topic_message_retention_duration = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.DurationOrBuilder getTopicMessageRetentionDurationOrBuilder(); - - /** - * - * - *
-   * Output only. An output-only field indicating whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for state. - */ - int getStateValue(); - /** - * - * - *
-   * Output only. An output-only field indicating whether or not the
-   * subscription can receive messages.
-   * 
- * - * - * .google.pubsub.v1.Subscription.State state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The state. - */ - com.google.pubsub.v1.Subscription.State getState(); -} 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 deleted file mode 100644 index 40ee471a5..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Topic.java +++ /dev/null @@ -1,2208 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * A topic resource.
- * 
- * - * Protobuf type {@code google.pubsub.v1.Topic} - */ -public final class Topic extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.Topic) - TopicOrBuilder { - private static final long serialVersionUID = 0L; - // Use Topic.newBuilder() to construct. - private Topic(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Topic() { - name_ = ""; - kmsKeyName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Topic(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Topic_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Topic_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.Topic.class, com.google.pubsub.v1.Topic.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * Required. The name of the topic. It must have the format
-   * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
-   * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
-   * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
-   * signs (`%`). It must be between 3 and 255 characters in length, and it
-   * must not start with `"goog"`.
-   * 
- * - * 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. The name of the topic. It must have the format
-   * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
-   * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
-   * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
-   * signs (`%`). It must be between 3 and 255 characters in length, and it
-   * must not start with `"goog"`.
-   * 
- * - * 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 LABELS_FIELD_NUMBER = 2; - - private static final class LabelsDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Topic_LabelsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - @SuppressWarnings("serial") - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 2; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 2; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 2; - */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 2; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int MESSAGE_STORAGE_POLICY_FIELD_NUMBER = 3; - private com.google.pubsub.v1.MessageStoragePolicy messageStoragePolicy_; - /** - * - * - *
-   * Policy constraining the set of Google Cloud Platform regions where messages
-   * published to the topic may be stored. If not present, then no constraints
-   * are in effect.
-   * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - * - * @return Whether the messageStoragePolicy field is set. - */ - @java.lang.Override - public boolean hasMessageStoragePolicy() { - return messageStoragePolicy_ != null; - } - /** - * - * - *
-   * Policy constraining the set of Google Cloud Platform regions where messages
-   * published to the topic may be stored. If not present, then no constraints
-   * are in effect.
-   * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - * - * @return The messageStoragePolicy. - */ - @java.lang.Override - public com.google.pubsub.v1.MessageStoragePolicy getMessageStoragePolicy() { - return messageStoragePolicy_ == null - ? com.google.pubsub.v1.MessageStoragePolicy.getDefaultInstance() - : messageStoragePolicy_; - } - /** - * - * - *
-   * Policy constraining the set of Google Cloud Platform regions where messages
-   * published to the topic may be stored. If not present, then no constraints
-   * are in effect.
-   * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - */ - @java.lang.Override - public com.google.pubsub.v1.MessageStoragePolicyOrBuilder getMessageStoragePolicyOrBuilder() { - return messageStoragePolicy_ == null - ? com.google.pubsub.v1.MessageStoragePolicy.getDefaultInstance() - : messageStoragePolicy_; - } - - public static final int KMS_KEY_NAME_FIELD_NUMBER = 5; - - @SuppressWarnings("serial") - private volatile java.lang.Object kmsKeyName_ = ""; - /** - * - * - *
-   * The resource name of the Cloud KMS CryptoKey to be used to protect access
-   * to messages published on this topic.
-   *
-   * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
-   * 
- * - * string kms_key_name = 5; - * - * @return The kmsKeyName. - */ - @java.lang.Override - public java.lang.String getKmsKeyName() { - java.lang.Object ref = kmsKeyName_; - 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(); - kmsKeyName_ = s; - return s; - } - } - /** - * - * - *
-   * The resource name of the Cloud KMS CryptoKey to be used to protect access
-   * to messages published on this topic.
-   *
-   * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
-   * 
- * - * string kms_key_name = 5; - * - * @return The bytes for kmsKeyName. - */ - @java.lang.Override - public com.google.protobuf.ByteString getKmsKeyNameBytes() { - java.lang.Object ref = kmsKeyName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - kmsKeyName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SCHEMA_SETTINGS_FIELD_NUMBER = 6; - private com.google.pubsub.v1.SchemaSettings schemaSettings_; - /** - * - * - *
-   * Settings for validating messages published against a schema.
-   * 
- * - * .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.
-   * 
- * - * .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.
-   * 
- * - * .google.pubsub.v1.SchemaSettings schema_settings = 6; - */ - @java.lang.Override - public com.google.pubsub.v1.SchemaSettingsOrBuilder getSchemaSettingsOrBuilder() { - return schemaSettings_ == null - ? com.google.pubsub.v1.SchemaSettings.getDefaultInstance() - : schemaSettings_; - } - - public static final int SATISFIES_PZS_FIELD_NUMBER = 7; - private boolean satisfiesPzs_ = false; - /** - * - * - *
-   * 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_; - } - - public static final int MESSAGE_RETENTION_DURATION_FIELD_NUMBER = 8; - private com.google.protobuf.Duration messageRetentionDuration_; - /** - * - * - *
-   * Indicates the minimum duration to retain a message after it is published to
-   * the topic. If this field is set, messages published to the topic in the
-   * last `message_retention_duration` are always available to subscribers. For
-   * instance, it allows any attached subscription to [seek to a
-   * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-   * that is up to `message_retention_duration` in the past. If this field is
-   * not set, message retention is controlled by settings on individual
-   * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return Whether the messageRetentionDuration field is set. - */ - @java.lang.Override - public boolean hasMessageRetentionDuration() { - return messageRetentionDuration_ != null; - } - /** - * - * - *
-   * Indicates the minimum duration to retain a message after it is published to
-   * the topic. If this field is set, messages published to the topic in the
-   * last `message_retention_duration` are always available to subscribers. For
-   * instance, it allows any attached subscription to [seek to a
-   * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-   * that is up to `message_retention_duration` in the past. If this field is
-   * not set, message retention is controlled by settings on individual
-   * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return The messageRetentionDuration. - */ - @java.lang.Override - public com.google.protobuf.Duration getMessageRetentionDuration() { - return messageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : messageRetentionDuration_; - } - /** - * - * - *
-   * Indicates the minimum duration to retain a message after it is published to
-   * the topic. If this field is set, messages published to the topic in the
-   * last `message_retention_duration` are always available to subscribers. For
-   * instance, it allows any attached subscription to [seek to a
-   * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-   * that is up to `message_retention_duration` in the past. If this field is
-   * not set, message retention is controlled by settings on individual
-   * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getMessageRetentionDurationOrBuilder() { - return messageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : messageRetentionDuration_; - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2); - if (messageStoragePolicy_ != null) { - output.writeMessage(3, getMessageStoragePolicy()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, kmsKeyName_); - } - if (schemaSettings_ != null) { - output.writeMessage(6, getSchemaSettings()); - } - if (satisfiesPzs_ != false) { - output.writeBool(7, satisfiesPzs_); - } - if (messageRetentionDuration_ != null) { - output.writeMessage(8, getMessageRetentionDuration()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - for (java.util.Map.Entry entry : - internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry labels__ = - LabelsDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels__); - } - if (messageStoragePolicy_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMessageStoragePolicy()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { - 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_); - } - if (messageRetentionDuration_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 8, getMessageRetentionDuration()); - } - size += getUnknownFields().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.Topic)) { - return super.equals(obj); - } - com.google.pubsub.v1.Topic other = (com.google.pubsub.v1.Topic) obj; - - if (!getName().equals(other.getName())) return false; - if (!internalGetLabels().equals(other.internalGetLabels())) return false; - if (hasMessageStoragePolicy() != other.hasMessageStoragePolicy()) return false; - if (hasMessageStoragePolicy()) { - 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 (hasMessageRetentionDuration() != other.hasMessageRetentionDuration()) return false; - if (hasMessageRetentionDuration()) { - if (!getMessageRetentionDuration().equals(other.getMessageRetentionDuration())) return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) 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(); - if (!internalGetLabels().getMap().isEmpty()) { - hash = (37 * hash) + LABELS_FIELD_NUMBER; - hash = (53 * hash) + internalGetLabels().hashCode(); - } - if (hasMessageStoragePolicy()) { - hash = (37 * hash) + MESSAGE_STORAGE_POLICY_FIELD_NUMBER; - hash = (53 * hash) + getMessageStoragePolicy().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()); - if (hasMessageRetentionDuration()) { - hash = (37 * hash) + MESSAGE_RETENTION_DURATION_FIELD_NUMBER; - hash = (53 * hash) + getMessageRetentionDuration().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.Topic parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.Topic 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.Topic parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.Topic 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.Topic parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.Topic parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.Topic parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.Topic 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.Topic parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.Topic 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.Topic parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.Topic 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.Topic 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 topic resource.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.Topic} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.Topic) - com.google.pubsub.v1.TopicOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Topic_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 2: - return internalGetMutableLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_Topic_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.Topic.class, com.google.pubsub.v1.Topic.Builder.class); - } - - // Construct using com.google.pubsub.v1.Topic.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - internalGetMutableLabels().clear(); - messageStoragePolicy_ = null; - if (messageStoragePolicyBuilder_ != null) { - messageStoragePolicyBuilder_.dispose(); - messageStoragePolicyBuilder_ = null; - } - kmsKeyName_ = ""; - schemaSettings_ = null; - if (schemaSettingsBuilder_ != null) { - schemaSettingsBuilder_.dispose(); - schemaSettingsBuilder_ = null; - } - satisfiesPzs_ = false; - messageRetentionDuration_ = null; - if (messageRetentionDurationBuilder_ != null) { - messageRetentionDurationBuilder_.dispose(); - messageRetentionDurationBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_Topic_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.Topic getDefaultInstanceForType() { - return com.google.pubsub.v1.Topic.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.Topic build() { - com.google.pubsub.v1.Topic result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.Topic buildPartial() { - com.google.pubsub.v1.Topic result = new com.google.pubsub.v1.Topic(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.Topic result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.messageStoragePolicy_ = - messageStoragePolicyBuilder_ == null - ? messageStoragePolicy_ - : messageStoragePolicyBuilder_.build(); - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.kmsKeyName_ = kmsKeyName_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.schemaSettings_ = - schemaSettingsBuilder_ == null ? schemaSettings_ : schemaSettingsBuilder_.build(); - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.satisfiesPzs_ = satisfiesPzs_; - } - if (((from_bitField0_ & 0x00000040) != 0)) { - result.messageRetentionDuration_ = - messageRetentionDurationBuilder_ == null - ? messageRetentionDuration_ - : messageRetentionDurationBuilder_.build(); - } - } - - @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.Topic) { - return mergeFrom((com.google.pubsub.v1.Topic) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.Topic other) { - if (other == com.google.pubsub.v1.Topic.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - internalGetMutableLabels().mergeFrom(other.internalGetLabels()); - bitField0_ |= 0x00000002; - if (other.hasMessageStoragePolicy()) { - mergeMessageStoragePolicy(other.getMessageStoragePolicy()); - } - if (!other.getKmsKeyName().isEmpty()) { - kmsKeyName_ = other.kmsKeyName_; - bitField0_ |= 0x00000008; - onChanged(); - } - if (other.hasSchemaSettings()) { - mergeSchemaSettings(other.getSchemaSettings()); - } - if (other.getSatisfiesPzs() != false) { - setSatisfiesPzs(other.getSatisfiesPzs()); - } - if (other.hasMessageRetentionDuration()) { - mergeMessageRetentionDuration(other.getMessageRetentionDuration()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - com.google.protobuf.MapEntry labels__ = - input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableLabels() - .getMutableMap() - .put(labels__.getKey(), labels__.getValue()); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - input.readMessage( - getMessageStoragePolicyFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 42: - { - kmsKeyName_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; - break; - } // case 42 - case 50: - { - input.readMessage(getSchemaSettingsFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000010; - break; - } // case 50 - case 56: - { - satisfiesPzs_ = input.readBool(); - bitField0_ |= 0x00000020; - break; - } // case 56 - case 66: - { - input.readMessage( - getMessageRetentionDurationFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; - break; - } // case 66 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. The name of the topic. It must have the format
-     * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
-     * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
-     * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
-     * signs (`%`). It must be between 3 and 255 characters in length, and it
-     * must not start with `"goog"`.
-     * 
- * - * 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. The name of the topic. It must have the format
-     * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
-     * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
-     * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
-     * signs (`%`). It must be between 3 and 255 characters in length, and it
-     * must not start with `"goog"`.
-     * 
- * - * 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. The name of the topic. It must have the format
-     * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
-     * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
-     * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
-     * signs (`%`). It must be between 3 and 255 characters in length, and it
-     * must not start with `"goog"`.
-     * 
- * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the topic. It must have the format
-     * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
-     * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
-     * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
-     * signs (`%`). It must be between 3 and 255 characters in length, and it
-     * must not start with `"goog"`.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The name of the topic. It must have the format
-     * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
-     * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
-     * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
-     * signs (`%`). It must be between 3 and 255 characters in length, and it
-     * must not start with `"goog"`.
-     * 
- * - * 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; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - private com.google.protobuf.MapField - internalGetMutableLabels() { - if (labels_ == null) { - labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - } - if (!labels_.isMutable()) { - labels_ = labels_.copy(); - } - bitField0_ |= 0x00000002; - onChanged(); - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 2; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 2; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 2; - */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 2; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearLabels() { - bitField0_ = (bitField0_ & ~0x00000002); - internalGetMutableLabels().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 2; - */ - public Builder removeLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableLabels().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableLabels() { - bitField0_ |= 0x00000002; - return internalGetMutableLabels().getMutableMap(); - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 2; - */ - public Builder putLabels(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new NullPointerException("map key"); - } - if (value == null) { - throw new NullPointerException("map value"); - } - internalGetMutableLabels().getMutableMap().put(key, value); - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-     * See [Creating and managing labels]
-     * (https://cloud.google.com/pubsub/docs/labels).
-     * 
- * - * map<string, string> labels = 2; - */ - public Builder putAllLabels(java.util.Map values) { - internalGetMutableLabels().getMutableMap().putAll(values); - bitField0_ |= 0x00000002; - return this; - } - - private com.google.pubsub.v1.MessageStoragePolicy messageStoragePolicy_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.MessageStoragePolicy, - com.google.pubsub.v1.MessageStoragePolicy.Builder, - com.google.pubsub.v1.MessageStoragePolicyOrBuilder> - messageStoragePolicyBuilder_; - /** - * - * - *
-     * Policy constraining the set of Google Cloud Platform regions where messages
-     * published to the topic may be stored. If not present, then no constraints
-     * are in effect.
-     * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - * - * @return Whether the messageStoragePolicy field is set. - */ - public boolean hasMessageStoragePolicy() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * Policy constraining the set of Google Cloud Platform regions where messages
-     * published to the topic may be stored. If not present, then no constraints
-     * are in effect.
-     * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - * - * @return The messageStoragePolicy. - */ - public com.google.pubsub.v1.MessageStoragePolicy getMessageStoragePolicy() { - if (messageStoragePolicyBuilder_ == null) { - return messageStoragePolicy_ == null - ? com.google.pubsub.v1.MessageStoragePolicy.getDefaultInstance() - : messageStoragePolicy_; - } else { - return messageStoragePolicyBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Policy constraining the set of Google Cloud Platform regions where messages
-     * published to the topic may be stored. If not present, then no constraints
-     * are in effect.
-     * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - */ - public Builder setMessageStoragePolicy(com.google.pubsub.v1.MessageStoragePolicy value) { - if (messageStoragePolicyBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - messageStoragePolicy_ = value; - } else { - messageStoragePolicyBuilder_.setMessage(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * Policy constraining the set of Google Cloud Platform regions where messages
-     * published to the topic may be stored. If not present, then no constraints
-     * are in effect.
-     * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - */ - public Builder setMessageStoragePolicy( - com.google.pubsub.v1.MessageStoragePolicy.Builder builderForValue) { - if (messageStoragePolicyBuilder_ == null) { - messageStoragePolicy_ = builderForValue.build(); - } else { - messageStoragePolicyBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * Policy constraining the set of Google Cloud Platform regions where messages
-     * published to the topic may be stored. If not present, then no constraints
-     * are in effect.
-     * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - */ - public Builder mergeMessageStoragePolicy(com.google.pubsub.v1.MessageStoragePolicy value) { - if (messageStoragePolicyBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0) - && messageStoragePolicy_ != null - && messageStoragePolicy_ - != com.google.pubsub.v1.MessageStoragePolicy.getDefaultInstance()) { - getMessageStoragePolicyBuilder().mergeFrom(value); - } else { - messageStoragePolicy_ = value; - } - } else { - messageStoragePolicyBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * Policy constraining the set of Google Cloud Platform regions where messages
-     * published to the topic may be stored. If not present, then no constraints
-     * are in effect.
-     * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - */ - public Builder clearMessageStoragePolicy() { - bitField0_ = (bitField0_ & ~0x00000004); - messageStoragePolicy_ = null; - if (messageStoragePolicyBuilder_ != null) { - messageStoragePolicyBuilder_.dispose(); - messageStoragePolicyBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Policy constraining the set of Google Cloud Platform regions where messages
-     * published to the topic may be stored. If not present, then no constraints
-     * are in effect.
-     * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - */ - public com.google.pubsub.v1.MessageStoragePolicy.Builder getMessageStoragePolicyBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return getMessageStoragePolicyFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Policy constraining the set of Google Cloud Platform regions where messages
-     * published to the topic may be stored. If not present, then no constraints
-     * are in effect.
-     * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - */ - public com.google.pubsub.v1.MessageStoragePolicyOrBuilder getMessageStoragePolicyOrBuilder() { - if (messageStoragePolicyBuilder_ != null) { - return messageStoragePolicyBuilder_.getMessageOrBuilder(); - } else { - return messageStoragePolicy_ == null - ? com.google.pubsub.v1.MessageStoragePolicy.getDefaultInstance() - : messageStoragePolicy_; - } - } - /** - * - * - *
-     * Policy constraining the set of Google Cloud Platform regions where messages
-     * published to the topic may be stored. If not present, then no constraints
-     * are in effect.
-     * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.MessageStoragePolicy, - com.google.pubsub.v1.MessageStoragePolicy.Builder, - com.google.pubsub.v1.MessageStoragePolicyOrBuilder> - getMessageStoragePolicyFieldBuilder() { - if (messageStoragePolicyBuilder_ == null) { - messageStoragePolicyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.MessageStoragePolicy, - com.google.pubsub.v1.MessageStoragePolicy.Builder, - com.google.pubsub.v1.MessageStoragePolicyOrBuilder>( - getMessageStoragePolicy(), getParentForChildren(), isClean()); - messageStoragePolicy_ = null; - } - return messageStoragePolicyBuilder_; - } - - private java.lang.Object kmsKeyName_ = ""; - /** - * - * - *
-     * The resource name of the Cloud KMS CryptoKey to be used to protect access
-     * to messages published on this topic.
-     *
-     * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
-     * 
- * - * string kms_key_name = 5; - * - * @return The kmsKeyName. - */ - public java.lang.String getKmsKeyName() { - java.lang.Object ref = kmsKeyName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kmsKeyName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The resource name of the Cloud KMS CryptoKey to be used to protect access
-     * to messages published on this topic.
-     *
-     * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
-     * 
- * - * string kms_key_name = 5; - * - * @return The bytes for kmsKeyName. - */ - public com.google.protobuf.ByteString getKmsKeyNameBytes() { - java.lang.Object ref = kmsKeyName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - kmsKeyName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The resource name of the Cloud KMS CryptoKey to be used to protect access
-     * to messages published on this topic.
-     *
-     * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
-     * 
- * - * string kms_key_name = 5; - * - * @param value The kmsKeyName to set. - * @return This builder for chaining. - */ - public Builder setKmsKeyName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - kmsKeyName_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * The resource name of the Cloud KMS CryptoKey to be used to protect access
-     * to messages published on this topic.
-     *
-     * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
-     * 
- * - * string kms_key_name = 5; - * - * @return This builder for chaining. - */ - public Builder clearKmsKeyName() { - kmsKeyName_ = getDefaultInstance().getKmsKeyName(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - * - * - *
-     * The resource name of the Cloud KMS CryptoKey to be used to protect access
-     * to messages published on this topic.
-     *
-     * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
-     * 
- * - * string kms_key_name = 5; - * - * @param value The bytes for kmsKeyName to set. - * @return This builder for chaining. - */ - public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - kmsKeyName_ = value; - bitField0_ |= 0x00000008; - onChanged(); - 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.
-     * 
- * - * .google.pubsub.v1.SchemaSettings schema_settings = 6; - * - * @return Whether the schemaSettings field is set. - */ - public boolean hasSchemaSettings() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-     * Settings for validating messages published against a schema.
-     * 
- * - * .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.
-     * 
- * - * .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; - } else { - schemaSettingsBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Settings for validating messages published against a schema.
-     * 
- * - * .google.pubsub.v1.SchemaSettings schema_settings = 6; - */ - public Builder setSchemaSettings(com.google.pubsub.v1.SchemaSettings.Builder builderForValue) { - if (schemaSettingsBuilder_ == null) { - schemaSettings_ = builderForValue.build(); - } else { - schemaSettingsBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Settings for validating messages published against a schema.
-     * 
- * - * .google.pubsub.v1.SchemaSettings schema_settings = 6; - */ - public Builder mergeSchemaSettings(com.google.pubsub.v1.SchemaSettings value) { - if (schemaSettingsBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) - && schemaSettings_ != null - && schemaSettings_ != com.google.pubsub.v1.SchemaSettings.getDefaultInstance()) { - getSchemaSettingsBuilder().mergeFrom(value); - } else { - schemaSettings_ = value; - } - } else { - schemaSettingsBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Settings for validating messages published against a schema.
-     * 
- * - * .google.pubsub.v1.SchemaSettings schema_settings = 6; - */ - public Builder clearSchemaSettings() { - bitField0_ = (bitField0_ & ~0x00000010); - schemaSettings_ = null; - if (schemaSettingsBuilder_ != null) { - schemaSettingsBuilder_.dispose(); - schemaSettingsBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Settings for validating messages published against a schema.
-     * 
- * - * .google.pubsub.v1.SchemaSettings schema_settings = 6; - */ - public com.google.pubsub.v1.SchemaSettings.Builder getSchemaSettingsBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return getSchemaSettingsFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Settings for validating messages published against a schema.
-     * 
- * - * .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.
-     * 
- * - * .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; - bitField0_ |= 0x00000020; - 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() { - bitField0_ = (bitField0_ & ~0x00000020); - satisfiesPzs_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.Duration messageRetentionDuration_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - messageRetentionDurationBuilder_; - /** - * - * - *
-     * Indicates the minimum duration to retain a message after it is published to
-     * the topic. If this field is set, messages published to the topic in the
-     * last `message_retention_duration` are always available to subscribers. For
-     * instance, it allows any attached subscription to [seek to a
-     * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-     * that is up to `message_retention_duration` in the past. If this field is
-     * not set, message retention is controlled by settings on individual
-     * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return Whether the messageRetentionDuration field is set. - */ - public boolean hasMessageRetentionDuration() { - return ((bitField0_ & 0x00000040) != 0); - } - /** - * - * - *
-     * Indicates the minimum duration to retain a message after it is published to
-     * the topic. If this field is set, messages published to the topic in the
-     * last `message_retention_duration` are always available to subscribers. For
-     * instance, it allows any attached subscription to [seek to a
-     * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-     * that is up to `message_retention_duration` in the past. If this field is
-     * not set, message retention is controlled by settings on individual
-     * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return The messageRetentionDuration. - */ - public com.google.protobuf.Duration getMessageRetentionDuration() { - if (messageRetentionDurationBuilder_ == null) { - return messageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : messageRetentionDuration_; - } else { - return messageRetentionDurationBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Indicates the minimum duration to retain a message after it is published to
-     * the topic. If this field is set, messages published to the topic in the
-     * last `message_retention_duration` are always available to subscribers. For
-     * instance, it allows any attached subscription to [seek to a
-     * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-     * that is up to `message_retention_duration` in the past. If this field is
-     * not set, message retention is controlled by settings on individual
-     * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public Builder setMessageRetentionDuration(com.google.protobuf.Duration value) { - if (messageRetentionDurationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - messageRetentionDuration_ = value; - } else { - messageRetentionDurationBuilder_.setMessage(value); - } - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - /** - * - * - *
-     * Indicates the minimum duration to retain a message after it is published to
-     * the topic. If this field is set, messages published to the topic in the
-     * last `message_retention_duration` are always available to subscribers. For
-     * instance, it allows any attached subscription to [seek to a
-     * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-     * that is up to `message_retention_duration` in the past. If this field is
-     * not set, message retention is controlled by settings on individual
-     * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public Builder setMessageRetentionDuration( - com.google.protobuf.Duration.Builder builderForValue) { - if (messageRetentionDurationBuilder_ == null) { - messageRetentionDuration_ = builderForValue.build(); - } else { - messageRetentionDurationBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - /** - * - * - *
-     * Indicates the minimum duration to retain a message after it is published to
-     * the topic. If this field is set, messages published to the topic in the
-     * last `message_retention_duration` are always available to subscribers. For
-     * instance, it allows any attached subscription to [seek to a
-     * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-     * that is up to `message_retention_duration` in the past. If this field is
-     * not set, message retention is controlled by settings on individual
-     * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public Builder mergeMessageRetentionDuration(com.google.protobuf.Duration value) { - if (messageRetentionDurationBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) - && messageRetentionDuration_ != null - && messageRetentionDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { - getMessageRetentionDurationBuilder().mergeFrom(value); - } else { - messageRetentionDuration_ = value; - } - } else { - messageRetentionDurationBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - /** - * - * - *
-     * Indicates the minimum duration to retain a message after it is published to
-     * the topic. If this field is set, messages published to the topic in the
-     * last `message_retention_duration` are always available to subscribers. For
-     * instance, it allows any attached subscription to [seek to a
-     * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-     * that is up to `message_retention_duration` in the past. If this field is
-     * not set, message retention is controlled by settings on individual
-     * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public Builder clearMessageRetentionDuration() { - bitField0_ = (bitField0_ & ~0x00000040); - messageRetentionDuration_ = null; - if (messageRetentionDurationBuilder_ != null) { - messageRetentionDurationBuilder_.dispose(); - messageRetentionDurationBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Indicates the minimum duration to retain a message after it is published to
-     * the topic. If this field is set, messages published to the topic in the
-     * last `message_retention_duration` are always available to subscribers. For
-     * instance, it allows any attached subscription to [seek to a
-     * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-     * that is up to `message_retention_duration` in the past. If this field is
-     * not set, message retention is controlled by settings on individual
-     * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public com.google.protobuf.Duration.Builder getMessageRetentionDurationBuilder() { - bitField0_ |= 0x00000040; - onChanged(); - return getMessageRetentionDurationFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Indicates the minimum duration to retain a message after it is published to
-     * the topic. If this field is set, messages published to the topic in the
-     * last `message_retention_duration` are always available to subscribers. For
-     * instance, it allows any attached subscription to [seek to a
-     * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-     * that is up to `message_retention_duration` in the past. If this field is
-     * not set, message retention is controlled by settings on individual
-     * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - public com.google.protobuf.DurationOrBuilder getMessageRetentionDurationOrBuilder() { - if (messageRetentionDurationBuilder_ != null) { - return messageRetentionDurationBuilder_.getMessageOrBuilder(); - } else { - return messageRetentionDuration_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : messageRetentionDuration_; - } - } - /** - * - * - *
-     * Indicates the minimum duration to retain a message after it is published to
-     * the topic. If this field is set, messages published to the topic in the
-     * last `message_retention_duration` are always available to subscribers. For
-     * instance, it allows any attached subscription to [seek to a
-     * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-     * that is up to `message_retention_duration` in the past. If this field is
-     * not set, message retention is controlled by settings on individual
-     * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-     * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getMessageRetentionDurationFieldBuilder() { - if (messageRetentionDurationBuilder_ == null) { - messageRetentionDurationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getMessageRetentionDuration(), getParentForChildren(), isClean()); - messageRetentionDuration_ = null; - } - return messageRetentionDurationBuilder_; - } - - @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.Topic) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.Topic) - private static final com.google.pubsub.v1.Topic DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.Topic(); - } - - public static com.google.pubsub.v1.Topic getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Topic parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.Topic getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicName.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicName.java deleted file mode 100644 index 6fc356a2b..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicName.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright 2023 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.core.BetaApi; -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.pathtemplate.ValidationException; -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; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class TopicName implements ResourceName { - private static final PathTemplate PROJECT_TOPIC = - PathTemplate.createWithoutUrlEncoding("projects/{project}/topics/{topic}"); - private static final String DELETED_TOPIC = "_deleted-topic_"; - private volatile Map fieldValuesMap; - private PathTemplate pathTemplate; - private String fixedValue; - private final String project; - private final String topic; - - @Deprecated - protected TopicName() { - project = null; - topic = null; - } - - private TopicName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - topic = Preconditions.checkNotNull(builder.getTopic()); - pathTemplate = PROJECT_TOPIC; - } - - private TopicName(String fixedValue) { - this.fixedValue = fixedValue; - fieldValuesMap = ImmutableMap.of("", fixedValue); - project = null; - topic = null; - } - - public String getProject() { - return project; - } - - public String getTopic() { - return topic; - } - - public static Builder newBuilder() { - return new Builder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static Builder newProjectTopicBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static TopicName of(String project, String topic) { - return newBuilder().setProject(project).setTopic(topic).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static TopicName ofProjectTopicName(String project, String topic) { - return newBuilder().setProject(project).setTopic(topic).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static TopicName ofDeletedTopicName() { - return new TopicName("_deleted-topic_"); - } - - public static String format(String project, String topic) { - return newBuilder().setProject(project).setTopic(topic).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatProjectTopicName(String project, String topic) { - return newBuilder().setProject(project).setTopic(topic).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatDeletedTopicName() { - return "_deleted-topic_"; - } - - public static TopicName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - if (PROJECT_TOPIC.matches(formattedString)) { - Map matchMap = PROJECT_TOPIC.match(formattedString); - return ofProjectTopicName(matchMap.get("project"), matchMap.get("topic")); - } else if (DELETED_TOPIC.equals(formattedString)) { - return new TopicName("_deleted-topic_"); - } - throw new ValidationException("TopicName.parse: formattedString not in valid format"); - } - - 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 (TopicName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_TOPIC.matches(formattedString) || DELETED_TOPIC.equals(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (topic != null) { - fieldMapBuilder.put("topic", topic); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null && getClass() == o.getClass()) { - TopicName that = ((TopicName) o); - return Objects.equals(this.project, that.project) && Objects.equals(this.topic, that.topic); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(topic); - return h; - } - - /** Builder for projects/{project}/topics/{topic}. */ - public static class Builder { - private String project; - private String topic; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getTopic() { - return topic; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setTopic(String topic) { - this.topic = topic; - return this; - } - - private Builder(TopicName topicName) { - Preconditions.checkArgument( - Objects.equals(topicName.pathTemplate, PROJECT_TOPIC), - "toBuilder is only supported when TopicName has the pattern of projects/{project}/topics/{topic}"); - this.project = topicName.project; - this.topic = topicName.topic; - } - - public TopicName build() { - return new TopicName(this); - } - } -} 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 deleted file mode 100644 index 6c8637285..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicOrBuilder.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright 2023 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 TopicOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.Topic) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The name of the topic. It must have the format
-   * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
-   * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
-   * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
-   * signs (`%`). It must be between 3 and 255 characters in length, and it
-   * must not start with `"goog"`.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. The name of the topic. It must have the format
-   * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
-   * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
-   * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
-   * signs (`%`). It must be between 3 and 255 characters in length, and it
-   * must not start with `"goog"`.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 2; - */ - int getLabelsCount(); - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 2; - */ - boolean containsLabels(java.lang.String key); - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Deprecated - java.util.Map getLabels(); - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 2; - */ - java.util.Map getLabelsMap(); - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 2; - */ - /* nullable */ - java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue); - /** - * - * - *
-   * See [Creating and managing labels]
-   * (https://cloud.google.com/pubsub/docs/labels).
-   * 
- * - * map<string, string> labels = 2; - */ - java.lang.String getLabelsOrThrow(java.lang.String key); - - /** - * - * - *
-   * Policy constraining the set of Google Cloud Platform regions where messages
-   * published to the topic may be stored. If not present, then no constraints
-   * are in effect.
-   * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - * - * @return Whether the messageStoragePolicy field is set. - */ - boolean hasMessageStoragePolicy(); - /** - * - * - *
-   * Policy constraining the set of Google Cloud Platform regions where messages
-   * published to the topic may be stored. If not present, then no constraints
-   * are in effect.
-   * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - * - * @return The messageStoragePolicy. - */ - com.google.pubsub.v1.MessageStoragePolicy getMessageStoragePolicy(); - /** - * - * - *
-   * Policy constraining the set of Google Cloud Platform regions where messages
-   * published to the topic may be stored. If not present, then no constraints
-   * are in effect.
-   * 
- * - * .google.pubsub.v1.MessageStoragePolicy message_storage_policy = 3; - */ - com.google.pubsub.v1.MessageStoragePolicyOrBuilder getMessageStoragePolicyOrBuilder(); - - /** - * - * - *
-   * The resource name of the Cloud KMS CryptoKey to be used to protect access
-   * to messages published on this topic.
-   *
-   * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
-   * 
- * - * string kms_key_name = 5; - * - * @return The kmsKeyName. - */ - java.lang.String getKmsKeyName(); - /** - * - * - *
-   * The resource name of the Cloud KMS CryptoKey to be used to protect access
-   * to messages published on this topic.
-   *
-   * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
-   * 
- * - * string kms_key_name = 5; - * - * @return The bytes for kmsKeyName. - */ - com.google.protobuf.ByteString getKmsKeyNameBytes(); - - /** - * - * - *
-   * Settings for validating messages published against a schema.
-   * 
- * - * .google.pubsub.v1.SchemaSettings schema_settings = 6; - * - * @return Whether the schemaSettings field is set. - */ - boolean hasSchemaSettings(); - /** - * - * - *
-   * Settings for validating messages published against a schema.
-   * 
- * - * .google.pubsub.v1.SchemaSettings schema_settings = 6; - * - * @return The schemaSettings. - */ - com.google.pubsub.v1.SchemaSettings getSchemaSettings(); - /** - * - * - *
-   * Settings for validating messages published against a schema.
-   * 
- * - * .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(); - - /** - * - * - *
-   * Indicates the minimum duration to retain a message after it is published to
-   * the topic. If this field is set, messages published to the topic in the
-   * last `message_retention_duration` are always available to subscribers. For
-   * instance, it allows any attached subscription to [seek to a
-   * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-   * that is up to `message_retention_duration` in the past. If this field is
-   * not set, message retention is controlled by settings on individual
-   * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return Whether the messageRetentionDuration field is set. - */ - boolean hasMessageRetentionDuration(); - /** - * - * - *
-   * Indicates the minimum duration to retain a message after it is published to
-   * the topic. If this field is set, messages published to the topic in the
-   * last `message_retention_duration` are always available to subscribers. For
-   * instance, it allows any attached subscription to [seek to a
-   * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-   * that is up to `message_retention_duration` in the past. If this field is
-   * not set, message retention is controlled by settings on individual
-   * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - * - * @return The messageRetentionDuration. - */ - com.google.protobuf.Duration getMessageRetentionDuration(); - /** - * - * - *
-   * Indicates the minimum duration to retain a message after it is published to
-   * the topic. If this field is set, messages published to the topic in the
-   * last `message_retention_duration` are always available to subscribers. For
-   * instance, it allows any attached subscription to [seek to a
-   * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
-   * that is up to `message_retention_duration` in the past. If this field is
-   * not set, message retention is controlled by settings on individual
-   * subscriptions. Cannot be more than 31 days or less than 10 minutes.
-   * 
- * - * .google.protobuf.Duration message_retention_duration = 8; - */ - com.google.protobuf.DurationOrBuilder getMessageRetentionDurationOrBuilder(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSnapshotRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSnapshotRequest.java deleted file mode 100644 index 03e24bcc3..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSnapshotRequest.java +++ /dev/null @@ -1,989 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the UpdateSnapshot method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.UpdateSnapshotRequest} - */ -public final class UpdateSnapshotRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.UpdateSnapshotRequest) - UpdateSnapshotRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use UpdateSnapshotRequest.newBuilder() to construct. - private UpdateSnapshotRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateSnapshotRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateSnapshotRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateSnapshotRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateSnapshotRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.UpdateSnapshotRequest.class, - com.google.pubsub.v1.UpdateSnapshotRequest.Builder.class); - } - - public static final int SNAPSHOT_FIELD_NUMBER = 1; - private com.google.pubsub.v1.Snapshot snapshot_; - /** - * - * - *
-   * Required. The updated snapshot object.
-   * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return Whether the snapshot field is set. - */ - @java.lang.Override - public boolean hasSnapshot() { - return snapshot_ != null; - } - /** - * - * - *
-   * Required. The updated snapshot object.
-   * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The snapshot. - */ - @java.lang.Override - public com.google.pubsub.v1.Snapshot getSnapshot() { - return snapshot_ == null ? com.google.pubsub.v1.Snapshot.getDefaultInstance() : snapshot_; - } - /** - * - * - *
-   * Required. The updated snapshot object.
-   * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.pubsub.v1.SnapshotOrBuilder getSnapshotOrBuilder() { - return snapshot_ == null ? com.google.pubsub.v1.Snapshot.getDefaultInstance() : snapshot_; - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 2; - private com.google.protobuf.FieldMask updateMask_; - /** - * - * - *
-   * Required. Indicates which fields in the provided snapshot to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - * - * - *
-   * Required. Indicates which fields in the provided snapshot to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - * - * - *
-   * Required. Indicates which fields in the provided snapshot to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - - 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 (snapshot_ != null) { - output.writeMessage(1, getSnapshot()); - } - if (updateMask_ != null) { - output.writeMessage(2, getUpdateMask()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (snapshot_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSnapshot()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); - } - size += getUnknownFields().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.UpdateSnapshotRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.UpdateSnapshotRequest other = - (com.google.pubsub.v1.UpdateSnapshotRequest) obj; - - if (hasSnapshot() != other.hasSnapshot()) return false; - if (hasSnapshot()) { - if (!getSnapshot().equals(other.getSnapshot())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask().equals(other.getUpdateMask())) return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasSnapshot()) { - hash = (37 * hash) + SNAPSHOT_FIELD_NUMBER; - hash = (53 * hash) + getSnapshot().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.UpdateSnapshotRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.UpdateSnapshotRequest 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.UpdateSnapshotRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.UpdateSnapshotRequest 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.UpdateSnapshotRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.UpdateSnapshotRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.UpdateSnapshotRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.UpdateSnapshotRequest 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.UpdateSnapshotRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.UpdateSnapshotRequest 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.UpdateSnapshotRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.UpdateSnapshotRequest 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.UpdateSnapshotRequest 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 UpdateSnapshot method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.UpdateSnapshotRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.UpdateSnapshotRequest) - com.google.pubsub.v1.UpdateSnapshotRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateSnapshotRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateSnapshotRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.UpdateSnapshotRequest.class, - com.google.pubsub.v1.UpdateSnapshotRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.UpdateSnapshotRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - snapshot_ = null; - if (snapshotBuilder_ != null) { - snapshotBuilder_.dispose(); - snapshotBuilder_ = null; - } - updateMask_ = null; - if (updateMaskBuilder_ != null) { - updateMaskBuilder_.dispose(); - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateSnapshotRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.UpdateSnapshotRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.UpdateSnapshotRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.UpdateSnapshotRequest build() { - com.google.pubsub.v1.UpdateSnapshotRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.UpdateSnapshotRequest buildPartial() { - com.google.pubsub.v1.UpdateSnapshotRequest result = - new com.google.pubsub.v1.UpdateSnapshotRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.UpdateSnapshotRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.snapshot_ = snapshotBuilder_ == null ? snapshot_ : snapshotBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); - } - } - - @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.UpdateSnapshotRequest) { - return mergeFrom((com.google.pubsub.v1.UpdateSnapshotRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.UpdateSnapshotRequest other) { - if (other == com.google.pubsub.v1.UpdateSnapshotRequest.getDefaultInstance()) return this; - if (other.hasSnapshot()) { - mergeSnapshot(other.getSnapshot()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getSnapshotFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.pubsub.v1.Snapshot snapshot_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.Snapshot, - com.google.pubsub.v1.Snapshot.Builder, - com.google.pubsub.v1.SnapshotOrBuilder> - snapshotBuilder_; - /** - * - * - *
-     * Required. The updated snapshot object.
-     * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the snapshot field is set. - */ - public boolean hasSnapshot() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * Required. The updated snapshot object.
-     * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The snapshot. - */ - public com.google.pubsub.v1.Snapshot getSnapshot() { - if (snapshotBuilder_ == null) { - return snapshot_ == null ? com.google.pubsub.v1.Snapshot.getDefaultInstance() : snapshot_; - } else { - return snapshotBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The updated snapshot object.
-     * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setSnapshot(com.google.pubsub.v1.Snapshot value) { - if (snapshotBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - snapshot_ = value; - } else { - snapshotBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated snapshot object.
-     * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setSnapshot(com.google.pubsub.v1.Snapshot.Builder builderForValue) { - if (snapshotBuilder_ == null) { - snapshot_ = builderForValue.build(); - } else { - snapshotBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated snapshot object.
-     * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeSnapshot(com.google.pubsub.v1.Snapshot value) { - if (snapshotBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) - && snapshot_ != null - && snapshot_ != com.google.pubsub.v1.Snapshot.getDefaultInstance()) { - getSnapshotBuilder().mergeFrom(value); - } else { - snapshot_ = value; - } - } else { - snapshotBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated snapshot object.
-     * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearSnapshot() { - bitField0_ = (bitField0_ & ~0x00000001); - snapshot_ = null; - if (snapshotBuilder_ != null) { - snapshotBuilder_.dispose(); - snapshotBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated snapshot object.
-     * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.Snapshot.Builder getSnapshotBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getSnapshotFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The updated snapshot object.
-     * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.SnapshotOrBuilder getSnapshotOrBuilder() { - if (snapshotBuilder_ != null) { - return snapshotBuilder_.getMessageOrBuilder(); - } else { - return snapshot_ == null ? com.google.pubsub.v1.Snapshot.getDefaultInstance() : snapshot_; - } - } - /** - * - * - *
-     * Required. The updated snapshot object.
-     * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.Snapshot, - com.google.pubsub.v1.Snapshot.Builder, - com.google.pubsub.v1.SnapshotOrBuilder> - getSnapshotFieldBuilder() { - if (snapshotBuilder_ == null) { - snapshotBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.Snapshot, - com.google.pubsub.v1.Snapshot.Builder, - com.google.pubsub.v1.SnapshotOrBuilder>( - getSnapshot(), getParentForChildren(), isClean()); - snapshot_ = null; - } - return snapshotBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - updateMaskBuilder_; - /** - * - * - *
-     * Required. Indicates which fields in the provided snapshot to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * Required. Indicates which fields in the provided snapshot to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Indicates which fields in the provided snapshot to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - } else { - updateMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided snapshot to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided snapshot to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) - && updateMask_ != null - && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { - getUpdateMaskBuilder().mergeFrom(value); - } else { - updateMask_ = value; - } - } else { - updateMaskBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided snapshot to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearUpdateMask() { - bitField0_ = (bitField0_ & ~0x00000002); - updateMask_ = null; - if (updateMaskBuilder_ != null) { - updateMaskBuilder_.dispose(); - updateMaskBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided snapshot to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Indicates which fields in the provided snapshot to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } - } - /** - * - * - *
-     * Required. Indicates which fields in the provided snapshot to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), getParentForChildren(), isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - - @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.UpdateSnapshotRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.UpdateSnapshotRequest) - private static final com.google.pubsub.v1.UpdateSnapshotRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.UpdateSnapshotRequest(); - } - - public static com.google.pubsub.v1.UpdateSnapshotRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateSnapshotRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.UpdateSnapshotRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSnapshotRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSnapshotRequestOrBuilder.java deleted file mode 100644 index 27027e92b..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSnapshotRequestOrBuilder.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2023 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 UpdateSnapshotRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.UpdateSnapshotRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The updated snapshot object.
-   * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return Whether the snapshot field is set. - */ - boolean hasSnapshot(); - /** - * - * - *
-   * Required. The updated snapshot object.
-   * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The snapshot. - */ - com.google.pubsub.v1.Snapshot getSnapshot(); - /** - * - * - *
-   * Required. The updated snapshot object.
-   * 
- * - * .google.pubsub.v1.Snapshot snapshot = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.pubsub.v1.SnapshotOrBuilder getSnapshotOrBuilder(); - - /** - * - * - *
-   * Required. Indicates which fields in the provided snapshot to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - * - * - *
-   * Required. Indicates which fields in the provided snapshot to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - * - * - *
-   * Required. Indicates which fields in the provided snapshot to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSubscriptionRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSubscriptionRequest.java deleted file mode 100644 index 921ead79e..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSubscriptionRequest.java +++ /dev/null @@ -1,1013 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the UpdateSubscription method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.UpdateSubscriptionRequest} - */ -public final class UpdateSubscriptionRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.UpdateSubscriptionRequest) - UpdateSubscriptionRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use UpdateSubscriptionRequest.newBuilder() to construct. - private UpdateSubscriptionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateSubscriptionRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateSubscriptionRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateSubscriptionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateSubscriptionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.UpdateSubscriptionRequest.class, - com.google.pubsub.v1.UpdateSubscriptionRequest.Builder.class); - } - - public static final int SUBSCRIPTION_FIELD_NUMBER = 1; - private com.google.pubsub.v1.Subscription subscription_; - /** - * - * - *
-   * Required. The updated subscription object.
-   * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the subscription field is set. - */ - @java.lang.Override - public boolean hasSubscription() { - return subscription_ != null; - } - /** - * - * - *
-   * Required. The updated subscription object.
-   * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The subscription. - */ - @java.lang.Override - public com.google.pubsub.v1.Subscription getSubscription() { - return subscription_ == null - ? com.google.pubsub.v1.Subscription.getDefaultInstance() - : subscription_; - } - /** - * - * - *
-   * Required. The updated subscription object.
-   * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.pubsub.v1.SubscriptionOrBuilder getSubscriptionOrBuilder() { - return subscription_ == null - ? com.google.pubsub.v1.Subscription.getDefaultInstance() - : subscription_; - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 2; - private com.google.protobuf.FieldMask updateMask_; - /** - * - * - *
-   * Required. Indicates which fields in the provided subscription to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - * - * - *
-   * Required. Indicates which fields in the provided subscription to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - * - * - *
-   * Required. Indicates which fields in the provided subscription to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - - 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 (subscription_ != null) { - output.writeMessage(1, getSubscription()); - } - if (updateMask_ != null) { - output.writeMessage(2, getUpdateMask()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (subscription_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSubscription()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); - } - size += getUnknownFields().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.UpdateSubscriptionRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.UpdateSubscriptionRequest other = - (com.google.pubsub.v1.UpdateSubscriptionRequest) obj; - - if (hasSubscription() != other.hasSubscription()) return false; - if (hasSubscription()) { - if (!getSubscription().equals(other.getSubscription())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask().equals(other.getUpdateMask())) return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasSubscription()) { - hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSubscription().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.UpdateSubscriptionRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.UpdateSubscriptionRequest 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.UpdateSubscriptionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.UpdateSubscriptionRequest 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.UpdateSubscriptionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.UpdateSubscriptionRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.UpdateSubscriptionRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.UpdateSubscriptionRequest 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.UpdateSubscriptionRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.UpdateSubscriptionRequest 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.UpdateSubscriptionRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.UpdateSubscriptionRequest 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.UpdateSubscriptionRequest 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 UpdateSubscription method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.UpdateSubscriptionRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.UpdateSubscriptionRequest) - com.google.pubsub.v1.UpdateSubscriptionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateSubscriptionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateSubscriptionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.UpdateSubscriptionRequest.class, - com.google.pubsub.v1.UpdateSubscriptionRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.UpdateSubscriptionRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - subscription_ = null; - if (subscriptionBuilder_ != null) { - subscriptionBuilder_.dispose(); - subscriptionBuilder_ = null; - } - updateMask_ = null; - if (updateMaskBuilder_ != null) { - updateMaskBuilder_.dispose(); - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateSubscriptionRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.UpdateSubscriptionRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.UpdateSubscriptionRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.UpdateSubscriptionRequest build() { - com.google.pubsub.v1.UpdateSubscriptionRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.UpdateSubscriptionRequest buildPartial() { - com.google.pubsub.v1.UpdateSubscriptionRequest result = - new com.google.pubsub.v1.UpdateSubscriptionRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.UpdateSubscriptionRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.subscription_ = - subscriptionBuilder_ == null ? subscription_ : subscriptionBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); - } - } - - @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.UpdateSubscriptionRequest) { - return mergeFrom((com.google.pubsub.v1.UpdateSubscriptionRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.UpdateSubscriptionRequest other) { - if (other == com.google.pubsub.v1.UpdateSubscriptionRequest.getDefaultInstance()) return this; - if (other.hasSubscription()) { - mergeSubscription(other.getSubscription()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getSubscriptionFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.pubsub.v1.Subscription subscription_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.Subscription, - com.google.pubsub.v1.Subscription.Builder, - com.google.pubsub.v1.SubscriptionOrBuilder> - subscriptionBuilder_; - /** - * - * - *
-     * Required. The updated subscription object.
-     * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the subscription field is set. - */ - public boolean hasSubscription() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * Required. The updated subscription object.
-     * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The subscription. - */ - public com.google.pubsub.v1.Subscription getSubscription() { - if (subscriptionBuilder_ == null) { - return subscription_ == null - ? com.google.pubsub.v1.Subscription.getDefaultInstance() - : subscription_; - } else { - return subscriptionBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The updated subscription object.
-     * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setSubscription(com.google.pubsub.v1.Subscription value) { - if (subscriptionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - subscription_ = value; - } else { - subscriptionBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated subscription object.
-     * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setSubscription(com.google.pubsub.v1.Subscription.Builder builderForValue) { - if (subscriptionBuilder_ == null) { - subscription_ = builderForValue.build(); - } else { - subscriptionBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated subscription object.
-     * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeSubscription(com.google.pubsub.v1.Subscription value) { - if (subscriptionBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) - && subscription_ != null - && subscription_ != com.google.pubsub.v1.Subscription.getDefaultInstance()) { - getSubscriptionBuilder().mergeFrom(value); - } else { - subscription_ = value; - } - } else { - subscriptionBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated subscription object.
-     * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearSubscription() { - bitField0_ = (bitField0_ & ~0x00000001); - subscription_ = null; - if (subscriptionBuilder_ != null) { - subscriptionBuilder_.dispose(); - subscriptionBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated subscription object.
-     * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.Subscription.Builder getSubscriptionBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getSubscriptionFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The updated subscription object.
-     * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.pubsub.v1.SubscriptionOrBuilder getSubscriptionOrBuilder() { - if (subscriptionBuilder_ != null) { - return subscriptionBuilder_.getMessageOrBuilder(); - } else { - return subscription_ == null - ? com.google.pubsub.v1.Subscription.getDefaultInstance() - : subscription_; - } - } - /** - * - * - *
-     * Required. The updated subscription object.
-     * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.Subscription, - com.google.pubsub.v1.Subscription.Builder, - com.google.pubsub.v1.SubscriptionOrBuilder> - getSubscriptionFieldBuilder() { - if (subscriptionBuilder_ == null) { - subscriptionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.Subscription, - com.google.pubsub.v1.Subscription.Builder, - com.google.pubsub.v1.SubscriptionOrBuilder>( - getSubscription(), getParentForChildren(), isClean()); - subscription_ = null; - } - return subscriptionBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - updateMaskBuilder_; - /** - * - * - *
-     * Required. Indicates which fields in the provided subscription to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * Required. Indicates which fields in the provided subscription to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Indicates which fields in the provided subscription to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - } else { - updateMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided subscription to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided subscription to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) - && updateMask_ != null - && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { - getUpdateMaskBuilder().mergeFrom(value); - } else { - updateMask_ = value; - } - } else { - updateMaskBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided subscription to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearUpdateMask() { - bitField0_ = (bitField0_ & ~0x00000002); - updateMask_ = null; - if (updateMaskBuilder_ != null) { - updateMaskBuilder_.dispose(); - updateMaskBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided subscription to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Indicates which fields in the provided subscription to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } - } - /** - * - * - *
-     * Required. Indicates which fields in the provided subscription to update.
-     * Must be specified and non-empty.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), getParentForChildren(), isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - - @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.UpdateSubscriptionRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.UpdateSubscriptionRequest) - private static final com.google.pubsub.v1.UpdateSubscriptionRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.UpdateSubscriptionRequest(); - } - - public static com.google.pubsub.v1.UpdateSubscriptionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateSubscriptionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.UpdateSubscriptionRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSubscriptionRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSubscriptionRequestOrBuilder.java deleted file mode 100644 index ab0f57de3..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateSubscriptionRequestOrBuilder.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2023 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 UpdateSubscriptionRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.UpdateSubscriptionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The updated subscription object.
-   * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the subscription field is set. - */ - boolean hasSubscription(); - /** - * - * - *
-   * Required. The updated subscription object.
-   * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The subscription. - */ - com.google.pubsub.v1.Subscription getSubscription(); - /** - * - * - *
-   * Required. The updated subscription object.
-   * 
- * - * - * .google.pubsub.v1.Subscription subscription = 1 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.pubsub.v1.SubscriptionOrBuilder getSubscriptionOrBuilder(); - - /** - * - * - *
-   * Required. Indicates which fields in the provided subscription to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - * - * - *
-   * Required. Indicates which fields in the provided subscription to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - * - * - *
-   * Required. Indicates which fields in the provided subscription to update.
-   * Must be specified and non-empty.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequest.java deleted file mode 100644 index 49ef30ab3..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequest.java +++ /dev/null @@ -1,1014 +0,0 @@ -/* - * Copyright 2023 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; - -/** - * - * - *
- * Request for the UpdateTopic method.
- * 
- * - * Protobuf type {@code google.pubsub.v1.UpdateTopicRequest} - */ -public final class UpdateTopicRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.pubsub.v1.UpdateTopicRequest) - UpdateTopicRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use UpdateTopicRequest.newBuilder() to construct. - private UpdateTopicRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateTopicRequest() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateTopicRequest(); - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateTopicRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateTopicRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.UpdateTopicRequest.class, - com.google.pubsub.v1.UpdateTopicRequest.Builder.class); - } - - public static final int TOPIC_FIELD_NUMBER = 1; - private com.google.pubsub.v1.Topic topic_; - /** - * - * - *
-   * Required. The updated topic object.
-   * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return Whether the topic field is set. - */ - @java.lang.Override - public boolean hasTopic() { - return topic_ != null; - } - /** - * - * - *
-   * Required. The updated topic object.
-   * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The topic. - */ - @java.lang.Override - public com.google.pubsub.v1.Topic getTopic() { - return topic_ == null ? com.google.pubsub.v1.Topic.getDefaultInstance() : topic_; - } - /** - * - * - *
-   * Required. The updated topic object.
-   * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.pubsub.v1.TopicOrBuilder getTopicOrBuilder() { - return topic_ == null ? com.google.pubsub.v1.Topic.getDefaultInstance() : topic_; - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 2; - private com.google.protobuf.FieldMask updateMask_; - /** - * - * - *
-   * Required. Indicates which fields in the provided topic to update. Must be
-   * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" but the `message_storage_policy` is not set in
-   * the `topic` provided above, then the updated value is determined by the
-   * policy configured at the project or organization level.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - * - * - *
-   * Required. Indicates which fields in the provided topic to update. Must be
-   * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" but the `message_storage_policy` is not set in
-   * the `topic` provided above, then the updated value is determined by the
-   * policy configured at the project or organization level.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - * - * - *
-   * Required. Indicates which fields in the provided topic to update. Must be
-   * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" but the `message_storage_policy` is not set in
-   * the `topic` provided above, then the updated value is determined by the
-   * policy configured at the project or organization level.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - - 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 (topic_ != null) { - output.writeMessage(1, getTopic()); - } - if (updateMask_ != null) { - output.writeMessage(2, getUpdateMask()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (topic_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTopic()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); - } - size += getUnknownFields().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.UpdateTopicRequest)) { - return super.equals(obj); - } - com.google.pubsub.v1.UpdateTopicRequest other = (com.google.pubsub.v1.UpdateTopicRequest) obj; - - if (hasTopic() != other.hasTopic()) return false; - if (hasTopic()) { - if (!getTopic().equals(other.getTopic())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask().equals(other.getUpdateMask())) return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasTopic()) { - hash = (37 * hash) + TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getTopic().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.pubsub.v1.UpdateTopicRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.UpdateTopicRequest 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.UpdateTopicRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.UpdateTopicRequest 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.UpdateTopicRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.pubsub.v1.UpdateTopicRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.pubsub.v1.UpdateTopicRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.UpdateTopicRequest 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.UpdateTopicRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.UpdateTopicRequest 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.UpdateTopicRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.pubsub.v1.UpdateTopicRequest 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.UpdateTopicRequest 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 UpdateTopic method.
-   * 
- * - * Protobuf type {@code google.pubsub.v1.UpdateTopicRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.pubsub.v1.UpdateTopicRequest) - com.google.pubsub.v1.UpdateTopicRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateTopicRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateTopicRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.pubsub.v1.UpdateTopicRequest.class, - com.google.pubsub.v1.UpdateTopicRequest.Builder.class); - } - - // Construct using com.google.pubsub.v1.UpdateTopicRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - topic_ = null; - if (topicBuilder_ != null) { - topicBuilder_.dispose(); - topicBuilder_ = null; - } - updateMask_ = null; - if (updateMaskBuilder_ != null) { - updateMaskBuilder_.dispose(); - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.pubsub.v1.PubsubProto - .internal_static_google_pubsub_v1_UpdateTopicRequest_descriptor; - } - - @java.lang.Override - public com.google.pubsub.v1.UpdateTopicRequest getDefaultInstanceForType() { - return com.google.pubsub.v1.UpdateTopicRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.pubsub.v1.UpdateTopicRequest build() { - com.google.pubsub.v1.UpdateTopicRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.pubsub.v1.UpdateTopicRequest buildPartial() { - com.google.pubsub.v1.UpdateTopicRequest result = - new com.google.pubsub.v1.UpdateTopicRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.UpdateTopicRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.topic_ = topicBuilder_ == null ? topic_ : topicBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); - } - } - - @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.UpdateTopicRequest) { - return mergeFrom((com.google.pubsub.v1.UpdateTopicRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.pubsub.v1.UpdateTopicRequest other) { - if (other == com.google.pubsub.v1.UpdateTopicRequest.getDefaultInstance()) return this; - if (other.hasTopic()) { - mergeTopic(other.getTopic()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getTopicFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.pubsub.v1.Topic topic_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.Topic, - com.google.pubsub.v1.Topic.Builder, - com.google.pubsub.v1.TopicOrBuilder> - topicBuilder_; - /** - * - * - *
-     * Required. The updated topic object.
-     * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return Whether the topic field is set. - */ - public boolean hasTopic() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-     * Required. The updated topic object.
-     * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The topic. - */ - public com.google.pubsub.v1.Topic getTopic() { - if (topicBuilder_ == null) { - return topic_ == null ? com.google.pubsub.v1.Topic.getDefaultInstance() : topic_; - } else { - return topicBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The updated topic object.
-     * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setTopic(com.google.pubsub.v1.Topic value) { - if (topicBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - topic_ = value; - } else { - topicBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated topic object.
-     * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setTopic(com.google.pubsub.v1.Topic.Builder builderForValue) { - if (topicBuilder_ == null) { - topic_ = builderForValue.build(); - } else { - topicBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated topic object.
-     * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeTopic(com.google.pubsub.v1.Topic value) { - if (topicBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) - && topic_ != null - && topic_ != com.google.pubsub.v1.Topic.getDefaultInstance()) { - getTopicBuilder().mergeFrom(value); - } else { - topic_ = value; - } - } else { - topicBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated topic object.
-     * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearTopic() { - bitField0_ = (bitField0_ & ~0x00000001); - topic_ = null; - if (topicBuilder_ != null) { - topicBuilder_.dispose(); - topicBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The updated topic object.
-     * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.pubsub.v1.Topic.Builder getTopicBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getTopicFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The updated topic object.
-     * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.pubsub.v1.TopicOrBuilder getTopicOrBuilder() { - if (topicBuilder_ != null) { - return topicBuilder_.getMessageOrBuilder(); - } else { - return topic_ == null ? com.google.pubsub.v1.Topic.getDefaultInstance() : topic_; - } - } - /** - * - * - *
-     * Required. The updated topic object.
-     * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.Topic, - com.google.pubsub.v1.Topic.Builder, - com.google.pubsub.v1.TopicOrBuilder> - getTopicFieldBuilder() { - if (topicBuilder_ == null) { - topicBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.pubsub.v1.Topic, - com.google.pubsub.v1.Topic.Builder, - com.google.pubsub.v1.TopicOrBuilder>(getTopic(), getParentForChildren(), isClean()); - topic_ = null; - } - return topicBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - updateMaskBuilder_; - /** - * - * - *
-     * Required. Indicates which fields in the provided topic to update. Must be
-     * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" but the `message_storage_policy` is not set in
-     * the `topic` provided above, then the updated value is determined by the
-     * policy configured at the project or organization level.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * Required. Indicates which fields in the provided topic to update. Must be
-     * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" but the `message_storage_policy` is not set in
-     * the `topic` provided above, then the updated value is determined by the
-     * policy configured at the project or organization level.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Indicates which fields in the provided topic to update. Must be
-     * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" but the `message_storage_policy` is not set in
-     * the `topic` provided above, then the updated value is determined by the
-     * policy configured at the project or organization level.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - } else { - updateMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided topic to update. Must be
-     * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" but the `message_storage_policy` is not set in
-     * the `topic` provided above, then the updated value is determined by the
-     * policy configured at the project or organization level.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided topic to update. Must be
-     * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" but the `message_storage_policy` is not set in
-     * the `topic` provided above, then the updated value is determined by the
-     * policy configured at the project or organization level.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) - && updateMask_ != null - && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { - getUpdateMaskBuilder().mergeFrom(value); - } else { - updateMask_ = value; - } - } else { - updateMaskBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided topic to update. Must be
-     * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" but the `message_storage_policy` is not set in
-     * the `topic` provided above, then the updated value is determined by the
-     * policy configured at the project or organization level.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearUpdateMask() { - bitField0_ = (bitField0_ & ~0x00000002); - updateMask_ = null; - if (updateMaskBuilder_ != null) { - updateMaskBuilder_.dispose(); - updateMaskBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Indicates which fields in the provided topic to update. Must be
-     * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" but the `message_storage_policy` is not set in
-     * the `topic` provided above, then the updated value is determined by the
-     * policy configured at the project or organization level.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Indicates which fields in the provided topic to update. Must be
-     * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" but the `message_storage_policy` is not set in
-     * the `topic` provided above, then the updated value is determined by the
-     * policy configured at the project or organization level.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } - } - /** - * - * - *
-     * Required. Indicates which fields in the provided topic to update. Must be
-     * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" but the `message_storage_policy` is not set in
-     * the `topic` provided above, then the updated value is determined by the
-     * policy configured at the project or organization level.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), getParentForChildren(), isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - - @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.UpdateTopicRequest) - } - - // @@protoc_insertion_point(class_scope:google.pubsub.v1.UpdateTopicRequest) - private static final com.google.pubsub.v1.UpdateTopicRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.pubsub.v1.UpdateTopicRequest(); - } - - public static com.google.pubsub.v1.UpdateTopicRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateTopicRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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.UpdateTopicRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequestOrBuilder.java deleted file mode 100644 index ce746a8ab..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequestOrBuilder.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2023 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 UpdateTopicRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.pubsub.v1.UpdateTopicRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The updated topic object.
-   * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return Whether the topic field is set. - */ - boolean hasTopic(); - /** - * - * - *
-   * Required. The updated topic object.
-   * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The topic. - */ - com.google.pubsub.v1.Topic getTopic(); - /** - * - * - *
-   * Required. The updated topic object.
-   * 
- * - * .google.pubsub.v1.Topic topic = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.pubsub.v1.TopicOrBuilder getTopicOrBuilder(); - - /** - * - * - *
-   * Required. Indicates which fields in the provided topic to update. Must be
-   * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" but the `message_storage_policy` is not set in
-   * the `topic` provided above, then the updated value is determined by the
-   * policy configured at the project or organization level.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - * - * - *
-   * Required. Indicates which fields in the provided topic to update. Must be
-   * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" but the `message_storage_policy` is not set in
-   * the `topic` provided above, then the updated value is determined by the
-   * policy configured at the project or organization level.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - * - * - *
-   * Required. Indicates which fields in the provided topic to update. Must be
-   * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" but the `message_storage_policy` is not set in
-   * the `topic` provided above, then the updated value is determined by the
-   * policy configured at the project or organization level.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} 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 deleted file mode 100644 index 8a5c924a6..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequest.java +++ /dev/null @@ -1,1509 +0,0 @@ -/* - * Copyright 2023 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(); - } - - 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; - - @SuppressWarnings("serial") - 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; - - @SuppressWarnings("serial") - 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 Whether the name field is set. - */ - public boolean hasName() { - return schemaSpecCase_ == 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_ = 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_; - } - - public static final int ENCODING_FIELD_NUMBER = 5; - 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; - * - * @return The encoding. - */ - @java.lang.Override - public com.google.pubsub.v1.Encoding getEncoding() { - com.google.pubsub.v1.Encoding result = com.google.pubsub.v1.Encoding.forNumber(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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - 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_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - 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 += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - parent_ = ""; - if (schemaBuilder_ != null) { - schemaBuilder_.clear(); - } - 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); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ValidateMessageRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.parent_ = parent_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.message_ = message_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.encoding_ = encoding_; - } - } - - private void buildPartialOneofs(com.google.pubsub.v1.ValidateMessageRequest result) { - result.schemaSpecCase_ = schemaSpecCase_; - result.schemaSpec_ = this.schemaSpec_; - if (schemaSpecCase_ == 3 && schemaBuilder_ != null) { - result.schemaSpec_ = schemaBuilder_.build(); - } - } - - @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_; - bitField0_ |= 0x00000001; - 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.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - parent_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - schemaSpecCase_ = 2; - schemaSpec_ = s; - break; - } // case 18 - case 26: - { - input.readMessage(getSchemaFieldBuilder().getBuilder(), extensionRegistry); - schemaSpecCase_ = 3; - break; - } // case 26 - case 34: - { - message_ = input.readBytes(); - bitField0_ |= 0x00000008; - break; - } // case 34 - case 40: - { - encoding_ = input.readEnum(); - bitField0_ |= 0x00000010; - break; - } // case 40 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - 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 int bitField0_; - - 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; - bitField0_ |= 0x00000001; - 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(); - bitField0_ = (bitField0_ & ~0x00000001); - 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; - bitField0_ |= 0x00000001; - 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 Whether the name field is set. - */ - @java.lang.Override - public boolean hasName() { - return schemaSpecCase_ == 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. - */ - @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); - } else { - 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; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * Message to validate against the provided `schema_spec`.
-     * 
- * - * bytes message = 4; - * - * @return This builder for chaining. - */ - public Builder clearMessage() { - bitField0_ = (bitField0_ & ~0x00000008); - 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; - bitField0_ |= 0x00000010; - 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() { - com.google.pubsub.v1.Encoding result = com.google.pubsub.v1.Encoding.forNumber(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(); - } - bitField0_ |= 0x00000010; - 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() { - bitField0_ = (bitField0_ & ~0x00000010); - 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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index 30ee884fc..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequestOrBuilder.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2023 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 Whether the name field is set. - */ - boolean hasName(); - /** - * - * - *
-   * 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(); - - 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 deleted file mode 100644 index b865330f1..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageResponse.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Copyright 2023 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.
- * Empty for now.
- * 
- * - * 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(); - } - - 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 { - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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.
-   * Empty for now.
-   * 
- * - * 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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @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.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - 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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index fb7717093..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageResponseOrBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2023 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 deleted file mode 100644 index e287bbd48..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequest.java +++ /dev/null @@ -1,900 +0,0 @@ -/* - * Copyright 2023 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(); - } - - 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; - - @SuppressWarnings("serial") - 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 schema_ == null ? com.google.pubsub.v1.Schema.getDefaultInstance() : schema_; - } - - 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (schema_ != null) { - output.writeMessage(2, getSchema()); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (schema_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSchema()); - } - size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - parent_ = ""; - schema_ = null; - if (schemaBuilder_ != null) { - schemaBuilder_.dispose(); - 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); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(com.google.pubsub.v1.ValidateSchemaRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.parent_ = parent_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.schema_ = schemaBuilder_ == null ? schema_ : schemaBuilder_.build(); - } - } - - @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_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.hasSchema()) { - mergeSchema(other.getSchema()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - parent_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - input.readMessage(getSchemaFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - 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; - bitField0_ |= 0x00000001; - 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(); - bitField0_ = (bitField0_ & ~0x00000001); - 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; - bitField0_ |= 0x00000001; - 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 ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-     * 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; - } else { - schemaBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - 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(); - } else { - schemaBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - 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 (((bitField0_ & 0x00000002) != 0) - && schema_ != null - && schema_ != com.google.pubsub.v1.Schema.getDefaultInstance()) { - getSchemaBuilder().mergeFrom(value); - } else { - schema_ = value; - } - } else { - schemaBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The schema object to validate.
-     * 
- * - * .google.pubsub.v1.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearSchema() { - bitField0_ = (bitField0_ & ~0x00000002); - schema_ = null; - if (schemaBuilder_ != null) { - schemaBuilder_.dispose(); - schemaBuilder_ = null; - } - onChanged(); - 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() { - bitField0_ |= 0x00000002; - 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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index a7e443e7b..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequestOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2023 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 deleted file mode 100644 index 002d5b390..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaResponse.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Copyright 2023 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.
- * Empty for now.
- * 
- * - * 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(); - } - - 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 { - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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.
-   * Empty for now.
-   * 
- * - * 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() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @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.getUnknownFields()); - 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - 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 { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - 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 deleted file mode 100644 index a6d1fa45f..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaResponseOrBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2023 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 deleted file mode 100644 index 393893b10..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto +++ /dev/null @@ -1,1598 +0,0 @@ -// Copyright 2023 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/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"; -option go_package = "cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb"; -option java_multiple_files = true; -option java_outer_classname = "PubsubProto"; -option java_package = "com.google.pubsub.v1"; -option php_namespace = "Google\\Cloud\\PubSub\\V1"; -option ruby_package = "Google::Cloud::PubSub::V1"; - -// The service that an application uses to manipulate topics, and to send -// messages to a topic. -service Publisher { - 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 the given topic with the given name. See the [resource name rules] - // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - rpc CreateTopic(Topic) returns (Topic) { - option (google.api.http) = { - put: "/v1/{name=projects/*/topics/*}" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Updates an existing topic. Note that certain properties of a - // topic are not modifiable. - rpc UpdateTopic(UpdateTopicRequest) returns (Topic) { - option (google.api.http) = { - patch: "/v1/{topic.name=projects/*/topics/*}" - body: "*" - }; - option (google.api.method_signature) = "topic,update_mask"; - } - - // Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - // does not exist. - rpc Publish(PublishRequest) returns (PublishResponse) { - option (google.api.http) = { - post: "/v1/{topic=projects/*/topics/*}:publish" - body: "*" - }; - option (google.api.method_signature) = "topic,messages"; - } - - // Gets the configuration of a topic. - rpc GetTopic(GetTopicRequest) returns (Topic) { - option (google.api.http) = { - get: "/v1/{topic=projects/*/topics/*}" - }; - option (google.api.method_signature) = "topic"; - } - - // Lists matching topics. - rpc ListTopics(ListTopicsRequest) returns (ListTopicsResponse) { - option (google.api.http) = { - get: "/v1/{project=projects/*}/topics" - }; - option (google.api.method_signature) = "project"; - } - - // Lists the names of the attached subscriptions on this topic. - rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest) - returns (ListTopicSubscriptionsResponse) { - option (google.api.http) = { - get: "/v1/{topic=projects/*/topics/*}/subscriptions" - }; - option (google.api.method_signature) = "topic"; - } - - // Lists the names of the snapshots on this topic. 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. - rpc ListTopicSnapshots(ListTopicSnapshotsRequest) - returns (ListTopicSnapshotsResponse) { - option (google.api.http) = { - get: "/v1/{topic=projects/*/topics/*}/snapshots" - }; - option (google.api.method_signature) = "topic"; - } - - // Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - // does not exist. After a topic is deleted, a new topic may be created with - // the same name; this is an entirely new topic with none of the old - // configuration or subscriptions. Existing subscriptions to this topic are - // not deleted, but their `topic` field is set to `_deleted-topic_`. - rpc DeleteTopic(DeleteTopicRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{topic=projects/*/topics/*}" - }; - option (google.api.method_signature) = "topic"; - } - - // Detaches a subscription from this topic. All messages retained in the - // subscription are dropped. Subsequent `Pull` and `StreamingPull` requests - // will return FAILED_PRECONDITION. If the subscription is a push - // subscription, pushes to the endpoint will stop. - rpc DetachSubscription(DetachSubscriptionRequest) - returns (DetachSubscriptionResponse) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:detach" - }; - } -} - -// A policy constraining the storage of messages published to the topic. -message MessageStoragePolicy { - // A list of IDs of Google Cloud regions where messages that are published - // to the topic may be persisted in storage. Messages published by publishers - // running in non-allowed Google Cloud regions (or running outside of Google - // Cloud altogether) are routed for storage in one of the allowed regions. - // An empty list means that no regions are allowed, and is not a valid - // configuration. - 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; - - // The minimum (inclusive) revision allowed for validating messages. If empty - // or not present, allow any revision to be validated against last_revision or - // any revision created before. - string first_revision_id = 3; - - // The maximum (inclusive) revision allowed for validating messages. If empty - // or not present, allow any revision to be validated against first_revision - // or any revision created after. - string last_revision_id = 4; -} - -// A topic resource. -message Topic { - option (google.api.resource) = { - type: "pubsub.googleapis.com/Topic" - pattern: "projects/{project}/topics/{topic}" - pattern: "_deleted-topic_" - }; - - // Required. The name of the topic. It must have the format - // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - // signs (`%`). It must be between 3 and 255 characters in length, and it - // must not start with `"goog"`. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // See [Creating and managing labels] - // (https://cloud.google.com/pubsub/docs/labels). - map labels = 2; - - // Policy constraining the set of Google Cloud Platform regions where messages - // published to the topic may be stored. If not present, then no constraints - // are in effect. - MessageStoragePolicy message_storage_policy = 3; - - // The resource name of the Cloud KMS CryptoKey to be used to protect access - // to messages published on this topic. - // - // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - string kms_key_name = 5; - - // Settings for validating messages published against a schema. - 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; - - // Indicates the minimum duration to retain a message after it is published to - // the topic. If this field is set, messages published to the topic in the - // last `message_retention_duration` are always available to subscribers. For - // instance, it allows any attached subscription to [seek to a - // timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) - // that is up to `message_retention_duration` in the past. If this field is - // not set, message retention is controlled by settings on individual - // subscriptions. Cannot be more than 31 days or less than 10 minutes. - google.protobuf.Duration message_retention_duration = 8; -} - -// A message that is published by publishers and consumed by subscribers. The -// message must contain either a non-empty data field or at least one attribute. -// Note that client libraries represent this object differently -// depending on the language. See the corresponding [client library -// documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for -// more information. See [quotas and limits] -// (https://cloud.google.com/pubsub/quotas) for more information about message -// limits. -message PubsubMessage { - // The message data field. If this field is empty, the message must contain - // at least one attribute. - bytes data = 1; - - // Attributes for this message. If this field is empty, the message must - // contain non-empty data. This can be used to filter messages on the - // subscription. - map attributes = 2; - - // ID of this message, assigned by the server when the message is published. - // Guaranteed to be unique within the topic. This value may be read by a - // subscriber that receives a `PubsubMessage` via a `Pull` call or a push - // delivery. It must not be populated by the publisher in a `Publish` call. - string message_id = 3; - - // The time at which the message was published, populated by the server when - // it receives the `Publish` call. It must not be populated by the - // publisher in a `Publish` call. - google.protobuf.Timestamp publish_time = 4; - - // If non-empty, identifies related messages for which publish order should be - // respected. If a `Subscription` has `enable_message_ordering` set to `true`, - // messages published with the same non-empty `ordering_key` value will be - // delivered to subscribers in the order in which they are received by the - // Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest` - // must specify the same `ordering_key` value. - // For more information, see [ordering - // messages](https://cloud.google.com/pubsub/docs/ordering). - string ordering_key = 5; -} - -// Request for the GetTopic method. -message GetTopicRequest { - // Required. The name of the topic to get. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; -} - -// Request for the UpdateTopic method. -message UpdateTopicRequest { - // Required. The updated topic object. - Topic topic = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Indicates which fields in the provided topic to update. Must be - // specified and non-empty. Note that if `update_mask` contains - // "message_storage_policy" but the `message_storage_policy` is not set in - // the `topic` provided above, then the updated value is determined by the - // policy configured at the project or organization level. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the Publish method. -message PublishRequest { - // Required. The messages in the request will be published on this topic. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Required. The messages to publish. - repeated PubsubMessage messages = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response for the `Publish` method. -message PublishResponse { - // The server-assigned ID of each published message, in the same order as - // the messages in the request. IDs are guaranteed to be unique within - // the topic. - repeated string message_ids = 1; -} - -// Request for the `ListTopics` method. -message ListTopicsRequest { - // Required. The name of the project in which to list topics. - // Format is `projects/{project-id}`. - string project = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Maximum number of topics to return. - int32 page_size = 2; - - // The value returned by the last `ListTopicsResponse`; indicates that this is - // a continuation of a prior `ListTopics` call, and that the system should - // return the next page of data. - string page_token = 3; -} - -// Response for the `ListTopics` method. -message ListTopicsResponse { - // The resulting topics. - repeated Topic topics = 1; - - // If not empty, indicates that there may be more topics that match the - // request; this value should be passed in a new `ListTopicsRequest`. - string next_page_token = 2; -} - -// Request for the `ListTopicSubscriptions` method. -message ListTopicSubscriptionsRequest { - // Required. The name of the topic that subscriptions are attached to. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Maximum number of subscription names to return. - int32 page_size = 2; - - // The value returned by the last `ListTopicSubscriptionsResponse`; indicates - // that this is a continuation of a prior `ListTopicSubscriptions` call, and - // that the system should return the next page of data. - string page_token = 3; -} - -// Response for the `ListTopicSubscriptions` method. -message ListTopicSubscriptionsResponse { - // The names of subscriptions attached to the topic specified in the request. - repeated string subscriptions = 1 [(google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - }]; - - // If not empty, indicates that there may be more subscriptions that match - // the request; this value should be passed in a new - // `ListTopicSubscriptionsRequest` to get more subscriptions. - string next_page_token = 2; -} - -// Request for the `ListTopicSnapshots` method. -message ListTopicSnapshotsRequest { - // Required. The name of the topic that snapshots are attached to. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // Maximum number of snapshot names to return. - int32 page_size = 2; - - // The value returned by the last `ListTopicSnapshotsResponse`; indicates - // that this is a continuation of a prior `ListTopicSnapshots` call, and - // that the system should return the next page of data. - string page_token = 3; -} - -// Response for the `ListTopicSnapshots` method. -message ListTopicSnapshotsResponse { - // The names of the snapshots that match the request. - repeated string snapshots = 1; - - // If not empty, indicates that there may be more snapshots that match - // the request; this value should be passed in a new - // `ListTopicSnapshotsRequest` to get more snapshots. - string next_page_token = 2; -} - -// Request for the `DeleteTopic` method. -message DeleteTopicRequest { - // Required. Name of the topic to delete. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; -} - -// Request for the DetachSubscription method. -message DetachSubscriptionRequest { - // Required. The subscription to detach. - // Format is `projects/{project}/subscriptions/{subscription}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; -} - -// Response for the DetachSubscription method. -// Reserved for future use. -message DetachSubscriptionResponse {} - -// The service that an application uses to manipulate subscriptions and to -// consume messages from a subscription via the `Pull` method or by -// establishing a bi-directional stream using the `StreamingPull` method. -service Subscriber { - 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 subscription to a given topic. See the [resource name rules] - // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - // If the subscription already exists, returns `ALREADY_EXISTS`. - // If the corresponding topic doesn't exist, returns `NOT_FOUND`. - // - // If the name is not provided in the request, the server will assign a random - // name for this subscription on the same project as the topic, conforming - // to the [resource name format] - // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - // generated name is populated in the returned Subscription object. Note that - // for REST API requests, you must specify a name in the request. - rpc CreateSubscription(Subscription) returns (Subscription) { - option (google.api.http) = { - put: "/v1/{name=projects/*/subscriptions/*}" - body: "*" - }; - option (google.api.method_signature) = - "name,topic,push_config,ack_deadline_seconds"; - } - - // Gets the configuration details of a subscription. - rpc GetSubscription(GetSubscriptionRequest) returns (Subscription) { - option (google.api.http) = { - get: "/v1/{subscription=projects/*/subscriptions/*}" - }; - option (google.api.method_signature) = "subscription"; - } - - // Updates an existing subscription. Note that certain properties of a - // subscription, such as its topic, are not modifiable. - rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) { - option (google.api.http) = { - patch: "/v1/{subscription.name=projects/*/subscriptions/*}" - body: "*" - }; - option (google.api.method_signature) = "subscription,update_mask"; - } - - // Lists matching subscriptions. - rpc ListSubscriptions(ListSubscriptionsRequest) - returns (ListSubscriptionsResponse) { - option (google.api.http) = { - get: "/v1/{project=projects/*}/subscriptions" - }; - option (google.api.method_signature) = "project"; - } - - // Deletes an existing subscription. All messages retained in the subscription - // are immediately dropped. Calls to `Pull` after deletion will return - // `NOT_FOUND`. After a subscription is deleted, a new one may be created with - // the same name, but the new one has no association with the old - // subscription or its topic unless the same topic is specified. - rpc DeleteSubscription(DeleteSubscriptionRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{subscription=projects/*/subscriptions/*}" - }; - option (google.api.method_signature) = "subscription"; - } - - // Modifies the ack deadline for a specific message. This method is useful - // to indicate that more time is needed to process a message by the - // subscriber, or to make the message available for redelivery if the - // processing was interrupted. Note that this does not modify the - // subscription-level `ackDeadlineSeconds` used for subsequent messages. - rpc ModifyAckDeadline(ModifyAckDeadlineRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline" - body: "*" - }; - option (google.api.method_signature) = - "subscription,ack_ids,ack_deadline_seconds"; - } - - // Acknowledges the messages associated with the `ack_ids` in the - // `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - // from the subscription. - // - // Acknowledging a message whose ack deadline has expired may succeed, - // but such a message may be redelivered later. Acknowledging a message more - // than once will not result in an error. - rpc Acknowledge(AcknowledgeRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:acknowledge" - body: "*" - }; - option (google.api.method_signature) = "subscription,ack_ids"; - } - - // Pulls messages from the server. - rpc Pull(PullRequest) returns (PullResponse) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:pull" - body: "*" - }; - option (google.api.method_signature) = - "subscription,return_immediately,max_messages"; - option (google.api.method_signature) = "subscription,max_messages"; - } - - // Establishes a stream with the server, which sends messages down to the - // client. The client streams acknowledgements and ack deadline modifications - // back to the server. The server will close the stream and return the status - // on any error. The server may close the stream with status `UNAVAILABLE` to - // reassign server-side resources, in which case, the client should - // re-establish the stream. Flow control can be achieved by configuring the - // underlying RPC channel. - rpc StreamingPull(stream StreamingPullRequest) - returns (stream StreamingPullResponse) {} - - // Modifies the `PushConfig` for a specified subscription. - // - // This may be used to change a push subscription to a pull one (signified by - // an empty `PushConfig`) or vice versa, or change the endpoint URL and other - // attributes of a push subscription. Messages will accumulate for delivery - // continuously through the call regardless of changes to the `PushConfig`. - rpc ModifyPushConfig(ModifyPushConfigRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig" - body: "*" - }; - option (google.api.method_signature) = "subscription,push_config"; - } - - // Gets the configuration details of a snapshot. 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. - rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { - get: "/v1/{snapshot=projects/*/snapshots/*}" - }; - option (google.api.method_signature) = "snapshot"; - } - - // Lists the existing snapshots. 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. - rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { - option (google.api.http) = { - get: "/v1/{project=projects/*}/snapshots" - }; - option (google.api.method_signature) = "project"; - } - - // Creates a snapshot from the requested subscription. 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. - // If the snapshot already exists, returns `ALREADY_EXISTS`. - // If the requested subscription doesn't exist, returns `NOT_FOUND`. - // If the backlog in the subscription is too old -- and the resulting snapshot - // would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. - // See also the `Snapshot.expire_time` field. If the name is not provided in - // the request, the server will assign a random - // name for this snapshot on the same project as the subscription, conforming - // to the [resource name format] - // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - // generated name is populated in the returned Snapshot object. Note that for - // REST API requests, you must specify a name in the request. - rpc CreateSnapshot(CreateSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { - put: "/v1/{name=projects/*/snapshots/*}" - body: "*" - }; - option (google.api.method_signature) = "name,subscription"; - } - - // Updates an existing snapshot. 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. - rpc UpdateSnapshot(UpdateSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { - patch: "/v1/{snapshot.name=projects/*/snapshots/*}" - body: "*" - }; - option (google.api.method_signature) = "snapshot,update_mask"; - } - - // Removes an existing snapshot. 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. - // When the snapshot is deleted, all messages retained in the snapshot - // are immediately dropped. After a snapshot is deleted, a new one may be - // created with the same name, but the new one has no association with the old - // snapshot or its subscription, unless the same subscription is specified. - rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{snapshot=projects/*/snapshots/*}" - }; - option (google.api.method_signature) = "snapshot"; - } - - // 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 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. - rpc Seek(SeekRequest) returns (SeekResponse) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:seek" - body: "*" - }; - } -} - -// A subscription resource. If none of `push_config`, `bigquery_config`, or -// `cloud_storage_config` is set, then the subscriber will pull and ack messages -// using API methods. At most one of these fields may be set. -message Subscription { - option (google.api.resource) = { - type: "pubsub.googleapis.com/Subscription" - pattern: "projects/{project}/subscriptions/{subscription}" - }; - - // Possible states for a subscription. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The subscription can actively receive messages - ACTIVE = 1; - - // The subscription cannot receive messages because of an error with the - // resource to which it pushes messages. See the more detailed error state - // in the corresponding configuration. - RESOURCE_ERROR = 2; - } - - // Required. The name of the subscription. It must have the format - // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - // start with a letter, and contain only letters (`[A-Za-z]`), numbers - // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - // in length, and it must not start with `"goog"`. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the topic from which this subscription is receiving - // messages. Format is `projects/{project}/topics/{topic}`. The value of this - // field will be `_deleted-topic_` if the topic has been deleted. - string topic = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // If push delivery is used with this subscription, this field is - // used to configure it. - PushConfig push_config = 4; - - // If delivery to BigQuery is used with this subscription, this field is - // used to configure it. - BigQueryConfig bigquery_config = 18; - - // If delivery to Google Cloud Storage is used with this subscription, this - // field is used to configure it. - CloudStorageConfig cloud_storage_config = 22; - - // The approximate amount of time (on a best-effort basis) Pub/Sub waits for - // the subscriber to acknowledge receipt before resending the message. In the - // interval after the message is delivered and before it is acknowledged, it - // is considered to be _outstanding_. During that time period, the - // message will not be redelivered (on a best-effort basis). - // - // For pull subscriptions, this value is used as the initial value for the ack - // deadline. To override this value for a given message, call - // `ModifyAckDeadline` with the corresponding `ack_id` if using - // non-streaming pull or send the `ack_id` in a - // `StreamingModifyAckDeadlineRequest` if using streaming pull. - // The minimum custom deadline you can specify is 10 seconds. - // The maximum custom deadline you can specify is 600 seconds (10 minutes). - // If this parameter is 0, a default value of 10 seconds is used. - // - // For push delivery, this value is also used to set the request timeout for - // the call to the push endpoint. - // - // If the subscriber never acknowledges the message, the Pub/Sub - // system will eventually redeliver the message. - int32 ack_deadline_seconds = 5; - - // Indicates whether to retain acknowledged messages. If true, then - // messages are not expunged from the subscription's backlog, even if they are - // acknowledged, until they fall out of the `message_retention_duration` - // window. This must be true if you would like to [`Seek` to a timestamp] - // (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in - // the past to replay previously-acknowledged messages. - bool retain_acked_messages = 7; - - // How long to retain unacknowledged messages in the subscription's backlog, - // from the moment a message is published. - // If `retain_acked_messages` is true, then this also configures the retention - // of acknowledged messages, and thus configures how far back in time a `Seek` - // can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 - // minutes. - google.protobuf.Duration message_retention_duration = 8; - - // See [Creating and managing - // labels](https://cloud.google.com/pubsub/docs/labels). - map labels = 9; - - // If true, messages published with the same `ordering_key` in `PubsubMessage` - // will be delivered to the subscribers in the order in which they - // are received by the Pub/Sub system. Otherwise, they may be delivered in - // any order. - bool enable_message_ordering = 10; - - // A policy that specifies the conditions for this subscription's expiration. - // A subscription is considered active as long as any connected subscriber is - // successfully consuming messages from the subscription or is issuing - // operations on the subscription. If `expiration_policy` is not set, a - // *default policy* with `ttl` of 31 days will be used. The minimum allowed - // value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, - // but `expiration_policy.ttl` is not set, the subscription never expires. - ExpirationPolicy expiration_policy = 11; - - // An expression written in the Pub/Sub [filter - // language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, - // then only `PubsubMessage`s whose `attributes` field matches the filter are - // delivered on this subscription. If empty, then no messages are filtered - // out. - string filter = 12; - - // A policy that specifies the conditions for dead lettering messages in - // this subscription. If dead_letter_policy is not set, dead lettering - // is disabled. - // - // The Cloud Pub/Sub service account associated with this subscriptions's - // parent project (i.e., - // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - // permission to Acknowledge() messages on this subscription. - DeadLetterPolicy dead_letter_policy = 13; - - // A policy that specifies how Pub/Sub retries message delivery for this - // subscription. - // - // If not set, the default retry policy is applied. This generally implies - // that messages will be retried as soon as possible for healthy subscribers. - // RetryPolicy will be triggered on NACKs or acknowledgement deadline - // exceeded events for a given message. - RetryPolicy retry_policy = 14; - - // Indicates whether the subscription is detached from its topic. Detached - // subscriptions don't receive messages from their topic and don't retain any - // backlog. `Pull` and `StreamingPull` requests will return - // FAILED_PRECONDITION. If the subscription is a push subscription, pushes to - // the endpoint will not be made. - bool detached = 15; - - // If true, Pub/Sub provides the following guarantees for the delivery of - // a message with a given value of `message_id` on this subscription: - // - // * The message sent to a subscriber is guaranteed not to be resent - // before the message's acknowledgement deadline expires. - // * An acknowledged message will not be resent to a subscriber. - // - // Note that subscribers may still receive multiple copies of a message - // when `enable_exactly_once_delivery` is true if the message was published - // multiple times by a publisher client. These copies are considered distinct - // by Pub/Sub and have distinct `message_id` values. - bool enable_exactly_once_delivery = 16; - - // Output only. Indicates the minimum duration for which a message is retained - // after it is published to the subscription's topic. If this field is set, - // messages published to the subscription's topic in the last - // `topic_message_retention_duration` are always available to subscribers. See - // the `message_retention_duration` field in `Topic`. This field is set only - // in responses from the server; it is ignored if it is set in any requests. - google.protobuf.Duration topic_message_retention_duration = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. An output-only field indicating whether or not the - // subscription can receive messages. - State state = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A policy that specifies how Cloud Pub/Sub retries message delivery. -// -// Retry delay will be exponential based on provided minimum and maximum -// backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. -// -// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded -// events for a given message. -// -// Retry Policy is implemented on a best effort basis. At times, the delay -// between consecutive deliveries may not match the configuration. That is, -// delay can be more or less than configured backoff. -message RetryPolicy { - // The minimum delay between consecutive deliveries of a given message. - // Value should be between 0 and 600 seconds. Defaults to 10 seconds. - google.protobuf.Duration minimum_backoff = 1; - - // The maximum delay between consecutive deliveries of a given message. - // Value should be between 0 and 600 seconds. Defaults to 600 seconds. - google.protobuf.Duration maximum_backoff = 2; -} - -// Dead lettering is done on a best effort basis. The same message might be -// dead lettered multiple times. -// -// If validation on any of the fields fails at subscription creation/updation, -// the create/update subscription request will fail. -message DeadLetterPolicy { - // The name of the topic to which dead letter messages should be published. - // Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service - // account associated with the enclosing subscription's parent project (i.e., - // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - // permission to Publish() to this topic. - // - // The operation will fail if the topic does not exist. - // Users should ensure that there is a subscription attached to this topic - // since messages published to a topic with no subscriptions are lost. - string dead_letter_topic = 1; - - // The maximum number of delivery attempts for any message. The value must be - // between 5 and 100. - // - // The number of delivery attempts is defined as 1 + (the sum of number of - // NACKs and number of times the acknowledgement deadline has been exceeded - // for the message). - // - // A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that - // client libraries may automatically extend ack_deadlines. - // - // This field will be honored on a best effort basis. - // - // If this parameter is 0, a default value of 5 is used. - int32 max_delivery_attempts = 2; -} - -// A policy that specifies the conditions for resource expiration (i.e., -// automatic resource deletion). -message ExpirationPolicy { - // Specifies the "time-to-live" duration for an associated resource. The - // resource expires if it is not active for a period of `ttl`. The definition - // of "activity" depends on the type of the associated resource. The minimum - // and maximum allowed values for `ttl` depend on the type of the associated - // resource, as well. If `ttl` is not set, the associated resource never - // expires. - google.protobuf.Duration ttl = 1; -} - -// Configuration for a push delivery endpoint. -message PushConfig { - // Contains information needed for generating an - // [OpenID Connect - // token](https://developers.google.com/identity/protocols/OpenIDConnect). - message OidcToken { - // [Service account - // email](https://cloud.google.com/iam/docs/service-accounts) - // used for generating the OIDC token. For more information - // on setting up authentication, see - // [Push subscriptions](https://cloud.google.com/pubsub/docs/push). - string service_account_email = 1; - - // Audience to be used when generating OIDC token. The audience claim - // identifies the recipients that the JWT is intended for. The audience - // value is a single case-sensitive string. Having multiple values (array) - // for the audience field is not supported. More info about the OIDC JWT - // token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 - // Note: if not specified, the Push endpoint URL will be used. - string audience = 2; - } - - // The payload to the push endpoint is in the form of the JSON representation - // of a PubsubMessage - // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). - message PubsubWrapper {} - - // Sets the `data` field as the HTTP body for delivery. - message NoWrapper { - // When true, writes the Pub/Sub message metadata to - // `x-goog-pubsub-:` headers of the HTTP request. Writes the - // Pub/Sub message attributes to `:` headers of the HTTP request. - bool write_metadata = 1; - } - - // A URL locating the endpoint to which messages should be pushed. - // For example, a Webhook endpoint might use `https://example.com/push`. - string push_endpoint = 1; - - // Endpoint configuration attributes that can be used to control different - // aspects of the message delivery. - // - // The only currently supported attribute is `x-goog-version`, which you can - // use to change the format of the pushed message. This attribute - // indicates the version of the data expected by the endpoint. This - // controls the shape of the pushed message (i.e., its fields and metadata). - // - // If not present during the `CreateSubscription` call, it will default to - // the version of the Pub/Sub API used to make such call. If not present in a - // `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - // calls will always return a valid version, even if the subscription was - // created without this attribute. - // - // The only supported values for the `x-goog-version` attribute are: - // - // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - // * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - // - // For example: - // `attributes { "x-goog-version": "v1" }` - map attributes = 2; - - // An authentication method used by push endpoints to verify the source of - // push requests. This can be used with push endpoints that are private by - // default to allow requests only from the Cloud Pub/Sub system, for example. - // This field is optional and should be set only by users interested in - // authenticated push. - oneof authentication_method { - // If specified, Pub/Sub will generate and attach an OIDC JWT token as an - // `Authorization` header in the HTTP request for every pushed message. - OidcToken oidc_token = 3; - } - - // The format of the delivered message to the push endpoint is defined by - // the chosen wrapper. When unset, `PubsubWrapper` is used. - oneof wrapper { - // When set, the payload to the push endpoint is in the form of the JSON - // representation of a PubsubMessage - // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). - PubsubWrapper pubsub_wrapper = 4; - - // When set, the payload to the push endpoint is not wrapped. - NoWrapper no_wrapper = 5; - } -} - -// Configuration for a BigQuery subscription. -message BigQueryConfig { - // Possible states for a BigQuery subscription. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The subscription can actively send messages to BigQuery - ACTIVE = 1; - - // Cannot write to the BigQuery table because of permission denied errors. - // This can happen if - // - Pub/Sub SA has not been granted the [appropriate BigQuery IAM - // permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account) - // - bigquery.googleapis.com API is not enabled for the project - // ([instructions](https://cloud.google.com/service-usage/docs/enable-disable)) - PERMISSION_DENIED = 2; - - // Cannot write to the BigQuery table because it does not exist. - NOT_FOUND = 3; - - // Cannot write to the BigQuery table due to a schema mismatch. - SCHEMA_MISMATCH = 4; - } - - // The name of the table to which to write data, of the form - // {projectId}.{datasetId}.{tableId} - string table = 1; - - // Optional. When true, use the topic's schema as the columns to write to in - // BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be - // enabled at the same time. - bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL]; - - // When true, write the subscription name, message_id, publish_time, - // attributes, and ordering_key to additional columns in the table. The - // subscription name, message_id, and publish_time fields are put in their own - // columns while all other message properties (other than data) are written to - // a JSON object in the attributes column. - bool write_metadata = 3; - - // When true and use_topic_schema is true, any fields that are a part of the - // topic schema that are not part of the BigQuery table schema are dropped - // when writing to BigQuery. Otherwise, the schemas must be kept in sync and - // any messages with extra fields are not written and remain in the - // subscription's backlog. - bool drop_unknown_fields = 4; - - // Output only. An output-only field that indicates whether or not the - // subscription can receive messages. - State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. When true, use the BigQuery table's schema as the columns to - // write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be - // enabled at the same time. - bool use_table_schema = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for a Cloud Storage subscription. -message CloudStorageConfig { - // Configuration for writing message data in text format. - // Message payloads will be written to files as raw text, separated by a - // newline. - message TextConfig {} - - // Configuration for writing message data in Avro format. - // Message payloads and metadata will be written to files as an Avro binary. - message AvroConfig { - // When true, write the subscription name, message_id, publish_time, - // attributes, and ordering_key as additional fields in the output. The - // subscription name, message_id, and publish_time fields are put in their - // own fields while all other message properties other than data (for - // example, an ordering_key, if present) are added as entries in the - // attributes map. - bool write_metadata = 1; - } - - // Possible states for a Cloud Storage subscription. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The subscription can actively send messages to Cloud Storage. - ACTIVE = 1; - - // Cannot write to the Cloud Storage bucket because of permission denied - // errors. - PERMISSION_DENIED = 2; - - // Cannot write to the Cloud Storage bucket because it does not exist. - NOT_FOUND = 3; - } - - // Required. User-provided name for the Cloud Storage bucket. - // The bucket must be created by the user. The bucket name must be without - // any prefix like "gs://". See the [bucket naming - // requirements] (https://cloud.google.com/storage/docs/buckets#naming). - string bucket = 1 [(google.api.field_behavior) = REQUIRED]; - - // User-provided prefix for Cloud Storage filename. See the [object naming - // requirements](https://cloud.google.com/storage/docs/objects#naming). - string filename_prefix = 2; - - // User-provided suffix for Cloud Storage filename. See the [object naming - // requirements](https://cloud.google.com/storage/docs/objects#naming). Must - // not end in "/". - string filename_suffix = 3; - - // Defaults to text format. - oneof output_format { - // If set, message data will be written to Cloud Storage in text format. - TextConfig text_config = 4; - - // If set, message data will be written to Cloud Storage in Avro format. - AvroConfig avro_config = 5; - } - - // The maximum duration that can elapse before a new Cloud Storage file is - // created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed - // the subscription's acknowledgement deadline. - google.protobuf.Duration max_duration = 6; - - // The maximum bytes that can be written to a Cloud Storage file before a new - // file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded - // in cases where messages are larger than the limit. - int64 max_bytes = 7; - - // Output only. An output-only field that indicates whether or not the - // subscription can receive messages. - State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A message and its corresponding acknowledgment ID. -message ReceivedMessage { - // This ID can be used to acknowledge the received message. - string ack_id = 1; - - // The message. - PubsubMessage message = 2; - - // The approximate number of times that Cloud Pub/Sub has attempted to deliver - // the associated message to a subscriber. - // - // More precisely, this is 1 + (number of NACKs) + - // (number of ack_deadline exceeds) for this message. - // - // A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline - // exceeds event is whenever a message is not acknowledged within - // ack_deadline. Note that ack_deadline is initially - // Subscription.ackDeadlineSeconds, but may get extended automatically by - // the client library. - // - // Upon the first delivery of a given message, `delivery_attempt` will have a - // value of 1. The value is calculated at best effort and is approximate. - // - // If a DeadLetterPolicy is not set on the subscription, this will be 0. - int32 delivery_attempt = 3; -} - -// Request for the GetSubscription method. -message GetSubscriptionRequest { - // Required. The name of the subscription to get. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; -} - -// Request for the UpdateSubscription method. -message UpdateSubscriptionRequest { - // Required. The updated subscription object. - Subscription subscription = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Indicates which fields in the provided subscription to update. - // Must be specified and non-empty. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `ListSubscriptions` method. -message ListSubscriptionsRequest { - // Required. The name of the project in which to list subscriptions. - // Format is `projects/{project-id}`. - string project = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Maximum number of subscriptions to return. - int32 page_size = 2; - - // The value returned by the last `ListSubscriptionsResponse`; indicates that - // this is a continuation of a prior `ListSubscriptions` call, and that the - // system should return the next page of data. - string page_token = 3; -} - -// Response for the `ListSubscriptions` method. -message ListSubscriptionsResponse { - // The subscriptions that match the request. - repeated Subscription subscriptions = 1; - - // If not empty, indicates that there may be more subscriptions that match - // the request; this value should be passed in a new - // `ListSubscriptionsRequest` to get more subscriptions. - string next_page_token = 2; -} - -// Request for the DeleteSubscription method. -message DeleteSubscriptionRequest { - // Required. The subscription to delete. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; -} - -// Request for the ModifyPushConfig method. -message ModifyPushConfigRequest { - // Required. The name of the subscription. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Required. The push configuration for future deliveries. - // - // An empty `pushConfig` indicates that the Pub/Sub system should - // stop pushing messages from the given subscription and allow - // messages to be pulled and acknowledged - effectively pausing - // the subscription if `Pull` or `StreamingPull` is not called. - PushConfig push_config = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `Pull` method. -message PullRequest { - // Required. The subscription from which messages should be pulled. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Optional. If this field set to true, the system will respond immediately - // even if it there are no messages available to return in the `Pull` - // response. Otherwise, the system may wait (for a bounded amount of time) - // until at least one message is available, rather than returning no messages. - // Warning: setting this field to `true` is discouraged because it adversely - // impacts the performance of `Pull` operations. We recommend that users do - // not set this field. - bool return_immediately = 2 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Required. The maximum number of messages to return for this request. Must - // be a positive integer. The Pub/Sub system may return fewer than the number - // specified. - int32 max_messages = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response for the `Pull` method. -message PullResponse { - // Received Pub/Sub messages. The list will be empty if there are no more - // messages available in the backlog, or if no messages could be returned - // before the request timeout. For JSON, the response can be entirely - // empty. The Pub/Sub system may return fewer than the `maxMessages` requested - // even if there are more messages available in the backlog. - repeated ReceivedMessage received_messages = 1; -} - -// Request for the ModifyAckDeadline method. -message ModifyAckDeadlineRequest { - // Required. The name of the subscription. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Required. List of acknowledgment IDs. - repeated string ack_ids = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The new ack deadline with respect to the time this request was - // sent to the Pub/Sub system. For example, if the value is 10, the new ack - // deadline will expire 10 seconds after the `ModifyAckDeadline` call was - // made. Specifying zero might immediately make the message available for - // delivery to another subscriber client. This typically results in an - // increase in the rate of message redeliveries (that is, duplicates). - // The minimum deadline you can specify is 0 seconds. - // The maximum deadline you can specify is 600 seconds (10 minutes). - int32 ack_deadline_seconds = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the Acknowledge method. -message AcknowledgeRequest { - // Required. The subscription whose message is being acknowledged. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // Required. The acknowledgment ID for the messages being acknowledged that - // was returned by the Pub/Sub system in the `Pull` response. Must not be - // empty. - repeated string ack_ids = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `StreamingPull` streaming RPC method. This request is used to -// establish the initial stream as well as to stream acknowledgements and ack -// deadline modifications from the client to the server. -message StreamingPullRequest { - // Required. The subscription for which to initialize the new stream. This - // must be provided in the first request on the stream, and must not be set in - // subsequent requests from client to server. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // List of acknowledgement IDs for acknowledging previously received messages - // (received on this stream or a different stream). If an ack ID has expired, - // the corresponding message may be redelivered later. Acknowledging a message - // more than once will not result in an error. If the acknowledgement ID is - // malformed, the stream will be aborted with status `INVALID_ARGUMENT`. - repeated string ack_ids = 2; - - // The list of new ack deadlines for the IDs listed in - // `modify_deadline_ack_ids`. The size of this list must be the same as the - // size of `modify_deadline_ack_ids`. If it differs the stream will be aborted - // with `INVALID_ARGUMENT`. Each element in this list is applied to the - // element in the same position in `modify_deadline_ack_ids`. The new ack - // deadline is with respect to the time this request was sent to the Pub/Sub - // system. Must be >= 0. For example, if the value is 10, the new ack deadline - // will expire 10 seconds after this request is received. If the value is 0, - // the message is immediately made available for another streaming or - // non-streaming pull request. If the value is < 0 (an error), the stream will - // be aborted with status `INVALID_ARGUMENT`. - repeated int32 modify_deadline_seconds = 3; - - // List of acknowledgement IDs whose deadline will be modified based on the - // corresponding element in `modify_deadline_seconds`. This field can be used - // to indicate that more time is needed to process a message by the - // subscriber, or to make the message available for redelivery if the - // processing was interrupted. - repeated string modify_deadline_ack_ids = 4; - - // Required. The ack deadline to use for the stream. This must be provided in - // the first request on the stream, but it can also be updated on subsequent - // requests from client to server. The minimum deadline you can specify is 10 - // seconds. The maximum deadline you can specify is 600 seconds (10 minutes). - int32 stream_ack_deadline_seconds = 5 - [(google.api.field_behavior) = REQUIRED]; - - // A unique identifier that is used to distinguish client instances from each - // other. Only needs to be provided on the initial request. When a stream - // disconnects and reconnects for the same stream, the client_id should be set - // to the same value so that state associated with the old stream can be - // transferred to the new stream. The same client_id should not be used for - // different client instances. - string client_id = 6; - - // Flow control settings for the maximum number of outstanding messages. When - // there are `max_outstanding_messages` or more currently sent to the - // streaming pull client that have not yet been acked or nacked, the server - // stops sending more messages. The sending of messages resumes once the - // number of outstanding messages is less than this value. If the value is - // <= 0, there is no limit to the number of outstanding messages. This - // property can only be set on the initial StreamingPullRequest. If it is set - // on a subsequent request, the stream will be aborted with status - // `INVALID_ARGUMENT`. - int64 max_outstanding_messages = 7; - - // Flow control settings for the maximum number of outstanding bytes. When - // there are `max_outstanding_bytes` or more worth of messages currently sent - // to the streaming pull client that have not yet been acked or nacked, the - // server will stop sending more messages. The sending of messages resumes - // once the number of outstanding bytes is less than this value. If the value - // is <= 0, there is no limit to the number of outstanding bytes. This - // property can only be set on the initial StreamingPullRequest. If it is set - // on a subsequent request, the stream will be aborted with status - // `INVALID_ARGUMENT`. - int64 max_outstanding_bytes = 8; -} - -// Response for the `StreamingPull` method. This response is used to stream -// messages from the server to the client. -message StreamingPullResponse { - // Acknowledgement IDs sent in one or more previous requests to acknowledge a - // previously received message. - message AcknowledgeConfirmation { - // Successfully processed acknowledgement IDs. - repeated string ack_ids = 1; - - // List of acknowledgement IDs that were malformed or whose acknowledgement - // deadline has expired. - repeated string invalid_ack_ids = 2; - - // List of acknowledgement IDs that were out of order. - repeated string unordered_ack_ids = 3; - - // List of acknowledgement IDs that failed processing with temporary issues. - repeated string temporary_failed_ack_ids = 4; - } - - // Acknowledgement IDs sent in one or more previous requests to modify the - // deadline for a specific message. - message ModifyAckDeadlineConfirmation { - // Successfully processed acknowledgement IDs. - repeated string ack_ids = 1; - - // List of acknowledgement IDs that were malformed or whose acknowledgement - // deadline has expired. - repeated string invalid_ack_ids = 2; - - // List of acknowledgement IDs that failed processing with temporary issues. - repeated string temporary_failed_ack_ids = 3; - } - - // Subscription properties sent as part of the response. - message SubscriptionProperties { - // True iff exactly once delivery is enabled for this subscription. - bool exactly_once_delivery_enabled = 1; - - // True iff message ordering is enabled for this subscription. - bool message_ordering_enabled = 2; - } - - // Received Pub/Sub messages. This will not be empty. - repeated ReceivedMessage received_messages = 1; - - // This field will only be set if `enable_exactly_once_delivery` is set to - // `true`. - AcknowledgeConfirmation acknowledge_confirmation = 5; - - // This field will only be set if `enable_exactly_once_delivery` is set to - // `true`. - ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; - - // Properties associated with this subscription. - SubscriptionProperties subscription_properties = 4; -} - -// Request for the `CreateSnapshot` method. -message CreateSnapshotRequest { - // Required. User-provided name for this snapshot. If the name is not provided - // in the request, the server will assign a random name for this snapshot on - // the same project as the subscription. Note that for REST API requests, you - // must specify a name. See the [resource name - // rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - // Format is `projects/{project}/snapshots/{snap}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } - ]; - - // Required. The subscription whose backlog the snapshot retains. - // Specifically, the created snapshot is guaranteed to retain: - // (a) The existing backlog on the subscription. More precisely, this is - // defined as the messages in the subscription's backlog that are - // unacknowledged upon the successful completion of the - // `CreateSnapshot` request; as well as: - // (b) Any messages published to the subscription's topic following the - // successful completion of the CreateSnapshot request. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - // See [Creating and managing - // labels](https://cloud.google.com/pubsub/docs/labels). - map labels = 3; -} - -// Request for the UpdateSnapshot method. -message UpdateSnapshotRequest { - // Required. The updated snapshot object. - Snapshot snapshot = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Indicates which fields in the provided snapshot to update. - // Must be specified and non-empty. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// A snapshot resource. 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. -message Snapshot { - option (google.api.resource) = { - type: "pubsub.googleapis.com/Snapshot" - pattern: "projects/{project}/snapshots/{snapshot}" - }; - - // The name of the snapshot. - string name = 1; - - // The name of the topic from which this snapshot is retaining messages. - string topic = 2 [ - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } - ]; - - // The snapshot is guaranteed to exist up until this time. - // A newly-created snapshot expires no later than 7 days from the time of its - // creation. Its exact lifetime is determined at creation by the existing - // backlog in the source subscription. Specifically, the lifetime of the - // snapshot is `7 days - (age of oldest unacked message in the subscription)`. - // For example, consider a subscription whose oldest unacked message is 3 days - // old. If a snapshot is created from this subscription, the snapshot -- which - // will always capture this 3-day-old backlog as long as the snapshot - // exists -- will expire in 4 days. The service will refuse to create a - // snapshot that would expire in less than 1 hour after creation. - google.protobuf.Timestamp expire_time = 3; - - // See [Creating and managing labels] - // (https://cloud.google.com/pubsub/docs/labels). - map labels = 4; -} - -// Request for the GetSnapshot method. -message GetSnapshotRequest { - // Required. The name of the snapshot to get. - // Format is `projects/{project}/snapshots/{snap}`. - string snapshot = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } - ]; -} - -// Request for the `ListSnapshots` method. -message ListSnapshotsRequest { - // Required. The name of the project in which to list snapshots. - // Format is `projects/{project-id}`. - string project = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Maximum number of snapshots to return. - int32 page_size = 2; - - // The value returned by the last `ListSnapshotsResponse`; indicates that this - // is a continuation of a prior `ListSnapshots` call, and that the system - // should return the next page of data. - string page_token = 3; -} - -// Response for the `ListSnapshots` method. -message ListSnapshotsResponse { - // The resulting snapshots. - repeated Snapshot snapshots = 1; - - // If not empty, indicates that there may be more snapshot that match the - // request; this value should be passed in a new `ListSnapshotsRequest`. - string next_page_token = 2; -} - -// Request for the `DeleteSnapshot` method. -message DeleteSnapshotRequest { - // Required. The name of the snapshot to delete. - // Format is `projects/{project}/snapshots/{snap}`. - string snapshot = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" } - ]; -} - -// Request for the `Seek` method. -message SeekRequest { - // Required. The subscription to affect. - string subscription = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - } - ]; - - oneof target { - // The time to seek to. - // Messages retained in the subscription that were published before this - // time are marked as acknowledged, and messages retained in the - // subscription that were published after this time are marked as - // unacknowledged. Note that this operation affects only those messages - // retained in the subscription (configured by the combination of - // `message_retention_duration` and `retain_acked_messages`). For example, - // if `time` corresponds to a point before the message retention - // window (or to a point before the system's notion of the subscription - // creation time), only retained messages will be marked as unacknowledged, - // and already-expunged messages will not be restored. - google.protobuf.Timestamp time = 2; - - // The snapshot to seek to. The snapshot's topic must be the same as that of - // the provided subscription. - // Format is `projects/{project}/snapshots/{snap}`. - string snapshot = 3 [(google.api.resource_reference) = { - type: "pubsub.googleapis.com/Snapshot" - }]; - } -} - -// Response for the `Seek` method (this response is empty). -message SeekResponse {} 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 deleted file mode 100644 index 32aa0d75c..000000000 --- a/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/schema.proto +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright 2023 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"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.PubSub.V1"; -option go_package = "cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb"; -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. -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"; - } - - // Lists all schema revisions for the named schema. - rpc ListSchemaRevisions(ListSchemaRevisionsRequest) - returns (ListSchemaRevisionsResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/schemas/*}:listRevisions" - }; - option (google.api.method_signature) = "name"; - } - - // Commits a new schema revision to an existing schema. - rpc CommitSchema(CommitSchemaRequest) returns (Schema) { - option (google.api.http) = { - post: "/v1/{name=projects/*/schemas/*}:commit" - body: "*" - }; - option (google.api.method_signature) = "name,schema"; - } - - // Creates a new schema revision that is a copy of the provided revision_id. - rpc RollbackSchema(RollbackSchemaRequest) returns (Schema) { - option (google.api.http) = { - post: "/v1/{name=projects/*/schemas/*}:rollback" - body: "*" - }; - option (google.api.method_signature) = "name,revision_id"; - } - - // Deletes a specific schema revision. - rpc DeleteSchemaRevision(DeleteSchemaRevisionRequest) returns (Schema) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/schemas/*}:deleteRevision" - }; - option (google.api.method_signature) = "name,revision_id"; - } - - // 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; - - // Output only. Immutable. The revision ID of the schema. - string revision_id = 4 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. The timestamp that the revision was created. - google.protobuf.Timestamp revision_create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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 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; -} - -// 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 all fields filled out. Set to `BASIC` to omit the `definition`. - 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 `ListSchemaRevisions` method. -message ListSchemaRevisionsRequest { - // Required. The name of the schema to list revisions for. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // 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; - - // The maximum number of revisions to return per page. - int32 page_size = 3; - - // The page token, received from a previous ListSchemaRevisions call. - // Provide this to retrieve the subsequent page. - string page_token = 4; -} - -// Response for the `ListSchemaRevisions` method. -message ListSchemaRevisionsResponse { - // The revisions of the schema. - repeated Schema schemas = 1; - - // A token that can be sent as `page_token` to retrieve the next page. - // If this field is empty, there are no subsequent pages. - string next_page_token = 2; -} - -// Request for CommitSchema method. -message CommitSchemaRequest { - // Required. The name of the schema we are revising. - // Format is `projects/{project}/schemas/{schema}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // Required. The schema revision to commit. - Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `RollbackSchema` method. -message RollbackSchemaRequest { - // Required. The schema being rolled back with revision id. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // Required. The revision ID to roll back to. - // It must be a revision of the same schema. - // - // Example: c7cfa2a8 - string revision_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `DeleteSchemaRevision` method. -message DeleteSchemaRevisionRequest { - // Required. The name of the schema revision to be deleted, with a revision ID - // explicitly included. - // - // Example: `projects/123/schemas/my-schema@c7cfa2a8` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } - ]; - - // Optional. This field is deprecated and should not be used for specifying - // the revision ID. The revision ID should be specified via the `name` - // parameter. - string revision_id = 2 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; -} - -// 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. -// Empty for now. -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. -// Empty for now. -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; -}